@mkbabb/keyframes.js 1.1.0 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ declare class Animation_2<V extends Vars = any> {
11
11
  targets: HTMLElement[];
12
12
  options: AnimationOptions;
13
13
  templateFrames: TemplateAnimationFrame<V>[];
14
- parsedVars: any[];
14
+ parsedVars: ParsedVarMap[];
15
15
  frameId: number;
16
16
  frames: AnimationFrame<V>[];
17
17
  handleId: number | any;
@@ -28,6 +28,7 @@ declare class Animation_2<V extends Vars = any> {
28
28
  managed: boolean;
29
29
  unflatten: boolean;
30
30
  private resolvePromise;
31
+ private _playingPromise;
31
32
  private dispatchAnimationEvent;
32
33
  constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
33
34
  convertFrameStart(frame: TemplateAnimationFrame<V>): TemplateAnimationFrame<V>;
@@ -48,7 +49,7 @@ declare class Animation_2<V extends Vars = any> {
48
49
  reverse(): this;
49
50
  fillForwards(): void;
50
51
  fillBackwards(): void;
51
- interpFrames(t: number, transformFrames?: boolean): Record<string, any>;
52
+ interpFrames(t: number, transformFrames?: boolean): Record<string, ValueUnit<any, string | undefined>[]>;
52
53
  onStart(): Promise<void>;
53
54
  onEnd(): Promise<void>;
54
55
  tick(t: number): Promise<number>;
@@ -59,6 +60,7 @@ declare class Animation_2<V extends Vars = any> {
59
60
  private _playWAAPI;
60
61
  play(): Promise<void>;
61
62
  pause(draw?: boolean): this;
63
+ resume(): this;
62
64
  stop(): void;
63
65
  playing(): boolean;
64
66
  /** Returns the effective time accounting for direction reversal. */
@@ -89,7 +91,7 @@ declare interface AnimationFrame<V extends Vars> {
89
91
  timingFunction: TimingFunction;
90
92
  }
91
93
 
92
- declare class AnimationGroup<V extends Vars> {
94
+ export declare class AnimationGroup<V extends Vars> {
93
95
  animations: AnimationGroupObject<V>;
94
96
  transform: TransformFunction<V>;
95
97
  superKey: string | undefined;
@@ -97,6 +99,7 @@ declare class AnimationGroup<V extends Vars> {
97
99
  started: boolean;
98
100
  done: boolean;
99
101
  singleTarget: boolean;
102
+ lastTickTime: number;
100
103
  handleId: number | any;
101
104
  resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
102
105
  constructor(...inputs: (Animation_2<V> | AnimationGroupInput<V>)[]);
@@ -104,7 +107,7 @@ declare class AnimationGroup<V extends Vars> {
104
107
  setTargets(...targets: HTMLElement[]): this;
105
108
  onStart(): this;
106
109
  onEnd(): this;
107
- transformFramesGrouped(t: number): Vars<ValueArray<any>>;
110
+ transformFramesGrouped(t: number): Record<string, unknown>;
108
111
  tick(t: number): Promise<this>;
109
112
  draw(t: number): Promise<void>;
110
113
  play(): Promise<unknown>;
@@ -124,7 +127,7 @@ declare class AnimationGroup<V extends Vars> {
124
127
 
125
128
  declare interface AnimationGroupEntry<V extends Vars> {
126
129
  animation: Animation_2<V>;
127
- values: Vars<ValueArray>;
130
+ values: Record<string, unknown>;
128
131
  layer: AnimationLayerConfig;
129
132
  }
130
133
 
@@ -170,7 +173,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends Animation_2<V
170
173
  fromVars(vars: V[], transform?: TransformFunction<V>): this;
171
174
  fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
172
175
  fromString(keyframes: string, transform?: TransformFunction<V>): this;
173
- transform(vars: any): void;
176
+ transform(vars: V): void;
174
177
  }
175
178
 
176
179
  declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
@@ -192,6 +195,8 @@ declare type InputAnimationOptions = Partial<{
192
195
  hueMethod?: HueInterpolationMethod;
193
196
  }>;
194
197
 
198
+ declare type ParsedVarMap = Record<string, ValueArray>;
199
+
195
200
  declare interface TemplateAnimationFrame<V extends Vars> {
196
201
  id: number;
197
202
  start: ValueUnit;