import type { Node, TimelineNodeProperties } from '../main'; import { RawWeakMap } from 'modern-idoc'; import { PathMeasure } from 'modern-path2d'; import { Element2D } from '../2d'; import { TimelineNode } from '../main'; export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): (amount: number) => number; /** CSS 缓动预设:name → cubic-bezier 控制点 [x1, y1, x2, y2] */ export declare const cssEasingPresets: { readonly linear: readonly [0, 0, 1, 1]; readonly ease: readonly [0.25, 0.1, 0.25, 1]; readonly 'ease-in': readonly [0.42, 0, 1, 1]; readonly 'ease-out': readonly [0, 0, 0.58, 1]; readonly 'ease-in-out': readonly [0.42, 0, 0.58, 1]; readonly 'ease-in-quad': readonly [0.55, 0.085, 0.68, 0.53]; readonly 'ease-out-quad': readonly [0.25, 0.46, 0.45, 0.94]; readonly 'ease-in-out-quad': readonly [0.455, 0.03, 0.515, 0.955]; readonly 'ease-in-cubic': readonly [0.55, 0.055, 0.675, 0.19]; readonly 'ease-out-cubic': readonly [0.215, 0.61, 0.355, 1]; readonly 'ease-in-out-cubic': readonly [0.645, 0.045, 0.355, 1]; }; export type CssEasing = keyof typeof cssEasingPresets; export type Easing = CssEasing | `cubic-bezier(${string})`; export interface Keyframe { easing?: Easing; offset?: number; [property: string]: string | number | null | undefined; } export interface NormalizedKeyframe { easing: (amount: number) => number; offset: number; props: Record; } export type AnimationEffectMode = 'parent' | 'sibling'; export interface AnimationProperties extends Omit { effectMode: AnimationEffectMode; loop: boolean; keyframes: Keyframe[]; } export declare class Animation extends TimelineNode { effectMode: AnimationEffectMode; keyframes: Keyframe[]; easing: Easing | undefined; protected _keyframes: NormalizedKeyframe[]; protected _isFirstUpdatePosition: boolean; protected _cachedProps: RawWeakMap>; protected _stoped: boolean; protected _pathMeasures: Map; constructor(properties?: Partial, children?: Node[]); protected _parented(parent: Node): void; protected _unparented(oldParent: Node): void; protected _process(delta: number): void; protected _updateProperty(key: string, value: any, oldValue: any): void; protected _getTargets(): Element2D[]; protected _updateKeyframes(): void; commitStyles(): void; protected _updateCachedProps(): void; protected _parseEasing(easing: Easing | undefined): (amount: number) => number; protected _parseKeyframes(currentTime: number, startProps: Map): [NormalizedKeyframe, NormalizedKeyframe] | null; protected _commitStyle(currentTime: number, target: Element2D, startProps: Map, previous: NormalizedKeyframe, current: NormalizedKeyframe): void; /** 按运动路径采样:在 offsetPath 上取 offsetDistance 处的点,合成为 transform 的位移(+offsetRotate 旋转) */ protected _commitOffsetPath(target: Element2D, offsetPath: string, startProps: Map, previousProps: Record, currentProps: Record, weight: number): void; protected _getDiffValue(name: string, previous: string | undefined, current: string | undefined, weight: number, context: Record): any; isPlaying(): boolean; play(): boolean; pause(): boolean; stop(): boolean; cancel(): void; }