skinview3d/types/animation.d.ts

34 lines
663 B
TypeScript
Raw Normal View History

2018-02-04 15:15:03 +01:00
import { PlayerObject } from './model'
2018-02-04 16:23:27 +01:00
export type Animation = CompositeAnimation | typeof WalkAnimation
2018-02-04 15:15:03 +01:00
declare function invokeAnimation(
2018-02-04 16:23:27 +01:00
animation: Animation,
2018-02-04 15:15:03 +01:00
player: PlayerObject,
time: number
): void
declare class AnimationHandle {
2018-02-04 16:23:27 +01:00
animation: Animation
2018-02-04 15:15:03 +01:00
paused: boolean
speed: number
2018-02-04 16:23:27 +01:00
constructor(animation: Animation)
2018-02-04 15:15:03 +01:00
play(player: PlayerObject, time: number): void
reset(): void
}
export class CompositeAnimation {
handles: Set<AnimationHandle>
constructor()
2018-02-04 16:23:27 +01:00
add(animation: Animation): AnimationHandle
2018-02-04 15:15:03 +01:00
play(player: PlayerObject, time: number): void
}
export function WalkAnimation(player: PlayerObject, time: number): void