Blame view

node_modules/zrender/lib/animation/Animator.d.ts 3.32 KB
bd028579   易尊强   2/28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
  import Clip from './Clip';
  import { ArrayLike, Dictionary } from '../core/types';
  import { AnimationEasing } from './easing';
  import Animation from './Animation';
  declare type NumberArray = ArrayLike<number>;
  declare type InterpolatableType = string | number | NumberArray | NumberArray[];
  export declare function cloneValue(value: InterpolatableType): number | any[];
  declare type ValueType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
  declare type Keyframe = {
      time: number;
      value: unknown;
      percent: number;
      rawValue: unknown;
      easing?: AnimationEasing;
      easingFunc?: (percent: number) => number;
      additiveValue?: unknown;
  };
  declare class Track {
      keyframes: Keyframe[];
      propName: string;
      valType: ValueType;
      discrete: boolean;
      _invalid: boolean;
      private _finished;
      private _needsSort;
      private _additiveTrack;
      private _additiveValue;
      private _lastFr;
      private _lastFrP;
      constructor(propName: string);
      isFinished(): boolean;
      setFinished(): void;
      needsAnimate(): boolean;
      getAdditiveTrack(): Track;
      addKeyframe(time: number, rawValue: unknown, easing?: AnimationEasing): Keyframe;
      prepare(maxTime: number, additiveTrack?: Track): void;
      step(target: any, percent: number): void;
      private _addToTarget;
  }
  declare type DoneCallback = () => void;
  declare type AbortCallback = () => void;
  export declare type OnframeCallback<T> = (target: T, percent: number) => void;
  export declare type AnimationPropGetter<T> = (target: T, key: string) => InterpolatableType;
  export declare type AnimationPropSetter<T> = (target: T, key: string, value: InterpolatableType) => void;
  export default class Animator<T> {
      animation?: Animation;
      targetName?: string;
      scope?: string;
      __fromStateTransition?: string;
      private _tracks;
      private _trackKeys;
      private _target;
      private _loop;
      private _delay;
      private _maxTime;
      private _force;
      private _paused;
      private _started;
      private _allowDiscrete;
      private _additiveAnimators;
      private _doneCbs;
      private _onframeCbs;
      private _abortedCbs;
      private _clip;
      constructor(target: T, loop: boolean, allowDiscreteAnimation?: boolean, additiveTo?: Animator<any>[]);
      getMaxTime(): number;
      getDelay(): number;
      getLoop(): boolean;
      getTarget(): T;
      changeTarget(target: T): void;
      when(time: number, props: Dictionary<any>, easing?: AnimationEasing): this;
      whenWithKeys(time: number, props: Dictionary<any>, propNames: string[], easing?: AnimationEasing): this;
      pause(): void;
      resume(): void;
      isPaused(): boolean;
      duration(duration: number): this;
      private _doneCallback;
      private _abortedCallback;
      private _setTracksFinished;
      private _getAdditiveTrack;
      start(easing?: AnimationEasing): this;
      stop(forwardToLast?: boolean): void;
      delay(time: number): this;
      during(cb: OnframeCallback<T>): this;
      done(cb: DoneCallback): this;
      aborted(cb: AbortCallback): this;
      getClip(): Clip;
      getTrack(propName: string): Track;
      getTracks(): Track[];
      stopTracks(propNames: string[], forwardToLast?: boolean): boolean;
      saveTo(target: T, trackKeys?: readonly string[], firstOrLast?: boolean): void;
      __changeFinalValue(finalProps: Dictionary<any>, trackKeys?: readonly string[]): void;
  }
  export declare type AnimatorTrack = Track;
  export {};