elmer-ui-core
Version:
web app framework
77 lines (76 loc) • 2.82 kB
TypeScript
import { TypeAnimationProperty, TypeAnimationPropertyData } from "./ElmerAnimationProperty";
export declare type TypeElmerAnimationType = "Linear" | "QuadEaseIn" | "QuadEaseOut" | "QuadEaseInOut" | "CubicEaseIn" | "CubicEaseOut" | "CubicEaseInOut" | "QuartEaseIn" | "QuartEaseOut" | "QuartEaseInOut" | "QuintEaseIn" | "QuintEaseOut" | "QuintEaseInOut" | "SineEaseIn" | "SineEaseOut" | "SineEaseInOut" | "ExpoEaseIn" | "ExpoEaseOut" | "ExpoEaseInOut" | "CircleEaseIn" | "CircleEaseOut" | "CircleEaseInOut" | "ElasticEaseIn" | "ElasticEaseOut" | "ElasticEaseInOut" | "BackEaseIn" | "BackEaseOut" | "BackEaseInOut" | "BounceEaseIn" | "BounceEaseOut" | "BounceEaseInOut";
export declare type TypeAnimationChangeEvent = {
dom: HTMLElement;
value: any;
data: TypeAnimationPropertyData;
};
export declare type TypeAnimationEndEvent = {
from: TypeAnimationPropertyData;
to: TypeAnimationPropertyData;
default: TypeAnimationPropertyData;
};
export declare type TypeElmerAnimationKeyframe = {
duration: number;
beginTime?: number;
optionA?: number;
optionP?: number;
optionS?: number;
type: TypeElmerAnimationType;
from?: TypeAnimationProperty;
to: TypeAnimationProperty;
dom: HTMLElement;
onStart?(): void;
onChange?(event: TypeAnimationChangeEvent): void;
onFinish?(data?: TypeAnimationEndEvent): void;
};
export declare type TypeElmerAnimationContext = {
duration: number;
dom: HTMLElement;
beginTime?: number;
optionA?: number;
optionP?: number;
optionS?: number;
type: TypeElmerAnimationType;
defaultData: TypeAnimationPropertyData;
fromData: TypeAnimationPropertyData;
toData: TypeAnimationPropertyData;
isBegin?: boolean;
onBegin?(data?: any): void;
onEnd?(data?: TypeAnimationEndEvent): void;
onChange?(event?: TypeAnimationChangeEvent): void;
};
export declare type TypeMathApiParams = {
duration: number;
currentTime: number;
beginValue: number;
changeValue: number;
optionA?: number;
optionP?: number;
optionS?: number;
};
export declare type TypeElmerAnimationOptions = {
data: TypeElmerAnimationKeyframe[];
duration: number;
beginTime?: number;
onChange?(event: TypeAnimationChangeEvent): void;
onBegin?(): void;
onEnd?(data?: TypeAnimationEndEvent): void;
};
export declare class ElmerAnimation {
private options;
private cavAnimation;
private handler;
private beginTime;
private timeAnimationCallBack;
private animationData;
constructor(options: TypeElmerAnimationOptions);
start(): void;
stop(): void;
private calcFrameAttribute;
private dispose;
private getTimeAnimationCallBack;
private animationCallBack;
private calcUpdateProperty;
private calcTimeAnimationResult;
}