123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- import { Platform } from '../platform/platform';
- /**
- * @hidden
- */
- export declare class Animation {
- private _c;
- private _cL;
- private _e;
- private _eL;
- private _fx;
- private _dur;
- private _es;
- private _rvEs;
- private _bfSty;
- private _bfAdd;
- private _bfRm;
- private _afSty;
- private _afAdd;
- private _afRm;
- private _rdFn;
- private _wrFn;
- private _fFn;
- private _fOneFn;
- private _rv;
- private _unrgTrns;
- private _tm;
- private _hasDur;
- private _isAsync;
- private _twn;
- plt: Platform;
- parent: Animation;
- opts: AnimationOptions;
- hasChildren: boolean;
- isPlaying: boolean;
- hasCompleted: boolean;
- constructor(plt: Platform, ele?: any, opts?: AnimationOptions);
- element(ele: any): Animation;
- /**
- * NO DOM
- */
- private _addEle(ele);
- /**
- * Add a child animation to this animation.
- */
- add(childAnimation: Animation): Animation;
- /**
- * Get the duration of this animation. If this animation does
- * not have a duration, then it'll get the duration from its parent.
- */
- getDuration(opts?: PlayOptions): number;
- /**
- * Returns if the animation is a root one.
- */
- isRoot(): boolean;
- /**
- * Set the duration for this animation.
- */
- duration(milliseconds: number): Animation;
- /**
- * Get the easing of this animation. If this animation does
- * not have an easing, then it'll get the easing from its parent.
- */
- getEasing(): string;
- /**
- * Set the easing for this animation.
- */
- easing(name: string): Animation;
- /**
- * Set the easing for this reversed animation.
- */
- easingReverse(name: string): Animation;
- /**
- * Add the "from" value for a specific property.
- */
- from(prop: string, val: any): Animation;
- /**
- * Add the "to" value for a specific property.
- */
- to(prop: string, val: any, clearProperyAfterTransition?: boolean): Animation;
- /**
- * Shortcut to add both the "from" and "to" for the same property.
- */
- fromTo(prop: string, fromVal: any, toVal: any, clearProperyAfterTransition?: boolean): Animation;
- /**
- * @hidden
- * NO DOM
- */
- private _getProp(name);
- private _addProp(state, prop, val);
- /**
- * Add CSS class to this animation's elements
- * before the animation begins.
- */
- beforeAddClass(className: string): Animation;
- /**
- * Remove CSS class from this animation's elements
- * before the animation begins.
- */
- beforeRemoveClass(className: string): Animation;
- /**
- * Set CSS inline styles to this animation's elements
- * before the animation begins.
- */
- beforeStyles(styles: {
- [property: string]: any;
- }): Animation;
- /**
- * Clear CSS inline styles from this animation's elements
- * before the animation begins.
- */
- beforeClearStyles(propertyNames: string[]): Animation;
- /**
- * Add a function which contains DOM reads, which will run
- * before the animation begins.
- */
- beforeAddRead(domReadFn: Function): Animation;
- /**
- * Add a function which contains DOM writes, which will run
- * before the animation begins.
- */
- beforeAddWrite(domWriteFn: Function): Animation;
- /**
- * Add CSS class to this animation's elements
- * after the animation finishes.
- */
- afterAddClass(className: string): Animation;
- /**
- * Remove CSS class from this animation's elements
- * after the animation finishes.
- */
- afterRemoveClass(className: string): Animation;
- /**
- * Set CSS inline styles to this animation's elements
- * after the animation finishes.
- */
- afterStyles(styles: {
- [property: string]: any;
- }): Animation;
- /**
- * Clear CSS inline styles from this animation's elements
- * after the animation finishes.
- */
- afterClearStyles(propertyNames: string[]): Animation;
- /**
- * Play the animation.
- */
- play(opts?: PlayOptions): void;
- syncPlay(): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _playInit(opts: PlayOptions): void;
- /**
- * @hidden
- * DOM WRITE
- * NO RECURSION
- * ROOT ANIMATION
- */
- _playDomInspect(opts: PlayOptions): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _playProgress(opts: PlayOptions): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _playToStep(stepValue: number): void;
- /**
- * @hidden
- * DOM WRITE
- * NO RECURSION
- * ROOT ANIMATION
- */
- _asyncEnd(dur: number, shouldComplete: boolean): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _playEnd(stepValue?: number): void;
- /**
- * @hidden
- * NO DOM
- * RECURSION
- */
- _hasDuration(opts: PlayOptions): boolean;
- /**
- * @hidden
- * NO DOM
- * RECURSION
- */
- _hasDomReads(): boolean;
- /**
- * Immediately stop at the end of the animation.
- */
- stop(stepValue?: number): void;
- /**
- * @hidden
- * NO DOM
- * NO RECURSION
- */
- _clearAsync(): void;
- /**
- * @hidden
- * DOM WRITE
- * NO RECURSION
- */
- _progress(stepValue: number): void;
- /**
- * @hidden
- * DOM WRITE
- * NO RECURSION
- */
- _setTrans(dur: number, forcedLinearEasing: boolean): void;
- /**
- * @hidden
- * DOM READ
- * DOM WRITE
- * RECURSION
- */
- _beforeAnimation(): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _setBeforeStyles(): void;
- /**
- * @hidden
- * DOM READ
- * RECURSION
- */
- _fireBeforeReadFunc(): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _fireBeforeWriteFunc(): void;
- /**
- * @hidden
- * DOM WRITE
- */
- _setAfterStyles(): void;
- /**
- * @hidden
- * DOM WRITE
- * NO RECURSION
- */
- _willChg(addWillChange: boolean): void;
- /**
- * Start the animation with a user controlled progress.
- */
- progressStart(): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _progressStart(): void;
- /**
- * Set the progress step for this animation.
- * progressStep() is not debounced, so it should not be called faster than 60FPS.
- */
- progressStep(stepValue: number): void;
- /**
- * End the progress animation.
- */
- progressEnd(shouldComplete: boolean, currentStepValue: number, dur?: number): void;
- /**
- * @hidden
- * DOM WRITE
- * RECURSION
- */
- _progressEnd(shouldComplete: boolean, stepValue: number, dur: number, isAsync: boolean): void;
- /**
- * Add a callback to fire when the animation has finished.
- */
- onFinish(callback: Function, onceTimeCallback?: boolean, clearOnFinishCallacks?: boolean): Animation;
- /**
- * @hidden
- * NO DOM
- * RECURSION
- */
- _didFinishAll(hasCompleted: boolean, finishAsyncAnimations: boolean, finishNoDurationAnimations: boolean): void;
- /**
- * @hidden
- * NO RECURSION
- */
- _didFinish(hasCompleted: boolean): void;
- /**
- * Reverse the animation.
- */
- reverse(shouldReverse?: boolean): Animation;
- /**
- * Recursively destroy this animation and all child animations.
- */
- destroy(): void;
- /**
- * @hidden
- * NO DOM
- */
- _transEl(): HTMLElement;
- }
- export interface AnimationOptions {
- animation?: string;
- duration?: number;
- easing?: string;
- direction?: string;
- isRTL?: boolean;
- ev?: any;
- }
- export interface PlayOptions {
- duration?: number;
- }
- export interface EffectProperty {
- name: string;
- trans: boolean;
- wc?: string;
- to?: EffectState;
- from?: EffectState;
- }
- export interface EffectState {
- val: any;
- num: number;
- unit: string;
- }
|