add missing class fields

This commit is contained in:
Pig Fang 2018-02-04 23:23:27 +08:00
parent 82d72c82ec
commit 07e8cd58c6
2 changed files with 22 additions and 11 deletions

14
types/animation.d.ts vendored
View File

@ -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
}

19
types/viewer.d.ts vendored
View File

@ -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