From c2e914cd6aa3addb55843ee20d91d184e7d12965 Mon Sep 17 00:00:00 2001 From: Abhishek Rathore <43349236+abhishekrathore03@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:28:35 +0530 Subject: [PATCH] Fixed #399 --- packages/base/src/core/ISkeleton.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; +}