diff --git a/types/animation.d.ts b/types/animation.d.ts index 24ca13e..b52038e 100644 --- a/types/animation.d.ts +++ b/types/animation.d.ts @@ -1,23 +1,19 @@ import { PlayerObject } from './model' -declare function invokeAnimation( - animation: CompositeAnimation, - player: PlayerObject, - time: number -): void +export type Animation = CompositeAnimation | typeof WalkAnimation declare function invokeAnimation( - animation: typeof WalkAnimation, + animation: Animation, player: PlayerObject, time: number ): void declare class AnimationHandle { - animation: typeof WalkAnimation + animation: Animation paused: boolean speed: number - constructor(animation: typeof WalkAnimation) + constructor(animation: Animation) play(player: PlayerObject, time: number): void @@ -29,7 +25,7 @@ export class CompositeAnimation { constructor() - add(animation: typeof WalkAnimation): AnimationHandle + add(animation: Animation): AnimationHandle play(player: PlayerObject, time: number): void } diff --git a/types/viewer.d.ts b/types/viewer.d.ts index 09a7707..1eb5ee9 100644 --- a/types/viewer.d.ts +++ b/types/viewer.d.ts @@ -1,8 +1,11 @@ -import { CompositeAnimation, WalkAnimation } from './animation'; +import * as THREE from 'three' +import { CompositeAnimation, WalkAnimation } from './animation' +import { Animation } from './animation' +import { PlayerObject } from './model' interface SkinViewerOptions { domElement: Element - animation?: CompositeAnimation | typeof WalkAnimation + animation?: Animation slim?: boolean skinUrl?: string capeUrl?: string @@ -15,6 +18,15 @@ export class SkinViewer { capeUrl: string width: number height: number + readonly domElement: Element + animation: Animation + animationPaused: boolean + animationTime: number + readonly playerObject: PlayerObject + readonly disposed: boolean + readonly camera: THREE.Camera + readonly renderer: THREE.Renderer + readonly scene: THREE.Scene constructor(options: SkinViewerOptions) @@ -24,6 +36,9 @@ export class SkinViewer { } export class SkinControl { + enableAnimationControl: boolean + readonly skinViewer: SkinViewer + constructor(skinViewer: SkinViewer) dispose(): void