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' import { PlayerObject } from './model'
declare function invokeAnimation( export type Animation = CompositeAnimation | typeof WalkAnimation
animation: CompositeAnimation,
player: PlayerObject,
time: number
): void
declare function invokeAnimation( declare function invokeAnimation(
animation: typeof WalkAnimation, animation: Animation,
player: PlayerObject, player: PlayerObject,
time: number time: number
): void ): void
declare class AnimationHandle { declare class AnimationHandle {
animation: typeof WalkAnimation animation: Animation
paused: boolean paused: boolean
speed: number speed: number
constructor(animation: typeof WalkAnimation) constructor(animation: Animation)
play(player: PlayerObject, time: number): void play(player: PlayerObject, time: number): void
@ -29,7 +25,7 @@ export class CompositeAnimation {
constructor() constructor()
add(animation: typeof WalkAnimation): AnimationHandle add(animation: Animation): AnimationHandle
play(player: PlayerObject, time: number): void 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 { interface SkinViewerOptions {
domElement: Element domElement: Element
animation?: CompositeAnimation | typeof WalkAnimation animation?: Animation
slim?: boolean slim?: boolean
skinUrl?: string skinUrl?: string
capeUrl?: string capeUrl?: string
@ -15,6 +18,15 @@ export class SkinViewer {
capeUrl: string capeUrl: string
width: number width: number
height: 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) constructor(options: SkinViewerOptions)
@ -24,6 +36,9 @@ export class SkinViewer {
} }
export class SkinControl { export class SkinControl {
enableAnimationControl: boolean
readonly skinViewer: SkinViewer
constructor(skinViewer: SkinViewer) constructor(skinViewer: SkinViewer)
dispose(): void dispose(): void