UNPKG

2.05 kBTypeScriptView Raw
1import type { IElement } from '../dom/interfaces';
2import { AnimationEffectTiming } from './AnimationEffectTiming';
3import type { Animation } from './Animation';
4export declare function makeTiming(timingInput: KeyframeEffectOptions, forGroup: boolean): AnimationEffectTiming;
5export declare function normalizeTimingInput(timingInput: KeyframeEffectOptions | number | undefined, forGroup: boolean): AnimationEffectTiming;
6export declare function numericTimingToObject(timingInput: KeyframeEffectOptions | number): KeyframeEffectOptions;
7/**
8 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect
9 * @example
10 const circleDownKeyframes = new KeyframeEffect(
11 circle, // element to animate
12 [
13 { transform: 'translateY(0)' }, // keyframe
14 { transform: 'translateY(100)' } // keyframe
15 ],
16 { duration: 3000, fill: 'forwards' } // keyframe options
17 );
18 *
19 */
20export declare class KeyframeEffect {
21 composite: CompositeOperation;
22 iterationComposite: IterationCompositeOperation;
23 target: IElement | null;
24 animation: Animation | null;
25 timing: AnimationEffectTiming;
26 private computedTiming;
27 normalizedKeyframes: ComputedKeyframe[];
28 private timeFraction;
29 private interpolations;
30 constructor(target: IElement | null, effectInput: Keyframe[] | PropertyIndexedKeyframes | null, timingInput?: KeyframeEffectOptions | number);
31 applyInterpolations(): void;
32 update(localTime: number | null): boolean;
33 getKeyframes(): ComputedKeyframe[];
34 setKeyframes(keyframes: Keyframe[] | PropertyIndexedKeyframes | null): void;
35 /**
36 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming
37 */
38 getComputedTiming(): ComputedEffectTiming;
39 /**
40 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getTiming
41 */
42 getTiming(): EffectTiming;
43 /**
44 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/updateTiming
45 */
46 updateTiming(timing?: OptionalEffectTiming): void;
47}