@toolmain/components 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1019 -0
- package/dist/index.js +12699 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1019 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { CSS2DObject } from 'three/addons';
|
|
5
|
+
import type * as CSS_2 from 'csstype';
|
|
6
|
+
import { DefineComponent } from 'vue';
|
|
7
|
+
import { Dexie } from 'dexie';
|
|
8
|
+
import { EntityTable } from 'dexie';
|
|
9
|
+
import { EventBus as EventBus_2 } from '@toolmain/shared';
|
|
10
|
+
import { GLTF } from 'three/addons';
|
|
11
|
+
import type { MaybeRef } from 'vue';
|
|
12
|
+
import { OrbitControls } from 'three/addons';
|
|
13
|
+
import { PointerLockControls } from 'three/addons';
|
|
14
|
+
import { PublicProps } from 'vue';
|
|
15
|
+
import { Reactive } from 'vue';
|
|
16
|
+
import { Ref } from 'vue';
|
|
17
|
+
import { RoundedBoxGeometry } from 'three/addons';
|
|
18
|
+
import { ShallowRef } from 'vue';
|
|
19
|
+
import { default as Stats_2 } from 'three/addons/libs/stats.module.js';
|
|
20
|
+
import { StoreDefinition } from 'pinia';
|
|
21
|
+
import * as THREE from 'three';
|
|
22
|
+
import { TransformControlsMode } from 'three/addons';
|
|
23
|
+
import { VNode } from 'vue';
|
|
24
|
+
import { VNodeProps } from 'vue';
|
|
25
|
+
|
|
26
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {
|
|
27
|
+
update: () => void;
|
|
28
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
|
|
30
|
+
declare const __VLS_component_2: DefineComponent<ScaleProps, ScaleInstance, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
31
|
+
moving: (pos: MoveParams) => any;
|
|
32
|
+
scaling: (scaleEl: HTMLElement) => any;
|
|
33
|
+
beforeMove: (pos: MoveParams) => any;
|
|
34
|
+
afterMove: (pos: MoveParams) => any;
|
|
35
|
+
afterScale: (scaleEl: HTMLElement) => any;
|
|
36
|
+
maskClick: () => any;
|
|
37
|
+
"update:modelValue": (data: ScaleConfig) => any;
|
|
38
|
+
}, string, PublicProps, Readonly<ScaleProps> & Readonly<{
|
|
39
|
+
onMoving?: ((pos: MoveParams) => any) | undefined;
|
|
40
|
+
onScaling?: ((scaleEl: HTMLElement) => any) | undefined;
|
|
41
|
+
onBeforeMove?: ((pos: MoveParams) => any) | undefined;
|
|
42
|
+
onAfterMove?: ((pos: MoveParams) => any) | undefined;
|
|
43
|
+
onAfterScale?: ((scaleEl: HTMLElement) => any) | undefined;
|
|
44
|
+
onMaskClick?: (() => any) | undefined;
|
|
45
|
+
"onUpdate:modelValue"?: ((data: ScaleConfig) => any) | undefined;
|
|
46
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
|
|
48
|
+
declare const __VLS_component_3: DefineComponent<__VLS_Props_2, {
|
|
49
|
+
world: World;
|
|
50
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
51
|
+
loaded: (args_0: World) => any;
|
|
52
|
+
targetClick: (args_0: TargetData) => any;
|
|
53
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
54
|
+
onLoaded?: ((args_0: World) => any) | undefined;
|
|
55
|
+
onTargetClick?: ((args_0: TargetData) => any) | undefined;
|
|
56
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
57
|
+
|
|
58
|
+
declare const __VLS_component_4: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
59
|
+
|
|
60
|
+
declare const __VLS_component_5: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
61
|
+
|
|
62
|
+
declare type __VLS_Props = {
|
|
63
|
+
/**
|
|
64
|
+
* 选择top时,如果元素滚动到[底部]消失或即将消失,会回到原位置
|
|
65
|
+
*
|
|
66
|
+
* 选择bottom时则是滚动到[顶部]时触发
|
|
67
|
+
*/
|
|
68
|
+
position?: "top" | "bottom";
|
|
69
|
+
target?: string;
|
|
70
|
+
offset?: number;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
declare type __VLS_Props_2 = {
|
|
74
|
+
/**
|
|
75
|
+
* if true, will add a panel for debugging. press `m` to toggle the panel
|
|
76
|
+
*/
|
|
77
|
+
debug?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* if you want to use draco decoder, must specify `dracoDecoderPath`
|
|
80
|
+
*
|
|
81
|
+
* 1. you can set the path with cdn url: `https://www.gstatic.com/draco/versioned/decoders/1.5.7/`
|
|
82
|
+
* 2. or copy the draco decoder files to your `/public/droc/gltf` directory, and set the value to `/droc/gltf`
|
|
83
|
+
*/
|
|
84
|
+
dracoDecoderPath?: string;
|
|
85
|
+
/**
|
|
86
|
+
* config for rendering models
|
|
87
|
+
*/
|
|
88
|
+
config: ThreePanelConf;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare type __VLS_Props_3 = {
|
|
92
|
+
text: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
declare type __VLS_Props_4 = {
|
|
96
|
+
modelValue?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* @description 如果为true,则在icon不可视时摧毁元素而不是隐藏透明度
|
|
99
|
+
*/
|
|
100
|
+
destroyIcon?: boolean;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
declare type __VLS_Slots = {} & {
|
|
104
|
+
default?: (props: typeof __VLS_1) => any;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare type __VLS_Slots_2 = {} & {
|
|
108
|
+
header?: (props: typeof __VLS_1) => any;
|
|
109
|
+
} & {
|
|
110
|
+
default?: (props: typeof __VLS_7) => any;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
declare type __VLS_Slots_3 = {} & {
|
|
114
|
+
default?: (props: typeof __VLS_9) => any;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
declare type __VLS_Slots_4 = {} & {
|
|
118
|
+
header?: (props: typeof __VLS_8) => any;
|
|
119
|
+
} & {
|
|
120
|
+
default?: (props: typeof __VLS_15) => any;
|
|
121
|
+
} & {
|
|
122
|
+
footer?: (props: typeof __VLS_18) => any;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare type __VLS_Slots_5 = {} & {
|
|
126
|
+
default?: (props: typeof __VLS_10) => any;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare type __VLS_WithSlots<T, S> = T & {
|
|
130
|
+
new (): {
|
|
131
|
+
$slots: S;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
declare type __VLS_WithSlots_2<T, S> = T & {
|
|
136
|
+
new (): {
|
|
137
|
+
$slots: S;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
declare type __VLS_WithSlots_3<T, S> = T & {
|
|
142
|
+
new (): {
|
|
143
|
+
$slots: S;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
declare type __VLS_WithSlots_4<T, S> = T & {
|
|
148
|
+
new (): {
|
|
149
|
+
$slots: S;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
declare type __VLS_WithSlots_5<T, S> = T & {
|
|
154
|
+
new (): {
|
|
155
|
+
$slots: S;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* anger to rad
|
|
161
|
+
*/
|
|
162
|
+
export declare function a2r(angle: number): number;
|
|
163
|
+
|
|
164
|
+
export declare const Affix: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
165
|
+
|
|
166
|
+
export declare type AnimateDir = "left" | "top" | "bottom" | "right" | "self" | "center" | {
|
|
167
|
+
x?: number;
|
|
168
|
+
y?: number;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
declare type ArrMutKeys = "splice" | "push" | "pop" | "shift" | "unshift";
|
|
172
|
+
|
|
173
|
+
export declare class Bot {
|
|
174
|
+
box: THREE.Box3;
|
|
175
|
+
size: THREE.Vector3;
|
|
176
|
+
animateDuration: number;
|
|
177
|
+
model?: GLTF;
|
|
178
|
+
animations: THREE.AnimationClip[];
|
|
179
|
+
mixer: THREE.AnimationMixer | undefined;
|
|
180
|
+
skeleton: THREE.SkeletonHelper | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* preset actions lists,in clude weight,name,and Action instance
|
|
183
|
+
*/
|
|
184
|
+
baseActions: BotAction[];
|
|
185
|
+
direction: THREE.Vector3;
|
|
186
|
+
move: {
|
|
187
|
+
forward: boolean;
|
|
188
|
+
backward: boolean;
|
|
189
|
+
left: boolean;
|
|
190
|
+
right: boolean;
|
|
191
|
+
speed: number;
|
|
192
|
+
jumpHeight: number;
|
|
193
|
+
canJump: boolean;
|
|
194
|
+
jumping: boolean;
|
|
195
|
+
status: string;
|
|
196
|
+
onFloor: boolean;
|
|
197
|
+
};
|
|
198
|
+
initPosition: THREE.Vector3;
|
|
199
|
+
readonly loader: Loader;
|
|
200
|
+
readonly core: Core;
|
|
201
|
+
readonly collider?: ReturnType<typeof useCollider>;
|
|
202
|
+
private currentAction?;
|
|
203
|
+
private uv;
|
|
204
|
+
private actionMap;
|
|
205
|
+
constructor(opts: BotOptions);
|
|
206
|
+
/**
|
|
207
|
+
* load bot
|
|
208
|
+
*/
|
|
209
|
+
load(gltfPath: string, conf?: LoadOptions): Promise<GLTF | null>;
|
|
210
|
+
/**
|
|
211
|
+
* teleport bot to a new position
|
|
212
|
+
*/
|
|
213
|
+
teleport(x: number, y: number, z: number): void;
|
|
214
|
+
update(delta: number): void;
|
|
215
|
+
once<K extends keyof BotEv>(event: K, callback: BotEv[K]): Bot;
|
|
216
|
+
on<K extends keyof BotEv>(event: K, callback: BotEv[K]): Bot;
|
|
217
|
+
emit<K extends keyof BotEv>(event: K, ...args: Parameters<BotEv[K]>): Bot;
|
|
218
|
+
run(): void;
|
|
219
|
+
walk(): void;
|
|
220
|
+
idle(): void;
|
|
221
|
+
dispose(): void;
|
|
222
|
+
private init;
|
|
223
|
+
private setWeight;
|
|
224
|
+
private _action;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export declare interface BotAction {
|
|
228
|
+
name: string;
|
|
229
|
+
action: THREE.AnimationAction;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export declare type BotActionMap = {
|
|
233
|
+
[key in BotActionName]: string;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export declare enum BotActionName {
|
|
237
|
+
IDLE = "idle",
|
|
238
|
+
RUN = "run",
|
|
239
|
+
WALK = "walk",
|
|
240
|
+
JUMP = "jump"
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export declare interface BotEv {
|
|
244
|
+
BotPos: (e: THREE.Vector3) => void;
|
|
245
|
+
BotLoaded: (model: THREE.Group<THREE.Object3DEventMap>) => void;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export declare interface BotOptions {
|
|
249
|
+
core: Core;
|
|
250
|
+
initPosition?: THREE.Vector3;
|
|
251
|
+
jumpHeight?: number;
|
|
252
|
+
speed?: number;
|
|
253
|
+
actionMap?: BotActionMap;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* 回调函数类型
|
|
258
|
+
*/
|
|
259
|
+
declare type CallBackFn = (...arg: any[]) => void;
|
|
260
|
+
|
|
261
|
+
export declare type CameraConf = {
|
|
262
|
+
position: {
|
|
263
|
+
x: number;
|
|
264
|
+
y: number;
|
|
265
|
+
z: number;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export declare type ControlConf = {
|
|
270
|
+
target: {
|
|
271
|
+
x: number;
|
|
272
|
+
y: number;
|
|
273
|
+
z: number;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export declare const Copy: __VLS_WithSlots_5<typeof __VLS_component_5, __VLS_Slots_5>;
|
|
278
|
+
|
|
279
|
+
export declare class Core {
|
|
280
|
+
#private;
|
|
281
|
+
scene: THREE.Scene;
|
|
282
|
+
camera: THREE.PerspectiveCamera;
|
|
283
|
+
renderer: THREE.WebGLRenderer;
|
|
284
|
+
db: Dexie & {
|
|
285
|
+
model: EntityTable< {
|
|
286
|
+
id: string;
|
|
287
|
+
url: string;
|
|
288
|
+
data: Blob;
|
|
289
|
+
}, "id">;
|
|
290
|
+
config: EntityTable< {
|
|
291
|
+
id: string;
|
|
292
|
+
url: string;
|
|
293
|
+
data: Record<string, unknown>;
|
|
294
|
+
}, "id">;
|
|
295
|
+
};
|
|
296
|
+
stats: Stats_2;
|
|
297
|
+
clock: THREE.Clock;
|
|
298
|
+
raycaster: THREE.Raycaster;
|
|
299
|
+
orbitCtrls: OrbitControls;
|
|
300
|
+
keyboard: {
|
|
301
|
+
ev: EventBus<{
|
|
302
|
+
[x: string]: any;
|
|
303
|
+
}>;
|
|
304
|
+
init: () => void;
|
|
305
|
+
dispose: () => void;
|
|
306
|
+
};
|
|
307
|
+
container: El;
|
|
308
|
+
loader: Loader;
|
|
309
|
+
world: World;
|
|
310
|
+
constructor();
|
|
311
|
+
init(el: HTMLElement): void;
|
|
312
|
+
once<K extends keyof ThreeEv>(event: K, callback: ThreeEv[K]): Core;
|
|
313
|
+
on<K extends keyof ThreeEv>(event: K, callback: ThreeEv[K]): Core;
|
|
314
|
+
emit<K extends keyof ThreeEv>(event: K, ...args: Parameters<ThreeEv[K]>): Core;
|
|
315
|
+
render(): void;
|
|
316
|
+
dispose(): void;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export declare interface CSS2DObjectOptions {
|
|
320
|
+
id: string;
|
|
321
|
+
el: HTMLElement;
|
|
322
|
+
target: CSS2DObject;
|
|
323
|
+
container: THREE.Mesh;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* CSS Properties
|
|
328
|
+
*/
|
|
329
|
+
declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
|
|
330
|
+
[v: `--${string}`]: string | number | undefined;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export declare const db: Dexie & {
|
|
334
|
+
model: EntityTable<{
|
|
335
|
+
id: string;
|
|
336
|
+
url: string;
|
|
337
|
+
data: Blob;
|
|
338
|
+
}, "id">;
|
|
339
|
+
config: EntityTable<{
|
|
340
|
+
id: string;
|
|
341
|
+
url: string;
|
|
342
|
+
data: Record<string, unknown>;
|
|
343
|
+
}, "id">;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
declare interface DebugPanel {
|
|
347
|
+
id: string;
|
|
348
|
+
label: string;
|
|
349
|
+
node: VNode | Component | string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare const DialogPanel: __VLS_WithSlots_4<typeof __VLS_component_4, __VLS_Slots_4>;
|
|
353
|
+
|
|
354
|
+
declare type Dir = "horizontal" | "vertical" | "any";
|
|
355
|
+
|
|
356
|
+
declare interface DragAttr {
|
|
357
|
+
/**
|
|
358
|
+
* 元素x轴坐标
|
|
359
|
+
*/
|
|
360
|
+
x: number;
|
|
361
|
+
/**
|
|
362
|
+
* 元素y轴坐标
|
|
363
|
+
*/
|
|
364
|
+
y: number;
|
|
365
|
+
/**
|
|
366
|
+
* 指针x坐标
|
|
367
|
+
*/
|
|
368
|
+
clientX: number;
|
|
369
|
+
/**
|
|
370
|
+
* 指针y坐标
|
|
371
|
+
*/
|
|
372
|
+
clientY: number;
|
|
373
|
+
width: number | InitType;
|
|
374
|
+
height: number | InitType;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* 拖拽时transform计算的坐标
|
|
379
|
+
*/
|
|
380
|
+
export declare interface DragOffset {
|
|
381
|
+
/**
|
|
382
|
+
* pointer按下时的X坐标
|
|
383
|
+
*/
|
|
384
|
+
prevClientX: number;
|
|
385
|
+
/**
|
|
386
|
+
* pointer按下时的Y坐标
|
|
387
|
+
*/
|
|
388
|
+
prevClientY: number;
|
|
389
|
+
/**
|
|
390
|
+
* 上次移动之后的translateX
|
|
391
|
+
*/
|
|
392
|
+
prevTranslateX: number;
|
|
393
|
+
/**
|
|
394
|
+
* 上次移动之后的translateY
|
|
395
|
+
*/
|
|
396
|
+
prevTranslateY: number;
|
|
397
|
+
/**
|
|
398
|
+
* 正在移动时的translateX
|
|
399
|
+
*/
|
|
400
|
+
translateX: number;
|
|
401
|
+
/**
|
|
402
|
+
* 正在移动时的translateY
|
|
403
|
+
*/
|
|
404
|
+
translateY: number;
|
|
405
|
+
scale: FixedArray<number, 2>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export declare class El {
|
|
409
|
+
el: HTMLElement;
|
|
410
|
+
constructor(element?: HTMLElement | null);
|
|
411
|
+
setEl(el: HTMLElement): void;
|
|
412
|
+
getEl(): HTMLElement;
|
|
413
|
+
size(): ElRect;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export declare interface ElRect {
|
|
417
|
+
width: number;
|
|
418
|
+
height: number;
|
|
419
|
+
left: number;
|
|
420
|
+
top: number;
|
|
421
|
+
right: number;
|
|
422
|
+
bottom: number;
|
|
423
|
+
x: number;
|
|
424
|
+
y: number;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @description changed origin: https://github.com/browserify/events
|
|
429
|
+
*/
|
|
430
|
+
declare interface EventBus<T extends Record<string, any>> {
|
|
431
|
+
setMaxListeners(n: number): void;
|
|
432
|
+
addListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
433
|
+
removeAllListeners<K extends keyof T>(type?: K): void;
|
|
434
|
+
removeListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
435
|
+
prependListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
436
|
+
emit<K extends keyof T>(type: K, ...args: Parameters<T[K]>): void;
|
|
437
|
+
/**
|
|
438
|
+
* addListener
|
|
439
|
+
*/
|
|
440
|
+
on<K extends keyof T>(type: K, listener: T[K]): void;
|
|
441
|
+
/**
|
|
442
|
+
* removeListener
|
|
443
|
+
*/
|
|
444
|
+
off<K extends keyof T>(type: K, listener: T[K]): void;
|
|
445
|
+
once<K extends keyof T>(type: K, listener: T[K]): void;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export declare function fetchRemote(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
449
|
+
code: number;
|
|
450
|
+
msg: string;
|
|
451
|
+
data?: Blob;
|
|
452
|
+
}>;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* 定长数组类型
|
|
456
|
+
*/
|
|
457
|
+
declare type FixedArray<T, L extends number> = Pick<T[], Exclude<keyof T[], ArrMutKeys>> & {
|
|
458
|
+
readonly length: L;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
export declare function getModel(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
462
|
+
code: number;
|
|
463
|
+
msg: string;
|
|
464
|
+
data?: Blob;
|
|
465
|
+
}>;
|
|
466
|
+
|
|
467
|
+
export declare function gradientColor(startColorHex: string, endColorHex: string, step: number): Array<string>;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* translate hex color to rgb color array
|
|
471
|
+
*/
|
|
472
|
+
export declare function hex2rgb(sColor: string): Array<number>;
|
|
473
|
+
|
|
474
|
+
declare type InitType = "auto" | "inherit" | "initial" | "unset";
|
|
475
|
+
|
|
476
|
+
export declare enum KeyCode {
|
|
477
|
+
init = "KEYBOARD:INIT",
|
|
478
|
+
keydown = "KEYBOARD:KEYDOWN",
|
|
479
|
+
keyup = "KEYBOARD:KEYUP",
|
|
480
|
+
keyStatus = "KEYBOARD:KEYSTATUS",
|
|
481
|
+
KeyWA = "KeyWA",
|
|
482
|
+
KeyWD = "KeyWD",
|
|
483
|
+
KeyAS = "KeyAS",
|
|
484
|
+
KeySD = "KeySD",
|
|
485
|
+
ShiftLeft = "ShiftLeft",
|
|
486
|
+
Space = "Space",
|
|
487
|
+
KeyW = "KeyW",
|
|
488
|
+
KeyA = "KeyA",
|
|
489
|
+
KeyS = "KeyS",
|
|
490
|
+
KeyD = "KeyD",
|
|
491
|
+
ArrowLeft = "ArrowLeft",
|
|
492
|
+
ArrowRight = "ArrowRight",
|
|
493
|
+
ArrowUp = "ArrowUp",
|
|
494
|
+
ArrowDown = "ArrowDown"
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export declare interface LightMeta {
|
|
498
|
+
/**
|
|
499
|
+
* unique id is required
|
|
500
|
+
*/
|
|
501
|
+
id: string;
|
|
502
|
+
type: LightType | string;
|
|
503
|
+
color: string | THREE.Color;
|
|
504
|
+
groundColor?: string | THREE.Color;
|
|
505
|
+
/**
|
|
506
|
+
* light helper will be created, this field control it's visibility
|
|
507
|
+
*/
|
|
508
|
+
helper?: boolean;
|
|
509
|
+
helperColor?: string;
|
|
510
|
+
helperSize?: number;
|
|
511
|
+
visible?: boolean;
|
|
512
|
+
position?: {
|
|
513
|
+
x: number;
|
|
514
|
+
y: number;
|
|
515
|
+
z: number;
|
|
516
|
+
};
|
|
517
|
+
rotate?: {
|
|
518
|
+
x: number;
|
|
519
|
+
y: number;
|
|
520
|
+
z: number;
|
|
521
|
+
};
|
|
522
|
+
name?: string;
|
|
523
|
+
intensity?: number;
|
|
524
|
+
distance?: number;
|
|
525
|
+
angle?: number;
|
|
526
|
+
castShadow?: boolean;
|
|
527
|
+
penumbra?: number;
|
|
528
|
+
decay?: number;
|
|
529
|
+
/**
|
|
530
|
+
* if need TransformControls
|
|
531
|
+
*/
|
|
532
|
+
debugger?: boolean;
|
|
533
|
+
/**
|
|
534
|
+
* debugger mode
|
|
535
|
+
*/
|
|
536
|
+
mode?: TransformControlsMode;
|
|
537
|
+
[x: string]: any;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export declare class Lights {
|
|
541
|
+
#private;
|
|
542
|
+
ev: EventBus<any>;
|
|
543
|
+
constructor(core: Core);
|
|
544
|
+
update(meta: LightMeta): void;
|
|
545
|
+
add(meta: LightMeta): void;
|
|
546
|
+
clear(id: string): void;
|
|
547
|
+
dispose(): void;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export declare enum LightsEvent {
|
|
551
|
+
ObjectChange = "objectChange",
|
|
552
|
+
ObjectAdd = "objectAdd",
|
|
553
|
+
ObjectRemove = "objectRemove"
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export declare enum LightType {
|
|
557
|
+
PointLight = "PointLight",
|
|
558
|
+
DirectionalLight = "DirectionalLight",
|
|
559
|
+
SpotLight = "SpotLight",
|
|
560
|
+
AmbientLight = "AmbientLight",
|
|
561
|
+
HemisphereLight = "HemisphereLight"
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export declare class Loader {
|
|
565
|
+
#private;
|
|
566
|
+
private manager;
|
|
567
|
+
data: Record<string, LoadParam>;
|
|
568
|
+
private uv;
|
|
569
|
+
constructor(config?: LoaderConfig);
|
|
570
|
+
private init;
|
|
571
|
+
on<K extends keyof LoaderEvent>(event: K, callback: LoaderEvent[K]): Loader;
|
|
572
|
+
emit<K extends keyof LoaderEvent>(event: K, ...args: Parameters<LoaderEvent[K]>): Loader;
|
|
573
|
+
onProgress(url: string, loaded: number, total: number): void;
|
|
574
|
+
onStart(url: string, loaded: number, total: number): void;
|
|
575
|
+
onLoaded(): void;
|
|
576
|
+
onError(url: string): void;
|
|
577
|
+
load<T>(path: string, conf?: LoadOptions): Promise<T | null>;
|
|
578
|
+
loadGLTF(path: string, conf?: LoadOptions): Promise<GLTF | null>;
|
|
579
|
+
loadFBX(path: string, conf?: LoadOptions): Promise<THREE.Group<THREE.Object3DEventMap> | null>;
|
|
580
|
+
dispose(): void;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export declare type LoaderConfig = {
|
|
584
|
+
dracoLoaderPath?: string;
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
export declare type LoaderEvent = Pick<ThreeEv, "LoadError" | "LoadProgress" | "LoadStart" | "Loaded" | "Log" | "Custom">;
|
|
588
|
+
|
|
589
|
+
export declare interface LoadOptions {
|
|
590
|
+
/**
|
|
591
|
+
* mark the loading progress bar is independent
|
|
592
|
+
*/
|
|
593
|
+
independent?: boolean;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export declare type LoadParam = LoadProgressData & LoadOptions;
|
|
597
|
+
|
|
598
|
+
export declare interface LoadProgressData {
|
|
599
|
+
url: string;
|
|
600
|
+
/**
|
|
601
|
+
* loaded resources' number
|
|
602
|
+
*/
|
|
603
|
+
loaded: number;
|
|
604
|
+
/**
|
|
605
|
+
* total resources' number
|
|
606
|
+
*/
|
|
607
|
+
total: number;
|
|
608
|
+
describe?: string;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export declare interface MoveHook {
|
|
612
|
+
x?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
613
|
+
y?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
614
|
+
scale?: (oldVal: FixedArray<number, 2>, newVal: FixedArray<number, 2>) => [FixedArray<number, 2>, FixedArray<number, 2>];
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
declare interface MoveOptions {
|
|
618
|
+
/**
|
|
619
|
+
* 移动方向
|
|
620
|
+
*/
|
|
621
|
+
direction?: Dir;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export declare type MoveParams = DragAttr & {
|
|
625
|
+
translateX: number;
|
|
626
|
+
translateY: number;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
export declare const ParentView: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* rad to anger
|
|
633
|
+
*/
|
|
634
|
+
export declare function r2a(radian: number): number;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* 远程资源,贴图,视频等
|
|
638
|
+
*/
|
|
639
|
+
export declare interface RemoteSrc {
|
|
640
|
+
/**
|
|
641
|
+
* resource type
|
|
642
|
+
*
|
|
643
|
+
* 1:image 2:video 3:link 4:color 5:api
|
|
644
|
+
*/
|
|
645
|
+
sourceType: number;
|
|
646
|
+
objectName: string;
|
|
647
|
+
/**
|
|
648
|
+
* color will be used as texture
|
|
649
|
+
*/
|
|
650
|
+
color?: string;
|
|
651
|
+
/**
|
|
652
|
+
* image/video address
|
|
653
|
+
*/
|
|
654
|
+
fileUrl?: string;
|
|
655
|
+
/**
|
|
656
|
+
* other resource except image/video
|
|
657
|
+
*/
|
|
658
|
+
content?: string;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export declare type RendererConf = {
|
|
662
|
+
clearColor: string;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* tranlate rgb color to hex string
|
|
667
|
+
*/
|
|
668
|
+
export declare function rgb2Hex(rgb: string): string;
|
|
669
|
+
|
|
670
|
+
export declare interface ScaleConfig {
|
|
671
|
+
/**
|
|
672
|
+
* 组件可改变尺寸
|
|
673
|
+
*/
|
|
674
|
+
scalable?: boolean;
|
|
675
|
+
/**
|
|
676
|
+
* 组件可移动
|
|
677
|
+
*/
|
|
678
|
+
movable?: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* 变成正常元素
|
|
681
|
+
*/
|
|
682
|
+
normal?: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* 拖动后自动靠边
|
|
685
|
+
*/
|
|
686
|
+
autoStick?: boolean | AnimateDir;
|
|
687
|
+
/**
|
|
688
|
+
* 是否显示
|
|
689
|
+
*/
|
|
690
|
+
visible?: boolean;
|
|
691
|
+
/**
|
|
692
|
+
* 初始移动位置 `translateX`
|
|
693
|
+
*/
|
|
694
|
+
x?: number;
|
|
695
|
+
/**
|
|
696
|
+
* 初始移动位置 `translateY`
|
|
697
|
+
*/
|
|
698
|
+
y?: number;
|
|
699
|
+
/**
|
|
700
|
+
* 是否拥有头部
|
|
701
|
+
*/
|
|
702
|
+
header?: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* 当组件`position`不为`fixed`时
|
|
705
|
+
* 是否相对于window定位,否则相对于父元素定位
|
|
706
|
+
*
|
|
707
|
+
* @default false
|
|
708
|
+
*/
|
|
709
|
+
attachWindow?: boolean;
|
|
710
|
+
/**
|
|
711
|
+
* 移动功能的配置项
|
|
712
|
+
*/
|
|
713
|
+
moveConfig?: MoveOptions;
|
|
714
|
+
/**
|
|
715
|
+
* 外壳样式
|
|
716
|
+
*/
|
|
717
|
+
containerStyle?: CSSProperties;
|
|
718
|
+
/**
|
|
719
|
+
* 内容样式,初始宽高应该在这里设置
|
|
720
|
+
*/
|
|
721
|
+
contentStyle?: CSSProperties;
|
|
722
|
+
/**
|
|
723
|
+
* 头部样式
|
|
724
|
+
*/
|
|
725
|
+
headerStyle?: CSSProperties;
|
|
726
|
+
/**
|
|
727
|
+
* 是否显示遮罩层
|
|
728
|
+
*/
|
|
729
|
+
mask?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* 遮罩层样式
|
|
732
|
+
*/
|
|
733
|
+
maskStyle?: CSSProperties;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export declare enum ScaleEv {
|
|
737
|
+
SCALING = "scaling",
|
|
738
|
+
AFTER_SCALE = "after_scale"
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export declare interface ScaleExtraConfNode {
|
|
742
|
+
label: string;
|
|
743
|
+
node: VNode | Component | string;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
export declare interface ScaleInstance {
|
|
747
|
+
/**
|
|
748
|
+
* 智能移动到屏幕边界
|
|
749
|
+
* @param animate - 是否有动画效果 default: true
|
|
750
|
+
*/
|
|
751
|
+
autoStick: (animate: boolean) => Promise<void>;
|
|
752
|
+
/**
|
|
753
|
+
* 自动隐藏
|
|
754
|
+
* @param animate - 是否有动画效果 default: true
|
|
755
|
+
*/
|
|
756
|
+
autoHide: (animate: boolean) => Promise<void>;
|
|
757
|
+
/**
|
|
758
|
+
* 移动到屏幕边界
|
|
759
|
+
* @param animate - 是否有动画效果 default: true
|
|
760
|
+
*/
|
|
761
|
+
stickTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
|
|
762
|
+
/**
|
|
763
|
+
* 移动到屏幕 `dir`位置并隐藏
|
|
764
|
+
* @param animate - 是否有动画效果 default: true
|
|
765
|
+
*/
|
|
766
|
+
hideTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
|
|
767
|
+
/**
|
|
768
|
+
* 显示组件
|
|
769
|
+
*/
|
|
770
|
+
show: (animate: boolean, dir?: AnimateDir) => Promise<void>;
|
|
771
|
+
/**
|
|
772
|
+
* 当组件`position:fixed`或者`attachWindow:true`时坐标相对于屏幕左上角;否则相对于父元素
|
|
773
|
+
*/
|
|
774
|
+
moveTo: (animate: boolean, dir: AnimateDir, hooks?: MoveHook) => Promise<void>;
|
|
775
|
+
/**
|
|
776
|
+
* 获取当前状态
|
|
777
|
+
*/
|
|
778
|
+
getStatus: () => Status | undefined;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export declare const ScalePanel: __VLS_WithSlots_2<typeof __VLS_component_2, __VLS_Slots_2>;
|
|
782
|
+
|
|
783
|
+
export declare interface ScaleProps {
|
|
784
|
+
modelValue: ScaleConfig;
|
|
785
|
+
/**
|
|
786
|
+
* 按下目标元素并拖动组件,默认按下头部拖动。
|
|
787
|
+
*/
|
|
788
|
+
dragTarget?: MaybeRef<HTMLElement | null | undefined>;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
export declare class Scene {
|
|
792
|
+
model?: GLTF;
|
|
793
|
+
remoteResources: Record<string, RemoteSrc>;
|
|
794
|
+
bvh?: THREE.Mesh;
|
|
795
|
+
remoteTarget: Record<string, TargetSrc>;
|
|
796
|
+
/**
|
|
797
|
+
* when true,emit the `RendererClick` event
|
|
798
|
+
*/
|
|
799
|
+
clickNotify: boolean;
|
|
800
|
+
private blobUrls;
|
|
801
|
+
readonly loader: Loader;
|
|
802
|
+
private core;
|
|
803
|
+
constructor(core: Core, loaderConfig?: LoaderConfig);
|
|
804
|
+
private createVideo;
|
|
805
|
+
/**
|
|
806
|
+
* set texture
|
|
807
|
+
*/
|
|
808
|
+
setRemoteTexture(src: RemoteSrc): void;
|
|
809
|
+
/**
|
|
810
|
+
* set a anchor of an object, when click the object,the corresponding event will be triggered
|
|
811
|
+
*/
|
|
812
|
+
setRemoteTarget(src: TargetSrc[] | TargetSrc): void;
|
|
813
|
+
load(gltfPath: string, conf?: LoadOptions): Promise<GLTF | undefined>;
|
|
814
|
+
setClickNotify(val?: boolean): void;
|
|
815
|
+
dispose(): void;
|
|
816
|
+
private disposeModel;
|
|
817
|
+
private clearBlob;
|
|
818
|
+
private init;
|
|
819
|
+
/**
|
|
820
|
+
* emit click event for debug
|
|
821
|
+
*/
|
|
822
|
+
private onEmitClick;
|
|
823
|
+
private onTargetClick;
|
|
824
|
+
private initSceneInteraction;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export declare const Spinner: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
828
|
+
"update:modelValue": (value: boolean) => any;
|
|
829
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
830
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
831
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
832
|
+
|
|
833
|
+
declare enum Status {
|
|
834
|
+
NORMAL = "NORMAL",
|
|
835
|
+
HIDDEN = "HIDDEN"
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export declare type TargetData = {
|
|
839
|
+
type: "TargetSrc";
|
|
840
|
+
data: TargetSrc;
|
|
841
|
+
} | {
|
|
842
|
+
type: "RemoteSrc";
|
|
843
|
+
data: RemoteSrc;
|
|
844
|
+
} | {
|
|
845
|
+
type: "Object";
|
|
846
|
+
data: THREE.Object3D<THREE.Object3DEventMap>;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
export declare interface TargetSrc {
|
|
850
|
+
objectName: string;
|
|
851
|
+
data: Record<string, any>;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export declare interface ThreeEv {
|
|
855
|
+
/**
|
|
856
|
+
* OrbitControl trigger `change` event
|
|
857
|
+
*/
|
|
858
|
+
OrbitChanged: (e: THREE.Event<"change", OrbitControls>) => void;
|
|
859
|
+
/**
|
|
860
|
+
* PointerLockControls trigger `lock` event
|
|
861
|
+
*/
|
|
862
|
+
PointerLock: (e: THREE.Event<"lock", PointerLockControls>) => void;
|
|
863
|
+
/**
|
|
864
|
+
* PointerLockControls trigger `unlock` event
|
|
865
|
+
*/
|
|
866
|
+
PointerUnlock: (e: THREE.Event<"unlock", PointerLockControls>) => void;
|
|
867
|
+
/**
|
|
868
|
+
* triggered before each render loop
|
|
869
|
+
*/
|
|
870
|
+
Render: (delta: number) => void;
|
|
871
|
+
RendererClick: (mouse: THREE.Vector2, intersects: THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[]) => void;
|
|
872
|
+
/**
|
|
873
|
+
* triggered when window resize
|
|
874
|
+
*/
|
|
875
|
+
Resize: () => void;
|
|
876
|
+
/**
|
|
877
|
+
* scene and renderer resources will be disposed
|
|
878
|
+
*/
|
|
879
|
+
Dispose: () => void;
|
|
880
|
+
/**
|
|
881
|
+
* global resource loading progress
|
|
882
|
+
*/
|
|
883
|
+
LoadStart: (e: LoadParam) => void;
|
|
884
|
+
/**
|
|
885
|
+
* global resource loading progress
|
|
886
|
+
*/
|
|
887
|
+
LoadProgress: (e: LoadParam) => void;
|
|
888
|
+
/**
|
|
889
|
+
* global resource loading progress
|
|
890
|
+
*/
|
|
891
|
+
Loaded: () => void;
|
|
892
|
+
/**
|
|
893
|
+
* global resource loading progress
|
|
894
|
+
*/
|
|
895
|
+
LoadError: (url: string) => void;
|
|
896
|
+
/**
|
|
897
|
+
* log event
|
|
898
|
+
*/
|
|
899
|
+
Log: (msg: {
|
|
900
|
+
code: number;
|
|
901
|
+
msg: string;
|
|
902
|
+
data?: {
|
|
903
|
+
type?: string;
|
|
904
|
+
data?: unknown;
|
|
905
|
+
};
|
|
906
|
+
}) => void;
|
|
907
|
+
/**
|
|
908
|
+
* camera params update
|
|
909
|
+
*/
|
|
910
|
+
CameraUpdate: (e: {
|
|
911
|
+
position: {
|
|
912
|
+
x: number;
|
|
913
|
+
y: number;
|
|
914
|
+
z: number;
|
|
915
|
+
};
|
|
916
|
+
fov?: number;
|
|
917
|
+
aspect?: number;
|
|
918
|
+
near?: number;
|
|
919
|
+
far?: number;
|
|
920
|
+
}) => void;
|
|
921
|
+
/**
|
|
922
|
+
* custom event for eventbus
|
|
923
|
+
*/
|
|
924
|
+
Custom: (e: {
|
|
925
|
+
type: string;
|
|
926
|
+
data?: unknown;
|
|
927
|
+
}) => void;
|
|
928
|
+
/**
|
|
929
|
+
* when click the specified object
|
|
930
|
+
*/
|
|
931
|
+
TargetClick: (e: TargetData) => void;
|
|
932
|
+
/**
|
|
933
|
+
* 场景加载完毕
|
|
934
|
+
*/
|
|
935
|
+
SceneLoaded: () => void;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export declare const ThreePanel: __VLS_WithSlots_3<typeof __VLS_component_3, __VLS_Slots_3>;
|
|
939
|
+
|
|
940
|
+
export declare type ThreePanelConf = {
|
|
941
|
+
url?: string;
|
|
942
|
+
control: ControlConf;
|
|
943
|
+
camera: CameraConf;
|
|
944
|
+
renderer: RendererConf;
|
|
945
|
+
lights: Array<LightMeta>;
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
export declare function useCollider(bot: Bot): {
|
|
949
|
+
teleport: (x: number, y: number, z: number) => void;
|
|
950
|
+
getPlayer: () => THREE.Mesh<RoundedBoxGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
951
|
+
update: (delta: number) => void;
|
|
952
|
+
init: () => void;
|
|
953
|
+
jump: () => void;
|
|
954
|
+
reset: () => void;
|
|
955
|
+
getCapsule: () => {
|
|
956
|
+
radius: number;
|
|
957
|
+
segment: THREE.Line3;
|
|
958
|
+
};
|
|
959
|
+
getTempBoxHelper: () => THREE.Box3Helper;
|
|
960
|
+
getGravity: () => number;
|
|
961
|
+
setGravity: (value: number) => void;
|
|
962
|
+
setCapsule: (raduis: number, start: THREE.Vector3Like, end: THREE.Vector3Like) => void;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
export declare const useCSS2DRenderer: () => {
|
|
966
|
+
init: (globalWorld: World) => void;
|
|
967
|
+
createCube: () => THREE.Mesh<THREE.BoxGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
|
|
968
|
+
add: (id: string, el: HTMLElement, callback?: (delta: number, el: HTMLElement, target: CSS2DObject, container: THREE.Mesh) => void) => void;
|
|
969
|
+
remove: (id: string) => void;
|
|
970
|
+
dispose: () => void;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* 动态增加debugger 面板
|
|
975
|
+
*/
|
|
976
|
+
export declare const useDebugger: StoreDefinition<"use-debugger", Pick<{
|
|
977
|
+
panels: Reactive<DebugPanel[]>;
|
|
978
|
+
addPanel: (conf: DebugPanel) => void;
|
|
979
|
+
}, "panels">, Pick<{
|
|
980
|
+
panels: Reactive<DebugPanel[]>;
|
|
981
|
+
addPanel: (conf: DebugPanel) => void;
|
|
982
|
+
}, never>, Pick<{
|
|
983
|
+
panels: Reactive<DebugPanel[]>;
|
|
984
|
+
addPanel: (conf: DebugPanel) => void;
|
|
985
|
+
}, "addPanel">>;
|
|
986
|
+
|
|
987
|
+
export declare const useElement: <T extends Record<string, unknown> & VNodeProps>(node?: VNode) => {
|
|
988
|
+
el: ShallowRef<HTMLElement, HTMLElement>;
|
|
989
|
+
update: (node: VNode, prop?: T) => void;
|
|
990
|
+
updateProps: (prop: T) => void;
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
export declare function useKeyboard(): {
|
|
994
|
+
ev: EventBus_2< {
|
|
995
|
+
[x: string]: any;
|
|
996
|
+
}>;
|
|
997
|
+
init: () => void;
|
|
998
|
+
dispose: () => void;
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
export declare const useScale: (data: {
|
|
1002
|
+
config: Ref<ScaleConfig>;
|
|
1003
|
+
targetEle: Readonly<Ref<HTMLElement | null | undefined>>;
|
|
1004
|
+
}) => {
|
|
1005
|
+
pointer: string[];
|
|
1006
|
+
getTarget: () => HTMLElement | null | undefined;
|
|
1007
|
+
onMouseDown: (e: MouseEvent, direction: string) => void;
|
|
1008
|
+
on: (e: ScaleEv, cb: CallBackFn) => void;
|
|
1009
|
+
dispose: () => void;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
export declare interface World {
|
|
1013
|
+
core: Core;
|
|
1014
|
+
bot: Bot | null;
|
|
1015
|
+
scene: Scene | null;
|
|
1016
|
+
lights: Lights | null;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export { }
|