-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
46 lines (40 loc) · 1.08 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
declare module "3d-bullet-raub" {
type TBullet = typeof import('bullet-raub');
type TThree = typeof import('three');
type Object3D = typeof import('three').Object3D;
type Scene = typeof import('bullet-raub').Scene;
type Body = typeof import('bullet-raub').Body;
type TOptsBody = import('bullet-raub').TOptsBody;
type TSceneInstance = InstanceType<Scene>;
type TBodyInstance = InstanceType<Body>;
export type TOptsShape = Omit<TOptsBody, 'scene'> & Readonly<{
scene?: TSceneInstance;
mesh: Object3D;
}>;
type TShapeInstance = TBodyInstance & {
/**
* Three.js object to attach.
*/
mesh: Object3D;
};
interface TNewableShape extends Body {
new(opts: TOptsBody): TShapeInstance;
}
type TBullet3D = TBullet & {
/**
* Default scene.
*/
scene: TSceneInstance;
/**
* Physics driven object.
*/
Shape: TNewableShape,
};
/**
* Initialize Bullet3D.
*
* This function can be called repeatedly, but will ignore further calls.
* The return value is cached and will be returned immediately for repeating calls.
*/
export const init: () => TBullet3D;
}