import type { EasingType, IGraphic } from '@visactor/vrender-core'; import type { IAnimationConfig, IStateAnimationConfig } from './interface'; export interface ICommonStateAnimateSpec { duration?: number; delay?: number; easing?: EasingType; oneByOne?: boolean; } export interface IStateAnimateSpec extends ICommonStateAnimateSpec { preset?: Preset | false; } export type IMarkAnimateSpec = Partial>; export interface IAnimationSpec { animationAppear?: boolean | IStateAnimateSpec | IMarkAnimateSpec; animationEnter?: boolean | ICommonStateAnimateSpec | IMarkAnimateSpec; animationUpdate?: boolean | ICommonStateAnimateSpec | IMarkAnimateSpec; animationExit?: boolean | ICommonStateAnimateSpec | IMarkAnimateSpec; animationDisappear?: boolean | ICommonStateAnimateSpec | IMarkAnimateSpec; animationState?: boolean | IStateAnimationConfig; animationNormal?: IMarkAnimateSpec; } export interface IMorphSeriesSpec { enable?: boolean; morphKey?: string; morphElementKey?: string; } export type MorphData = { prev: any[]; next: any[]; }; export type MorphElements = { prev: IGraphic[]; next: IGraphic[]; }; export type MorphFunctionCallback = (datum: MorphData, element: MorphElements, parameters: any) => T; export type MorphFunctionType = T | MorphFunctionCallback; export type MorphFunctionValueType = MorphFunctionType | T; export interface IMorphAnimationConfig { easing?: EasingType; delay?: MorphFunctionValueType; duration?: MorphFunctionValueType; oneByOne?: MorphFunctionValueType; splitPath?: MorphFunctionValueType<'clone' | null | undefined>; } export interface IMorphConfig { reuse?: boolean; morph?: boolean; morphAll?: boolean; animation?: IMorphAnimationConfig; enableExitAnimation?: boolean; }