diff --git a/packages/base/src/core/ISkeleton.ts b/packages/base/src/core/ISkeleton.ts index 536740d0..573a11ac 100644 --- a/packages/base/src/core/ISkeleton.ts +++ b/packages/base/src/core/ISkeleton.ts @@ -150,6 +150,8 @@ export interface IAnimationState { addEmptyAnimation (trackIndex: number, mixDuration: number, delay: number): ITrackEntry; setEmptyAnimations (mixDuration: number): void; hasAnimation(animationName: string): boolean; + addListener (listener: IAnimationStateListener); + removeListener (listener: IAnimationStateListener); } /** @@ -159,3 +161,19 @@ export interface IAnimationStateData { defaultMix: number; setMix (fromName: string, toName: string, duration: number): void; } + +export interface IEventData { + name: string; +} +export interface IEvent { + time: number; + data: IEventData; +} +export interface IAnimationStateListener { + start? (entry: ITrackEntry): void; + interrupt? (entry: ITrackEntry): void; + end? (entry: ITrackEntry): void; + dispose? (entry: ITrackEntry): void; + complete? (entry: ITrackEntry): void; + event? (entry: ITrackEntry, event: IEvent): void; +}