-
Notifications
You must be signed in to change notification settings - Fork 1
/
custom.d.ts
35 lines (34 loc) · 978 Bytes
/
custom.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
declare module "threebox-plugin" {
type LoadObjOptions = {
// https://github.com/jscastro76/threebox/blob/master/docs/Threebox.md#loadobj
obj: string;
type: "mtl" | "gltf" | "fbx" | "dae";
scale: number | { x: number; y: number; z: number };
units: "scene" | "meters";
rotation: number | { x: number; y: number; z: number };
};
type ThreeboxOptions = {
defaultLights?: boolean;
};
type Model = {
setCoords: Fn;
setRotation: Fn;
};
class ThreeboxInstance {
loadObj: (options: LoadObjOptions, cb: (model: Model) => void) => void;
add: (model: Model) => void;
update: () => void;
dispose: () => void;
}
class Threebox extends ThreeboxInstance {
constructor(
// https://github.com/jscastro76/threebox/blob/master/docs/Threebox.md#constructor
map: MapInstance,
context: WebGLRenderingContext | null,
options: ThreeboxOptions,
);
}
}
interface Window {
tb: ThreeboxInstance;
}