@toolmain/components 1.2.10 → 1.2.11
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 +1740 -0
- package/dist/index.js +20172 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1740 @@
|
|
|
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 { Primitive } from 'type-fest';
|
|
15
|
+
import { PublicProps } from 'vue';
|
|
16
|
+
import { Reactive } from 'vue';
|
|
17
|
+
import { Ref } from 'vue';
|
|
18
|
+
import { RendererElement } from 'vue';
|
|
19
|
+
import { RendererNode } from 'vue';
|
|
20
|
+
import { RoundedBoxGeometry } from 'three/addons';
|
|
21
|
+
import { ShallowRef } from 'vue';
|
|
22
|
+
import { default as Stats_2 } from 'three/addons/libs/stats.module.js';
|
|
23
|
+
import { StoreDefinition } from 'pinia';
|
|
24
|
+
import * as THREE from 'three';
|
|
25
|
+
import { TransformControlsMode } from 'three/addons';
|
|
26
|
+
import { VNode } from 'vue';
|
|
27
|
+
import { VNodeProps } from 'vue';
|
|
28
|
+
|
|
29
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {
|
|
30
|
+
update: () => void;
|
|
31
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
|
|
33
|
+
declare const __VLS_component_2: DefineComponent<ScaleProps, ScaleInstance, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
34
|
+
moving: (pos: MoveParams) => any;
|
|
35
|
+
scaling: (scaleEl: HTMLElement) => any;
|
|
36
|
+
beforeMove: (pos: MoveParams) => any;
|
|
37
|
+
afterMove: (pos: MoveParams) => any;
|
|
38
|
+
afterScale: (scaleEl: HTMLElement) => any;
|
|
39
|
+
maskClick: () => any;
|
|
40
|
+
"update:modelValue": (data: ScaleConfig) => any;
|
|
41
|
+
}, string, PublicProps, Readonly<ScaleProps> & Readonly<{
|
|
42
|
+
onMoving?: ((pos: MoveParams) => any) | undefined;
|
|
43
|
+
onScaling?: ((scaleEl: HTMLElement) => any) | undefined;
|
|
44
|
+
onBeforeMove?: ((pos: MoveParams) => any) | undefined;
|
|
45
|
+
onAfterMove?: ((pos: MoveParams) => any) | undefined;
|
|
46
|
+
onAfterScale?: ((scaleEl: HTMLElement) => any) | undefined;
|
|
47
|
+
onMaskClick?: (() => any) | undefined;
|
|
48
|
+
"onUpdate:modelValue"?: ((data: ScaleConfig) => any) | undefined;
|
|
49
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
|
|
51
|
+
declare const __VLS_component_3: DefineComponent<__VLS_Props_2, {
|
|
52
|
+
world: World;
|
|
53
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
54
|
+
loaded: (args_0: World) => any;
|
|
55
|
+
targetClick: (args_0: TargetData) => any;
|
|
56
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
57
|
+
onLoaded?: ((args_0: World) => any) | undefined;
|
|
58
|
+
onTargetClick?: ((args_0: TargetData) => any) | undefined;
|
|
59
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
60
|
+
|
|
61
|
+
declare const __VLS_component_4: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
|
|
63
|
+
declare const __VLS_component_5: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
|
|
65
|
+
declare type __VLS_Props = {
|
|
66
|
+
/**
|
|
67
|
+
* 选择top时,如果元素滚动到[底部]消失或即将消失,会回到原位置
|
|
68
|
+
*
|
|
69
|
+
* 选择bottom时则是滚动到[顶部]时触发
|
|
70
|
+
*/
|
|
71
|
+
position?: "top" | "bottom";
|
|
72
|
+
target?: string;
|
|
73
|
+
offset?: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
declare type __VLS_Props_2 = {
|
|
77
|
+
/**
|
|
78
|
+
* if true, will add a panel for debugging. press `m` to toggle the panel
|
|
79
|
+
*/
|
|
80
|
+
debug?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* if you want to use draco decoder, must specify `dracoDecoderPath`
|
|
83
|
+
*
|
|
84
|
+
* 1. you can set the path with cdn url: `https://www.gstatic.com/draco/versioned/decoders/1.5.7/`
|
|
85
|
+
* 2. or copy the draco decoder files to your `/public/droc/gltf` directory, and set the value to `/droc/gltf`
|
|
86
|
+
*/
|
|
87
|
+
dracoDecoderPath?: string;
|
|
88
|
+
/**
|
|
89
|
+
* config for rendering models
|
|
90
|
+
*/
|
|
91
|
+
config: ThreePanelConf;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare type __VLS_Props_3 = {
|
|
95
|
+
text: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare type __VLS_Props_4 = {
|
|
99
|
+
modelValue?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* @description 如果为true,则在icon不可视时摧毁元素而不是隐藏透明度
|
|
102
|
+
*/
|
|
103
|
+
destroyIcon?: boolean;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
declare type __VLS_Props_5 = {
|
|
107
|
+
lib: ComponentLibrary;
|
|
108
|
+
provider: ComponentProvider;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
declare type __VLS_Slots = {} & {
|
|
112
|
+
default?: (props: typeof __VLS_1) => any;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
declare type __VLS_Slots_2 = {} & {
|
|
116
|
+
header?: (props: typeof __VLS_1) => any;
|
|
117
|
+
} & {
|
|
118
|
+
default?: (props: typeof __VLS_7) => any;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
declare type __VLS_Slots_3 = {} & {
|
|
122
|
+
default?: (props: typeof __VLS_9) => any;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare type __VLS_Slots_4 = {} & {
|
|
126
|
+
header?: (props: typeof __VLS_8) => any;
|
|
127
|
+
} & {
|
|
128
|
+
default?: (props: typeof __VLS_15) => any;
|
|
129
|
+
} & {
|
|
130
|
+
footer?: (props: typeof __VLS_18) => any;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
declare type __VLS_Slots_5 = {} & {
|
|
134
|
+
default?: (props: typeof __VLS_10) => any;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
declare type __VLS_WithSlots<T, S> = T & {
|
|
138
|
+
new (): {
|
|
139
|
+
$slots: S;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
declare type __VLS_WithSlots_2<T, S> = T & {
|
|
144
|
+
new (): {
|
|
145
|
+
$slots: S;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare type __VLS_WithSlots_3<T, S> = T & {
|
|
150
|
+
new (): {
|
|
151
|
+
$slots: S;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
declare type __VLS_WithSlots_4<T, S> = T & {
|
|
156
|
+
new (): {
|
|
157
|
+
$slots: S;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
declare type __VLS_WithSlots_5<T, S> = T & {
|
|
162
|
+
new (): {
|
|
163
|
+
$slots: S;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
declare type __VLS_WithSlots_6<T, S> = T & {
|
|
168
|
+
new (): {
|
|
169
|
+
$slots: S;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* anger to rad
|
|
175
|
+
*/
|
|
176
|
+
export declare function a2r(angle: number): number;
|
|
177
|
+
|
|
178
|
+
export declare const Affix: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
179
|
+
|
|
180
|
+
export declare type AnimateDir = "left" | "top" | "bottom" | "right" | "self" | "center" | {
|
|
181
|
+
x?: number;
|
|
182
|
+
y?: number;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
declare type ArrMutKeys = "splice" | "push" | "pop" | "shift" | "unshift";
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 异步回调函数类型
|
|
189
|
+
*/
|
|
190
|
+
declare type AsyncCallBackFn = (...arg: any[]) => Promise<void>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 组件实例数据,包含元数据
|
|
194
|
+
*/
|
|
195
|
+
export declare type BaseComponent = {
|
|
196
|
+
/**
|
|
197
|
+
* 组件实例id
|
|
198
|
+
*/
|
|
199
|
+
id: string;
|
|
200
|
+
/**
|
|
201
|
+
* 生成当前组件的组件库id
|
|
202
|
+
*/
|
|
203
|
+
libraryId: string;
|
|
204
|
+
/**
|
|
205
|
+
* 元数据
|
|
206
|
+
*/
|
|
207
|
+
raw: RawComponent;
|
|
208
|
+
node: VNode;
|
|
209
|
+
/**
|
|
210
|
+
* 组件属性
|
|
211
|
+
*/
|
|
212
|
+
props: Record<string, unknown>;
|
|
213
|
+
/**
|
|
214
|
+
* 组件自带事件
|
|
215
|
+
*/
|
|
216
|
+
events: Record<string, CallBackFn>;
|
|
217
|
+
/**
|
|
218
|
+
* 连接provider的hooks
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* 全局上下文
|
|
222
|
+
*/
|
|
223
|
+
context: ComponentProvider;
|
|
224
|
+
/**
|
|
225
|
+
* 当前节点的父节点
|
|
226
|
+
*/
|
|
227
|
+
parent?: BaseComponent;
|
|
228
|
+
/**
|
|
229
|
+
* 当前节点所在父节点的插槽名称
|
|
230
|
+
*/
|
|
231
|
+
slotname?: string;
|
|
232
|
+
/**
|
|
233
|
+
* `slotname`下的子组件
|
|
234
|
+
*/
|
|
235
|
+
children: BaseComponent[];
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 只包含基础数据类型的BaseComponent
|
|
240
|
+
*/
|
|
241
|
+
export declare type BaseComponentSerialized = {
|
|
242
|
+
label: string;
|
|
243
|
+
props: Array<BaseConfigProps & {
|
|
244
|
+
propName: string;
|
|
245
|
+
}>;
|
|
246
|
+
libraryId: string;
|
|
247
|
+
slotname?: string;
|
|
248
|
+
children: BaseComponentSerialized[];
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare interface BaseConfigProps {
|
|
252
|
+
/**
|
|
253
|
+
* 当属性存在多种类型时,要选择最终的类型
|
|
254
|
+
*/
|
|
255
|
+
finalType?: PropsType;
|
|
256
|
+
/**
|
|
257
|
+
* 该属性设置的值,最终生成的value用于赋值给组件
|
|
258
|
+
*/
|
|
259
|
+
metaValue?: Primitive;
|
|
260
|
+
/**
|
|
261
|
+
* 属性值类型,默认为`Static`
|
|
262
|
+
*/
|
|
263
|
+
valueType?: ValueType;
|
|
264
|
+
/**
|
|
265
|
+
* 当前属性为变量时的变量id
|
|
266
|
+
*/
|
|
267
|
+
variableId?: string;
|
|
268
|
+
/**
|
|
269
|
+
* 隐藏属性,不可配置
|
|
270
|
+
*/
|
|
271
|
+
hidden?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* 禁用属性,不可配置
|
|
274
|
+
*/
|
|
275
|
+
disabled?: boolean;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare interface BaseProps extends BaseConfigProps {
|
|
279
|
+
/**
|
|
280
|
+
* 默认预设值
|
|
281
|
+
*/
|
|
282
|
+
default?: Primitive;
|
|
283
|
+
/**
|
|
284
|
+
* 允许空值
|
|
285
|
+
*/
|
|
286
|
+
allowEmpty?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* 属性值描述
|
|
289
|
+
*/
|
|
290
|
+
desc: string;
|
|
291
|
+
/**
|
|
292
|
+
* 属性值所在版本
|
|
293
|
+
*/
|
|
294
|
+
version?: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export declare class Bot {
|
|
298
|
+
box: THREE.Box3;
|
|
299
|
+
size: THREE.Vector3;
|
|
300
|
+
animateDuration: number;
|
|
301
|
+
model?: GLTF;
|
|
302
|
+
animations: THREE.AnimationClip[];
|
|
303
|
+
mixer: THREE.AnimationMixer | undefined;
|
|
304
|
+
skeleton: THREE.SkeletonHelper | undefined;
|
|
305
|
+
/**
|
|
306
|
+
* preset actions lists,in clude weight,name,and Action instance
|
|
307
|
+
*/
|
|
308
|
+
baseActions: BotAction[];
|
|
309
|
+
direction: THREE.Vector3;
|
|
310
|
+
move: {
|
|
311
|
+
forward: boolean;
|
|
312
|
+
backward: boolean;
|
|
313
|
+
left: boolean;
|
|
314
|
+
right: boolean;
|
|
315
|
+
speed: number;
|
|
316
|
+
jumpHeight: number;
|
|
317
|
+
canJump: boolean;
|
|
318
|
+
jumping: boolean;
|
|
319
|
+
status: string;
|
|
320
|
+
onFloor: boolean;
|
|
321
|
+
};
|
|
322
|
+
initPosition: THREE.Vector3;
|
|
323
|
+
readonly loader: Loader;
|
|
324
|
+
readonly core: Core;
|
|
325
|
+
readonly collider?: ReturnType<typeof useCollider>;
|
|
326
|
+
private currentAction?;
|
|
327
|
+
private uv;
|
|
328
|
+
private actionMap;
|
|
329
|
+
constructor(opts: BotOptions);
|
|
330
|
+
/**
|
|
331
|
+
* load bot
|
|
332
|
+
*/
|
|
333
|
+
load(gltfPath: string, conf?: LoadOptions): Promise<GLTF | null>;
|
|
334
|
+
/**
|
|
335
|
+
* teleport bot to a new position
|
|
336
|
+
*/
|
|
337
|
+
teleport(x: number, y: number, z: number): void;
|
|
338
|
+
update(delta: number): void;
|
|
339
|
+
once<K extends keyof BotEv>(event: K, callback: BotEv[K]): Bot;
|
|
340
|
+
on<K extends keyof BotEv>(event: K, callback: BotEv[K]): Bot;
|
|
341
|
+
emit<K extends keyof BotEv>(event: K, ...args: Parameters<BotEv[K]>): Bot;
|
|
342
|
+
run(): void;
|
|
343
|
+
walk(): void;
|
|
344
|
+
idle(): void;
|
|
345
|
+
dispose(): void;
|
|
346
|
+
private init;
|
|
347
|
+
private setWeight;
|
|
348
|
+
private _action;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export declare interface BotAction {
|
|
352
|
+
name: string;
|
|
353
|
+
action: THREE.AnimationAction;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export declare type BotActionMap = {
|
|
357
|
+
[key in BotActionName]: string;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export declare enum BotActionName {
|
|
361
|
+
IDLE = "idle",
|
|
362
|
+
RUN = "run",
|
|
363
|
+
WALK = "walk",
|
|
364
|
+
JUMP = "jump"
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export declare interface BotEv {
|
|
368
|
+
BotPos: (e: THREE.Vector3) => void;
|
|
369
|
+
BotLoaded: (model: THREE.Group<THREE.Object3DEventMap>) => void;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export declare interface BotOptions {
|
|
373
|
+
core: Core;
|
|
374
|
+
initPosition?: THREE.Vector3;
|
|
375
|
+
jumpHeight?: number;
|
|
376
|
+
speed?: number;
|
|
377
|
+
actionMap?: BotActionMap;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* 回调函数类型
|
|
382
|
+
*/
|
|
383
|
+
declare type CallBackFn = (...arg: any[]) => void;
|
|
384
|
+
|
|
385
|
+
export declare type CameraConf = {
|
|
386
|
+
position: {
|
|
387
|
+
x: number;
|
|
388
|
+
y: number;
|
|
389
|
+
z: number;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
declare interface ColorProps extends BaseProps {
|
|
394
|
+
type: PropsType.Color;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare type CombArray<T> = T | T[];
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* UI组件拥有的默认事件
|
|
401
|
+
*/
|
|
402
|
+
export declare type ComponentEvents = {
|
|
403
|
+
name: string;
|
|
404
|
+
desc: string;
|
|
405
|
+
/**
|
|
406
|
+
* 事件回调函数参数
|
|
407
|
+
*
|
|
408
|
+
* eg: ["value:string|number"]
|
|
409
|
+
*/
|
|
410
|
+
args: string[];
|
|
411
|
+
returnType?: string;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
export declare class ComponentGenerator {
|
|
415
|
+
#private;
|
|
416
|
+
constructor(provider: ComponentProvider);
|
|
417
|
+
generate(raw: RawComponent): BaseComponent | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* 刷新current组件所有属性
|
|
420
|
+
*/
|
|
421
|
+
refresh(newProps: Record<string, Props>, current: BaseComponent): void;
|
|
422
|
+
/**
|
|
423
|
+
* 刷新单个current组件属性
|
|
424
|
+
*/
|
|
425
|
+
refreshProp(propName: string, newProp: Props, current: BaseComponent): void;
|
|
426
|
+
getPropsGenerator(): PropsGenerator;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export declare enum ComponentLabel {
|
|
430
|
+
/**
|
|
431
|
+
* 空label占位符
|
|
432
|
+
*/
|
|
433
|
+
NULL = "NULL",
|
|
434
|
+
/**
|
|
435
|
+
* 占位组件名称,只用于填充组件默认插槽的元素的名称
|
|
436
|
+
*/
|
|
437
|
+
PLACEHOLDER = "PLACEHOLDER",
|
|
438
|
+
/**
|
|
439
|
+
* 占位文本,一般用于默认插槽中添加纯文本
|
|
440
|
+
*/
|
|
441
|
+
PLAIN = "PLAIN"
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* 组件库接口
|
|
446
|
+
*/
|
|
447
|
+
export declare interface ComponentLibrary {
|
|
448
|
+
/**
|
|
449
|
+
* 组件库唯一ID
|
|
450
|
+
*/
|
|
451
|
+
getId: () => string;
|
|
452
|
+
/**
|
|
453
|
+
* 注册组件到当前组件库
|
|
454
|
+
*/
|
|
455
|
+
registerComponent: (raw: RawComponent, node: VNode | Component) => void;
|
|
456
|
+
/**
|
|
457
|
+
* 获取元组件列表
|
|
458
|
+
*/
|
|
459
|
+
getRawConfig: () => RawComponent[];
|
|
460
|
+
/**
|
|
461
|
+
* 获取元组件
|
|
462
|
+
*/
|
|
463
|
+
getRaw: (label: string) => RawComponent | undefined;
|
|
464
|
+
/**
|
|
465
|
+
* 生成当前组件库设置的默认组件实例,该组件标识为一个容器,
|
|
466
|
+
* 用于在插槽中放置多个子组件,不会被渲染
|
|
467
|
+
*/
|
|
468
|
+
getDefault: () => RawComponent;
|
|
469
|
+
/**
|
|
470
|
+
* 是否是组件库中的默认组件
|
|
471
|
+
*/
|
|
472
|
+
isDefault(raw: RawComponent): boolean;
|
|
473
|
+
/**
|
|
474
|
+
* 是否是组件库中的占位组件
|
|
475
|
+
*/
|
|
476
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
477
|
+
/**
|
|
478
|
+
* 组件库是否拥有该组件
|
|
479
|
+
*/
|
|
480
|
+
hasComponent(raw: RawComponent): boolean;
|
|
481
|
+
/**
|
|
482
|
+
* 获取组件库的原始组件
|
|
483
|
+
*/
|
|
484
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* 全局组件provider调度器
|
|
489
|
+
*/
|
|
490
|
+
export declare interface ComponentProvider extends EventBus<ProviderEv> {
|
|
491
|
+
/**
|
|
492
|
+
* 获取最后一次拖到画布的组件元数据,获取一次后清除
|
|
493
|
+
*/
|
|
494
|
+
getCurrent: () => DeliverParam | undefined;
|
|
495
|
+
/**
|
|
496
|
+
* 向provider提供即将要生成的组件
|
|
497
|
+
*/
|
|
498
|
+
setCurrent: (raw: DeliverParam) => void;
|
|
499
|
+
/**
|
|
500
|
+
* 添加组件库
|
|
501
|
+
*/
|
|
502
|
+
addLibrary: (library: ComponentLibrary) => void;
|
|
503
|
+
/**
|
|
504
|
+
* 获取组件库
|
|
505
|
+
*/
|
|
506
|
+
getLibrary: (libraryId: string) => ComponentLibrary | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* 通过`RawComponent`获取所属组件库
|
|
509
|
+
*/
|
|
510
|
+
getLibraryByRaw: (raw: RawComponent) => ComponentLibrary | undefined;
|
|
511
|
+
/**
|
|
512
|
+
* 通过`BaseComponent`获取所属组件库
|
|
513
|
+
*/
|
|
514
|
+
getLibraryByComponent: (component: BaseComponent) => ComponentLibrary | undefined;
|
|
515
|
+
/**
|
|
516
|
+
* 获取所有组件库
|
|
517
|
+
*/
|
|
518
|
+
getLibraries: () => ComponentLibrary[];
|
|
519
|
+
/**
|
|
520
|
+
* 获取节点树数据结构
|
|
521
|
+
*/
|
|
522
|
+
getNodeTree: () => NodeTree;
|
|
523
|
+
/**
|
|
524
|
+
* 获取组件生成器
|
|
525
|
+
*/
|
|
526
|
+
getComponentGenerator: () => ComponentGenerator;
|
|
527
|
+
/**
|
|
528
|
+
* 获取变量状态管理器
|
|
529
|
+
*/
|
|
530
|
+
getVarState: () => ComponentVarState;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare interface ComponentVarState {
|
|
534
|
+
dispose: () => void;
|
|
535
|
+
createVariable: (config: VariableStatic) => Variable;
|
|
536
|
+
delVariable: (varId: string) => Variable | undefined;
|
|
537
|
+
getVariable: (varId: string) => Variable | undefined;
|
|
538
|
+
listVariable: () => Variable[];
|
|
539
|
+
serialize: () => VariableSerialized[];
|
|
540
|
+
deserialize: (data: VariableSerialized[]) => Variable[];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export declare type ControlConf = {
|
|
544
|
+
target: {
|
|
545
|
+
x: number;
|
|
546
|
+
y: number;
|
|
547
|
+
z: number;
|
|
548
|
+
};
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
export declare const Copy: __VLS_WithSlots_5<typeof __VLS_component_5, __VLS_Slots_5>;
|
|
552
|
+
|
|
553
|
+
export declare class Core {
|
|
554
|
+
#private;
|
|
555
|
+
scene: THREE.Scene;
|
|
556
|
+
camera: THREE.PerspectiveCamera;
|
|
557
|
+
renderer: THREE.WebGLRenderer;
|
|
558
|
+
db: Dexie & {
|
|
559
|
+
model: EntityTable< {
|
|
560
|
+
id: string;
|
|
561
|
+
url: string;
|
|
562
|
+
data: Blob;
|
|
563
|
+
}, "id">;
|
|
564
|
+
config: EntityTable< {
|
|
565
|
+
id: string;
|
|
566
|
+
url: string;
|
|
567
|
+
data: Record<string, unknown>;
|
|
568
|
+
}, "id">;
|
|
569
|
+
};
|
|
570
|
+
stats: Stats_2;
|
|
571
|
+
clock: THREE.Clock;
|
|
572
|
+
raycaster: THREE.Raycaster;
|
|
573
|
+
orbitCtrls: OrbitControls;
|
|
574
|
+
keyboard: {
|
|
575
|
+
ev: EventBus<{
|
|
576
|
+
[x: string]: any;
|
|
577
|
+
}>;
|
|
578
|
+
init: () => void;
|
|
579
|
+
dispose: () => void;
|
|
580
|
+
};
|
|
581
|
+
container: El;
|
|
582
|
+
loader: Loader;
|
|
583
|
+
world: World;
|
|
584
|
+
constructor();
|
|
585
|
+
init(el: HTMLElement): void;
|
|
586
|
+
once<K extends keyof ThreeEv>(event: K, callback: ThreeEv[K]): Core;
|
|
587
|
+
on<K extends keyof ThreeEv>(event: K, callback: ThreeEv[K]): Core;
|
|
588
|
+
emit<K extends keyof ThreeEv>(event: K, ...args: Parameters<ThreeEv[K]>): Core;
|
|
589
|
+
render(): void;
|
|
590
|
+
dispose(): void;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export declare interface CSS2DObjectOptions {
|
|
594
|
+
id: string;
|
|
595
|
+
el: HTMLElement;
|
|
596
|
+
target: CSS2DObject;
|
|
597
|
+
container: THREE.Mesh;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* CSS Properties
|
|
602
|
+
*/
|
|
603
|
+
declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
|
|
604
|
+
[v: `--${string}`]: string | number | undefined;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export declare const db: Dexie & {
|
|
608
|
+
model: EntityTable<{
|
|
609
|
+
id: string;
|
|
610
|
+
url: string;
|
|
611
|
+
data: Blob;
|
|
612
|
+
}, "id">;
|
|
613
|
+
config: EntityTable<{
|
|
614
|
+
id: string;
|
|
615
|
+
url: string;
|
|
616
|
+
data: Record<string, unknown>;
|
|
617
|
+
}, "id">;
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
declare interface DebugPanel {
|
|
621
|
+
id: string;
|
|
622
|
+
label: string;
|
|
623
|
+
node: VNode | Component | string;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export declare type DeliverParam = {
|
|
627
|
+
instanceId?: string;
|
|
628
|
+
raw?: RawComponent;
|
|
629
|
+
/**
|
|
630
|
+
* 事件触发时鼠标的X坐标
|
|
631
|
+
*/
|
|
632
|
+
clientX?: number;
|
|
633
|
+
/**
|
|
634
|
+
* 事件触发时鼠标的Y坐标
|
|
635
|
+
*/
|
|
636
|
+
clientY?: number;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
export declare const DialogPanel: __VLS_WithSlots_4<typeof __VLS_component_4, __VLS_Slots_4>;
|
|
640
|
+
|
|
641
|
+
declare type Dir = "horizontal" | "vertical" | "any";
|
|
642
|
+
|
|
643
|
+
declare interface DragAttr {
|
|
644
|
+
/**
|
|
645
|
+
* 元素x轴坐标
|
|
646
|
+
*/
|
|
647
|
+
x: number;
|
|
648
|
+
/**
|
|
649
|
+
* 元素y轴坐标
|
|
650
|
+
*/
|
|
651
|
+
y: number;
|
|
652
|
+
/**
|
|
653
|
+
* 指针x坐标
|
|
654
|
+
*/
|
|
655
|
+
clientX: number;
|
|
656
|
+
/**
|
|
657
|
+
* 指针y坐标
|
|
658
|
+
*/
|
|
659
|
+
clientY: number;
|
|
660
|
+
width: number | InitType;
|
|
661
|
+
height: number | InitType;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* 拖拽时transform计算的坐标
|
|
666
|
+
*/
|
|
667
|
+
export declare interface DragOffset {
|
|
668
|
+
/**
|
|
669
|
+
* pointer按下时的X坐标
|
|
670
|
+
*/
|
|
671
|
+
prevClientX: number;
|
|
672
|
+
/**
|
|
673
|
+
* pointer按下时的Y坐标
|
|
674
|
+
*/
|
|
675
|
+
prevClientY: number;
|
|
676
|
+
/**
|
|
677
|
+
* 上次移动之后的translateX
|
|
678
|
+
*/
|
|
679
|
+
prevTranslateX: number;
|
|
680
|
+
/**
|
|
681
|
+
* 上次移动之后的translateY
|
|
682
|
+
*/
|
|
683
|
+
prevTranslateY: number;
|
|
684
|
+
/**
|
|
685
|
+
* 正在移动时的translateX
|
|
686
|
+
*/
|
|
687
|
+
translateX: number;
|
|
688
|
+
/**
|
|
689
|
+
* 正在移动时的translateY
|
|
690
|
+
*/
|
|
691
|
+
translateY: number;
|
|
692
|
+
scale: FixedArray<number, 2>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export declare class El {
|
|
696
|
+
el: HTMLElement;
|
|
697
|
+
constructor(element?: HTMLElement | null);
|
|
698
|
+
setEl(el: HTMLElement): void;
|
|
699
|
+
getEl(): HTMLElement;
|
|
700
|
+
size(): ElRect;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export declare interface ElRect {
|
|
704
|
+
width: number;
|
|
705
|
+
height: number;
|
|
706
|
+
left: number;
|
|
707
|
+
top: number;
|
|
708
|
+
right: number;
|
|
709
|
+
bottom: number;
|
|
710
|
+
x: number;
|
|
711
|
+
y: number;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
declare interface EnumProps extends BaseProps {
|
|
715
|
+
type: PropsType.Enum;
|
|
716
|
+
enums: Array<string | number | boolean>;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export declare const EpComponentFlag = "EpComponent";
|
|
720
|
+
|
|
721
|
+
export declare class EpComponentParser implements ExtendPropsParser {
|
|
722
|
+
extendType(): string;
|
|
723
|
+
parse(props: Props): PropsValue;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export declare class EpLibrary implements ComponentLibrary {
|
|
727
|
+
#private;
|
|
728
|
+
constructor();
|
|
729
|
+
getId(): string;
|
|
730
|
+
registerComponent(raw: RawComponent, node: VNode | Component): void;
|
|
731
|
+
getRawConfig(): RawComponent[];
|
|
732
|
+
getRaw(label: string): RawComponent | undefined;
|
|
733
|
+
getDefault(): RawComponent;
|
|
734
|
+
hasComponent(raw: RawComponent): boolean;
|
|
735
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
736
|
+
isDefault(raw: RawComponent): boolean;
|
|
737
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export declare const EpLibraryUI: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* @description changed origin: https://github.com/browserify/events
|
|
744
|
+
*/
|
|
745
|
+
declare interface EventBus<T extends Record<string, any>> {
|
|
746
|
+
setMaxListeners(n: number): void;
|
|
747
|
+
addListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
748
|
+
removeAllListeners<K extends keyof T>(type?: K): void;
|
|
749
|
+
removeListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
750
|
+
prependListener<K extends keyof T>(type: K, listener: T[K]): void;
|
|
751
|
+
emit<K extends keyof T>(type: K, ...args: Parameters<T[K]>): void;
|
|
752
|
+
/**
|
|
753
|
+
* addListener
|
|
754
|
+
*/
|
|
755
|
+
on<K extends keyof T>(type: K, listener: T[K]): void;
|
|
756
|
+
/**
|
|
757
|
+
* removeListener
|
|
758
|
+
*/
|
|
759
|
+
off<K extends keyof T>(type: K, listener: T[K]): void;
|
|
760
|
+
once<K extends keyof T>(type: K, listener: T[K]): void;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
declare type EventBusCallback = (...args: any[]) => any;
|
|
764
|
+
|
|
765
|
+
declare interface ExtendProps extends BaseProps {
|
|
766
|
+
type: PropsType.Extend;
|
|
767
|
+
extendType: string;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
declare interface ExtendPropsParser {
|
|
771
|
+
parse(value: Props): PropsValue;
|
|
772
|
+
extendType(): string;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export declare function fetchRemote(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
776
|
+
code: number;
|
|
777
|
+
msg: string;
|
|
778
|
+
data?: Blob;
|
|
779
|
+
}>;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* 定长数组类型
|
|
783
|
+
*/
|
|
784
|
+
declare type FixedArray<T, L extends number> = Pick<T[], Exclude<keyof T[], ArrMutKeys>> & {
|
|
785
|
+
readonly length: L;
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
declare interface FunctionProps extends BaseProps {
|
|
789
|
+
type: PropsType.Function;
|
|
790
|
+
/**
|
|
791
|
+
* 实际的参数字符串会被传送到`Function`的参数中
|
|
792
|
+
*/
|
|
793
|
+
args: string[];
|
|
794
|
+
returnType: string;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* HTML 默认文本组件库
|
|
799
|
+
*/
|
|
800
|
+
export declare class GeneralLibrary implements ComponentLibrary {
|
|
801
|
+
#private;
|
|
802
|
+
constructor();
|
|
803
|
+
getId(): string;
|
|
804
|
+
registerComponent(raw: RawComponent, node: VNode | Component): void;
|
|
805
|
+
getRawConfig(): RawComponent[];
|
|
806
|
+
getRaw(label: string): RawComponent | undefined;
|
|
807
|
+
getDefault(): RawComponent;
|
|
808
|
+
hasComponent(raw: RawComponent): boolean;
|
|
809
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
810
|
+
isDefault(raw: RawComponent): boolean;
|
|
811
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
export declare function getModel(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
815
|
+
code: number;
|
|
816
|
+
msg: string;
|
|
817
|
+
data?: Blob;
|
|
818
|
+
}>;
|
|
819
|
+
|
|
820
|
+
export declare function gradientColor(startColorHex: string, endColorHex: string, step: number): Array<string>;
|
|
821
|
+
|
|
822
|
+
export declare enum HandleEv {
|
|
823
|
+
AFTER_SHOW = "after_show",
|
|
824
|
+
AFTER_HIDE = "after_hide",
|
|
825
|
+
AFTER_STICK = "after_stick"
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* translate hex color to rgb color array
|
|
830
|
+
*/
|
|
831
|
+
export declare function hex2rgb(sColor: string): Array<number>;
|
|
832
|
+
|
|
833
|
+
export declare const htmlTextConfig: (label: string, libraryId: string) => RawComponent;
|
|
834
|
+
|
|
835
|
+
export declare const htmlTextLabel: string[];
|
|
836
|
+
|
|
837
|
+
declare interface IconProps extends BaseProps {
|
|
838
|
+
type: PropsType.Icon;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
declare type InitType = "auto" | "inherit" | "initial" | "unset";
|
|
842
|
+
|
|
843
|
+
declare interface JSONProps extends BaseProps {
|
|
844
|
+
type: PropsType.JSON;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
export declare enum KeyCode {
|
|
848
|
+
init = "KEYBOARD:INIT",
|
|
849
|
+
keydown = "KEYBOARD:KEYDOWN",
|
|
850
|
+
keyup = "KEYBOARD:KEYUP",
|
|
851
|
+
keyStatus = "KEYBOARD:KEYSTATUS",
|
|
852
|
+
KeyWA = "KeyWA",
|
|
853
|
+
KeyWD = "KeyWD",
|
|
854
|
+
KeyAS = "KeyAS",
|
|
855
|
+
KeySD = "KeySD",
|
|
856
|
+
ShiftLeft = "ShiftLeft",
|
|
857
|
+
Space = "Space",
|
|
858
|
+
KeyW = "KeyW",
|
|
859
|
+
KeyA = "KeyA",
|
|
860
|
+
KeyS = "KeyS",
|
|
861
|
+
KeyD = "KeyD",
|
|
862
|
+
ArrowLeft = "ArrowLeft",
|
|
863
|
+
ArrowRight = "ArrowRight",
|
|
864
|
+
ArrowUp = "ArrowUp",
|
|
865
|
+
ArrowDown = "ArrowDown"
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export declare interface LightMeta {
|
|
869
|
+
/**
|
|
870
|
+
* unique id is required
|
|
871
|
+
*/
|
|
872
|
+
id: string;
|
|
873
|
+
type: LightType | string;
|
|
874
|
+
color: string | THREE.Color;
|
|
875
|
+
groundColor?: string | THREE.Color;
|
|
876
|
+
/**
|
|
877
|
+
* light helper will be created, this field control it's visibility
|
|
878
|
+
*/
|
|
879
|
+
helper?: boolean;
|
|
880
|
+
helperColor?: string;
|
|
881
|
+
helperSize?: number;
|
|
882
|
+
visible?: boolean;
|
|
883
|
+
position?: {
|
|
884
|
+
x: number;
|
|
885
|
+
y: number;
|
|
886
|
+
z: number;
|
|
887
|
+
};
|
|
888
|
+
rotate?: {
|
|
889
|
+
x: number;
|
|
890
|
+
y: number;
|
|
891
|
+
z: number;
|
|
892
|
+
};
|
|
893
|
+
name?: string;
|
|
894
|
+
intensity?: number;
|
|
895
|
+
distance?: number;
|
|
896
|
+
angle?: number;
|
|
897
|
+
castShadow?: boolean;
|
|
898
|
+
penumbra?: number;
|
|
899
|
+
decay?: number;
|
|
900
|
+
/**
|
|
901
|
+
* if need TransformControls
|
|
902
|
+
*/
|
|
903
|
+
debugger?: boolean;
|
|
904
|
+
/**
|
|
905
|
+
* debugger mode
|
|
906
|
+
*/
|
|
907
|
+
mode?: TransformControlsMode;
|
|
908
|
+
[x: string]: any;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export declare class Lights {
|
|
912
|
+
#private;
|
|
913
|
+
ev: EventBus<any>;
|
|
914
|
+
constructor(core: Core);
|
|
915
|
+
update(meta: LightMeta): void;
|
|
916
|
+
add(meta: LightMeta): void;
|
|
917
|
+
clear(id: string): void;
|
|
918
|
+
dispose(): void;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export declare enum LightsEvent {
|
|
922
|
+
ObjectChange = "objectChange",
|
|
923
|
+
ObjectAdd = "objectAdd",
|
|
924
|
+
ObjectRemove = "objectRemove"
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export declare enum LightType {
|
|
928
|
+
PointLight = "PointLight",
|
|
929
|
+
DirectionalLight = "DirectionalLight",
|
|
930
|
+
SpotLight = "SpotLight",
|
|
931
|
+
AmbientLight = "AmbientLight",
|
|
932
|
+
HemisphereLight = "HemisphereLight"
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
export declare class Loader {
|
|
936
|
+
#private;
|
|
937
|
+
private manager;
|
|
938
|
+
data: Record<string, LoadParam>;
|
|
939
|
+
private uv;
|
|
940
|
+
constructor(config?: LoaderConfig);
|
|
941
|
+
private init;
|
|
942
|
+
on<K extends keyof LoaderEvent>(event: K, callback: LoaderEvent[K]): Loader;
|
|
943
|
+
emit<K extends keyof LoaderEvent>(event: K, ...args: Parameters<LoaderEvent[K]>): Loader;
|
|
944
|
+
onProgress(url: string, loaded: number, total: number): void;
|
|
945
|
+
onStart(url: string, loaded: number, total: number): void;
|
|
946
|
+
onLoaded(): void;
|
|
947
|
+
onError(url: string): void;
|
|
948
|
+
load<T>(path: string, conf?: LoadOptions): Promise<T | null>;
|
|
949
|
+
loadGLTF(path: string, conf?: LoadOptions): Promise<GLTF | null>;
|
|
950
|
+
loadFBX(path: string, conf?: LoadOptions): Promise<THREE.Group<THREE.Object3DEventMap> | null>;
|
|
951
|
+
dispose(): void;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export declare type LoaderConfig = {
|
|
955
|
+
dracoLoaderPath?: string;
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export declare type LoaderEvent = Pick<ThreeEv, "LoadError" | "LoadProgress" | "LoadStart" | "Loaded" | "Log" | "Custom">;
|
|
959
|
+
|
|
960
|
+
export declare interface LoadOptions {
|
|
961
|
+
/**
|
|
962
|
+
* mark the loading progress bar is independent
|
|
963
|
+
*/
|
|
964
|
+
independent?: boolean;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
export declare type LoadParam = LoadProgressData & LoadOptions;
|
|
968
|
+
|
|
969
|
+
export declare interface LoadProgressData {
|
|
970
|
+
url: string;
|
|
971
|
+
/**
|
|
972
|
+
* loaded resources' number
|
|
973
|
+
*/
|
|
974
|
+
loaded: number;
|
|
975
|
+
/**
|
|
976
|
+
* total resources' number
|
|
977
|
+
*/
|
|
978
|
+
total: number;
|
|
979
|
+
describe?: string;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
declare type MixedProps = BaseProps & Partial<Omit<PrimitiveProps, "type">> & Partial<Omit<ColorProps, "type">> & Partial<Omit<JSONProps, "type">> & Partial<Omit<TimeProps, "type">> & Partial<Omit<EnumProps, "type">> & Partial<Omit<FunctionProps, "type">> & Partial<Omit<VueProps, "type">> & Partial<Omit<ExtendProps, "type">> & Partial<Omit<IconProps, "type">> & {
|
|
983
|
+
type: Array<PropsType>;
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
export declare interface MoveHook {
|
|
987
|
+
x?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
988
|
+
y?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
989
|
+
scale?: (oldVal: FixedArray<number, 2>, newVal: FixedArray<number, 2>) => [FixedArray<number, 2>, FixedArray<number, 2>];
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
declare interface MoveOptions {
|
|
993
|
+
/**
|
|
994
|
+
* 移动方向
|
|
995
|
+
*/
|
|
996
|
+
direction?: Dir;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
export declare type MoveParams = DragAttr & {
|
|
1000
|
+
translateX: number;
|
|
1001
|
+
translateY: number;
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
declare class NodeTree {
|
|
1005
|
+
#private;
|
|
1006
|
+
constructor();
|
|
1007
|
+
/**
|
|
1008
|
+
* @description 根据实例id搜索节点
|
|
1009
|
+
*/
|
|
1010
|
+
findByInstanceId(instanceId: string): BaseComponent | undefined;
|
|
1011
|
+
findParent(instanceId: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1012
|
+
findChild(instanceId: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1013
|
+
findSibling(instanceId: string, prev: boolean, provider: ComponentProvider): BaseComponent | undefined;
|
|
1014
|
+
/**
|
|
1015
|
+
* @description 删除`childId`子节点,如果`parentId`不存在,则删除根节点
|
|
1016
|
+
* 如果已经删除了节点,则只删除对应的map映射
|
|
1017
|
+
*/
|
|
1018
|
+
removeChild(childId: string): BaseComponent | undefined;
|
|
1019
|
+
appendNode(target: BaseComponent, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1020
|
+
pushRaw(source: RawComponent, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1021
|
+
moveTo(srcId: string, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1022
|
+
/**
|
|
1023
|
+
* @description 清空`target`的`slotname`插槽
|
|
1024
|
+
*/
|
|
1025
|
+
clearSlot(target: BaseComponent, slotname: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1026
|
+
/**
|
|
1027
|
+
* @description 创建`target`的`slotname`插槽
|
|
1028
|
+
*/
|
|
1029
|
+
createSlot(target: BaseComponent, slotname: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1030
|
+
/**
|
|
1031
|
+
* 设置根节点
|
|
1032
|
+
*/
|
|
1033
|
+
setNodes(root: BaseComponent[]): void;
|
|
1034
|
+
/**
|
|
1035
|
+
* @description 获取节点树中的所有节点
|
|
1036
|
+
*/
|
|
1037
|
+
getNodes(): BaseComponent[];
|
|
1038
|
+
getNodesLength(): number;
|
|
1039
|
+
clearNodes(): void;
|
|
1040
|
+
/**
|
|
1041
|
+
* @description 静态节点树恢复成组件树
|
|
1042
|
+
*/
|
|
1043
|
+
deserialize(provider: ComponentProvider, root: BaseComponentSerialized[], parent?: BaseComponent): BaseComponent[];
|
|
1044
|
+
/**
|
|
1045
|
+
* @description 获取节点树静态数据
|
|
1046
|
+
*/
|
|
1047
|
+
serialize(parent: BaseComponent[]): BaseComponentSerialized[];
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
export declare const ParentView: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1051
|
+
|
|
1052
|
+
export declare const placeholderNode: () => VNode<RendererNode, RendererElement, {
|
|
1053
|
+
[key: string]: any;
|
|
1054
|
+
}>;
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* 仅用于占位的元素
|
|
1058
|
+
*/
|
|
1059
|
+
export declare const placeholderRaw: () => RawComponent;
|
|
1060
|
+
|
|
1061
|
+
/**
|
|
1062
|
+
* 基础数据类型的单个或者数组结构类型
|
|
1063
|
+
*/
|
|
1064
|
+
declare interface PrimitiveProps extends BaseProps {
|
|
1065
|
+
type: CombArray<PropsType.Number | PropsType.String | PropsType.Boolean | PropsType.Undefined | PropsType.Null | PropsType.Symbol | PropsType.BigInt>;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
declare type Props = PrimitiveProps | ColorProps | JSONProps | TimeProps | EnumProps | FunctionProps | VueProps | ExtendProps | IconProps | MixedProps;
|
|
1069
|
+
|
|
1070
|
+
declare interface PropsGenerator {
|
|
1071
|
+
addParser(parser: PropsParser): this;
|
|
1072
|
+
addExtendParser(extendParser: ExtendPropsParser): this;
|
|
1073
|
+
getParsers(): PropsParser[];
|
|
1074
|
+
getExtendParsers(): ExtendPropsParser[];
|
|
1075
|
+
parse(props: Props): PropsValue | undefined;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
export declare class PropsGeneratorImpl implements PropsGenerator {
|
|
1079
|
+
#private;
|
|
1080
|
+
constructor();
|
|
1081
|
+
addParser(parser: PropsParser): this;
|
|
1082
|
+
addExtendParser(extendParser: ExtendPropsParser): this;
|
|
1083
|
+
getParsers(): PropsParser[];
|
|
1084
|
+
getExtendParsers(): ExtendPropsParser[];
|
|
1085
|
+
parse(props: Props): PropsValue | undefined;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
declare interface PropsParser {
|
|
1089
|
+
parse(value: Props): PropsValue;
|
|
1090
|
+
propsType(): PropsType;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
declare enum PropsType {
|
|
1094
|
+
Number = "Number",
|
|
1095
|
+
String = "String",
|
|
1096
|
+
Boolean = "Boolean",
|
|
1097
|
+
Undefined = "Undefined",
|
|
1098
|
+
Null = "Null",
|
|
1099
|
+
Symbol = "Symbol",
|
|
1100
|
+
BigInt = "BigInt",
|
|
1101
|
+
Time = "Time",
|
|
1102
|
+
Color = "Color",
|
|
1103
|
+
JSON = "JSON",
|
|
1104
|
+
Enum = "Enum",
|
|
1105
|
+
Function = "Function",
|
|
1106
|
+
Icon = "Icon",
|
|
1107
|
+
/**
|
|
1108
|
+
* 表示为vue内置组件
|
|
1109
|
+
*/
|
|
1110
|
+
Vue = "Vue",
|
|
1111
|
+
/**
|
|
1112
|
+
* 拓展类型拥有独立的解析器
|
|
1113
|
+
*/
|
|
1114
|
+
Extend = "Extend"
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
declare type PropsValue = Props & {
|
|
1118
|
+
value: unknown;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
export declare class Provider implements ComponentProvider {
|
|
1122
|
+
#private;
|
|
1123
|
+
constructor();
|
|
1124
|
+
getNodeTree(): NodeTree;
|
|
1125
|
+
getCurrent(): DeliverParam | undefined;
|
|
1126
|
+
setCurrent(component: DeliverParam): void;
|
|
1127
|
+
addLibrary(library: ComponentLibrary): void;
|
|
1128
|
+
getLibrary(libraryId: string): ComponentLibrary | undefined;
|
|
1129
|
+
getLibraryByRaw(raw: RawComponent): ComponentLibrary | undefined;
|
|
1130
|
+
getLibraryByComponent(component: BaseComponent): ComponentLibrary | undefined;
|
|
1131
|
+
getLibraries(): ComponentLibrary[];
|
|
1132
|
+
getComponentGenerator(): ComponentGenerator;
|
|
1133
|
+
getVarState(): ComponentVarState;
|
|
1134
|
+
setMaxListeners(n: number): void;
|
|
1135
|
+
addListener(type: string, listener: EventBusCallback): void;
|
|
1136
|
+
removeAllListeners(type?: string): void;
|
|
1137
|
+
removeListener(type: string, listener: EventBusCallback): void;
|
|
1138
|
+
prependListener(type: string, listener: EventBusCallback): void;
|
|
1139
|
+
emit(type: string, ...args: any[]): void;
|
|
1140
|
+
on(type: string, listener: EventBusCallback): void;
|
|
1141
|
+
off(type: string, listener: EventBusCallback): void;
|
|
1142
|
+
once(type: string, listener: EventBusCallback): void;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* 全局provider事件分发和订阅器
|
|
1147
|
+
*/
|
|
1148
|
+
export declare interface ProviderEv {
|
|
1149
|
+
/**
|
|
1150
|
+
* 组件未被点击,只是hover
|
|
1151
|
+
*/
|
|
1152
|
+
InstanceHover: (data?: DeliverParam) => void;
|
|
1153
|
+
/**
|
|
1154
|
+
* 右键画布中的组件时触发
|
|
1155
|
+
*/
|
|
1156
|
+
InstanceContextmenu: (data?: DeliverParam) => void;
|
|
1157
|
+
/**
|
|
1158
|
+
* 组件点击事件,向Provider传递元信息
|
|
1159
|
+
*/
|
|
1160
|
+
InstanceClick: (data: DeliverParam) => void;
|
|
1161
|
+
/**
|
|
1162
|
+
* 当source组件实例开始拖动时
|
|
1163
|
+
*/
|
|
1164
|
+
InstanceDragstart: (src: DeliverParam) => void;
|
|
1165
|
+
InstanceDragend: (src: DeliverParam) => void;
|
|
1166
|
+
/**
|
|
1167
|
+
* `实例组件/元组件`拖动到`实例组件/根组件`时触发
|
|
1168
|
+
*
|
|
1169
|
+
* 1. 元数据 拖向实例组件: src.raw && dst.instanceId
|
|
1170
|
+
* 2. 元数据 拖向根组件: src.raw
|
|
1171
|
+
* 3. 实例组件拖向实例组件: src.instanceId && dst.instanceId
|
|
1172
|
+
* 4. 实例组件拖向根组件: src.instanceId
|
|
1173
|
+
*/
|
|
1174
|
+
InstanceDrop: (data: {
|
|
1175
|
+
src?: DeliverParam;
|
|
1176
|
+
dst?: DeliverParam;
|
|
1177
|
+
}) => void;
|
|
1178
|
+
InstanceDragenter: (data: DeliverParam) => void;
|
|
1179
|
+
InstanceDragleave: (data: DeliverParam) => void;
|
|
1180
|
+
InstanceDragover: (data: DeliverParam) => void;
|
|
1181
|
+
/**
|
|
1182
|
+
* 组件内部自有事件被触发
|
|
1183
|
+
*/
|
|
1184
|
+
DefaultEventsTrigger: (data: {
|
|
1185
|
+
eventName: string;
|
|
1186
|
+
instanceId: string;
|
|
1187
|
+
data: unknown;
|
|
1188
|
+
}) => void;
|
|
1189
|
+
/**
|
|
1190
|
+
* 组件库面板中双击元组件时触发
|
|
1191
|
+
*/
|
|
1192
|
+
RawDbClick: (raw: DeliverParam) => void;
|
|
1193
|
+
/**
|
|
1194
|
+
* 通知provider组件数据结构已更新
|
|
1195
|
+
*/
|
|
1196
|
+
NeedUpdate: () => void;
|
|
1197
|
+
/**
|
|
1198
|
+
* 通知provider单个组件属性已更新
|
|
1199
|
+
*/
|
|
1200
|
+
NeedUpdateProps: (instanceId: string, key: string, prop: Props) => void;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* rad to anger
|
|
1205
|
+
*/
|
|
1206
|
+
export declare function r2a(radian: number): number;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* 组件元数据
|
|
1210
|
+
*/
|
|
1211
|
+
export declare type RawComponent = {
|
|
1212
|
+
/**
|
|
1213
|
+
* 组件名
|
|
1214
|
+
*/
|
|
1215
|
+
label: string | ComponentLabel;
|
|
1216
|
+
/**
|
|
1217
|
+
* 组件描述
|
|
1218
|
+
*/
|
|
1219
|
+
desc: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* 属性元数据
|
|
1222
|
+
*/
|
|
1223
|
+
props: Record<string, Props>;
|
|
1224
|
+
slots?: Record<string, RawComponent>;
|
|
1225
|
+
/**
|
|
1226
|
+
* UI组件默认事件
|
|
1227
|
+
*/
|
|
1228
|
+
events?: Record<string, ComponentEvents>;
|
|
1229
|
+
version?: string;
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* 远程资源,贴图,视频等
|
|
1234
|
+
*/
|
|
1235
|
+
export declare interface RemoteSrc {
|
|
1236
|
+
/**
|
|
1237
|
+
* resource type
|
|
1238
|
+
*
|
|
1239
|
+
* 1:image 2:video 3:link 4:color 5:api
|
|
1240
|
+
*/
|
|
1241
|
+
sourceType: number;
|
|
1242
|
+
objectName: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* color will be used as texture
|
|
1245
|
+
*/
|
|
1246
|
+
color?: string;
|
|
1247
|
+
/**
|
|
1248
|
+
* image/video address
|
|
1249
|
+
*/
|
|
1250
|
+
fileUrl?: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* other resource except image/video
|
|
1253
|
+
*/
|
|
1254
|
+
content?: string;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
export declare const Renderer: DefineComponent< {
|
|
1258
|
+
data: BaseComponent[];
|
|
1259
|
+
parentId: string;
|
|
1260
|
+
provider: ComponentProvider;
|
|
1261
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1262
|
+
data: BaseComponent[];
|
|
1263
|
+
parentId: string;
|
|
1264
|
+
provider: ComponentProvider;
|
|
1265
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1266
|
+
|
|
1267
|
+
export declare type RendererConf = {
|
|
1268
|
+
clearColor: string;
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* tranlate rgb color to hex string
|
|
1273
|
+
*/
|
|
1274
|
+
export declare function rgb2Hex(rgb: string): string;
|
|
1275
|
+
|
|
1276
|
+
export declare interface ScaleConfig {
|
|
1277
|
+
/**
|
|
1278
|
+
* 组件可改变尺寸
|
|
1279
|
+
*/
|
|
1280
|
+
scalable?: boolean;
|
|
1281
|
+
/**
|
|
1282
|
+
* 组件可移动
|
|
1283
|
+
*/
|
|
1284
|
+
movable?: boolean;
|
|
1285
|
+
/**
|
|
1286
|
+
* 变成正常元素
|
|
1287
|
+
*/
|
|
1288
|
+
normal?: boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* 拖动后自动靠边
|
|
1291
|
+
*/
|
|
1292
|
+
autoStick?: boolean | AnimateDir;
|
|
1293
|
+
/**
|
|
1294
|
+
* 是否显示
|
|
1295
|
+
*/
|
|
1296
|
+
visible?: boolean;
|
|
1297
|
+
/**
|
|
1298
|
+
* 初始移动位置 `translateX`
|
|
1299
|
+
*/
|
|
1300
|
+
x?: number;
|
|
1301
|
+
/**
|
|
1302
|
+
* 初始移动位置 `translateY`
|
|
1303
|
+
*/
|
|
1304
|
+
y?: number;
|
|
1305
|
+
/**
|
|
1306
|
+
* 是否拥有头部
|
|
1307
|
+
*/
|
|
1308
|
+
header?: boolean;
|
|
1309
|
+
/**
|
|
1310
|
+
* 当组件`position`不为`fixed`时
|
|
1311
|
+
* 是否相对于window定位,否则相对于父元素定位
|
|
1312
|
+
*
|
|
1313
|
+
* @default false
|
|
1314
|
+
*/
|
|
1315
|
+
attachWindow?: boolean;
|
|
1316
|
+
/**
|
|
1317
|
+
* 移动功能的配置项
|
|
1318
|
+
*/
|
|
1319
|
+
moveConfig?: MoveOptions;
|
|
1320
|
+
/**
|
|
1321
|
+
* 外壳样式
|
|
1322
|
+
*/
|
|
1323
|
+
containerStyle?: CSSProperties;
|
|
1324
|
+
/**
|
|
1325
|
+
* 内容样式,初始宽高应该在这里设置
|
|
1326
|
+
*/
|
|
1327
|
+
contentStyle?: CSSProperties;
|
|
1328
|
+
/**
|
|
1329
|
+
* 头部样式
|
|
1330
|
+
*/
|
|
1331
|
+
headerStyle?: CSSProperties;
|
|
1332
|
+
/**
|
|
1333
|
+
* 是否显示遮罩层
|
|
1334
|
+
*/
|
|
1335
|
+
mask?: boolean;
|
|
1336
|
+
/**
|
|
1337
|
+
* 遮罩层样式
|
|
1338
|
+
*/
|
|
1339
|
+
maskStyle?: CSSProperties;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
export declare enum ScaleEv {
|
|
1343
|
+
SCALING = "scaling",
|
|
1344
|
+
AFTER_SCALE = "after_scale"
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
export declare interface ScaleExtraConfNode {
|
|
1348
|
+
label: string;
|
|
1349
|
+
node: VNode | Component | string;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
export declare interface ScaleInstance {
|
|
1353
|
+
/**
|
|
1354
|
+
* 智能移动到屏幕边界
|
|
1355
|
+
* @param animate - 是否有动画效果 default: true
|
|
1356
|
+
*/
|
|
1357
|
+
autoStick: (animate: boolean) => Promise<void>;
|
|
1358
|
+
/**
|
|
1359
|
+
* 自动隐藏
|
|
1360
|
+
* @param animate - 是否有动画效果 default: true
|
|
1361
|
+
*/
|
|
1362
|
+
autoHide: (animate: boolean) => Promise<void>;
|
|
1363
|
+
/**
|
|
1364
|
+
* 移动到屏幕边界
|
|
1365
|
+
* @param animate - 是否有动画效果 default: true
|
|
1366
|
+
*/
|
|
1367
|
+
stickTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
|
|
1368
|
+
/**
|
|
1369
|
+
* 移动到屏幕 `dir`位置并隐藏
|
|
1370
|
+
* @param animate - 是否有动画效果 default: true
|
|
1371
|
+
*/
|
|
1372
|
+
hideTo: (dir: AnimateDir, animate: boolean) => Promise<void>;
|
|
1373
|
+
/**
|
|
1374
|
+
* 显示组件
|
|
1375
|
+
*/
|
|
1376
|
+
show: (animate: boolean, dir?: AnimateDir) => Promise<void>;
|
|
1377
|
+
/**
|
|
1378
|
+
* 当组件`position:fixed`或者`attachWindow:true`时坐标相对于屏幕左上角;否则相对于父元素
|
|
1379
|
+
*/
|
|
1380
|
+
moveTo: (animate: boolean, dir: AnimateDir, hooks?: MoveHook) => Promise<void>;
|
|
1381
|
+
/**
|
|
1382
|
+
* 获取当前状态
|
|
1383
|
+
*/
|
|
1384
|
+
getStatus: () => Status | undefined;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export declare const ScalePanel: __VLS_WithSlots_2<typeof __VLS_component_2, __VLS_Slots_2>;
|
|
1388
|
+
|
|
1389
|
+
export declare interface ScaleProps {
|
|
1390
|
+
modelValue: ScaleConfig;
|
|
1391
|
+
/**
|
|
1392
|
+
* 按下目标元素并拖动组件,默认按下头部拖动。
|
|
1393
|
+
*/
|
|
1394
|
+
dragTarget?: MaybeRef<HTMLElement | null | undefined>;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export declare class Scene {
|
|
1398
|
+
model?: GLTF;
|
|
1399
|
+
remoteResources: Record<string, RemoteSrc>;
|
|
1400
|
+
bvh?: THREE.Mesh;
|
|
1401
|
+
remoteTarget: Record<string, TargetSrc>;
|
|
1402
|
+
/**
|
|
1403
|
+
* when true,emit the `RendererClick` event
|
|
1404
|
+
*/
|
|
1405
|
+
clickNotify: boolean;
|
|
1406
|
+
private blobUrls;
|
|
1407
|
+
readonly loader: Loader;
|
|
1408
|
+
private core;
|
|
1409
|
+
constructor(core: Core, loaderConfig?: LoaderConfig);
|
|
1410
|
+
private createVideo;
|
|
1411
|
+
/**
|
|
1412
|
+
* set texture
|
|
1413
|
+
*/
|
|
1414
|
+
setRemoteTexture(src: RemoteSrc): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* set a anchor of an object, when click the object,the corresponding event will be triggered
|
|
1417
|
+
*/
|
|
1418
|
+
setRemoteTarget(src: TargetSrc[] | TargetSrc): void;
|
|
1419
|
+
load(gltfPath: string, conf?: LoadOptions): Promise<GLTF | undefined>;
|
|
1420
|
+
setClickNotify(val?: boolean): void;
|
|
1421
|
+
dispose(): void;
|
|
1422
|
+
private disposeModel;
|
|
1423
|
+
private clearBlob;
|
|
1424
|
+
private init;
|
|
1425
|
+
/**
|
|
1426
|
+
* emit click event for debug
|
|
1427
|
+
*/
|
|
1428
|
+
private onEmitClick;
|
|
1429
|
+
private onTargetClick;
|
|
1430
|
+
private initSceneInteraction;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
export declare const Shell: __VLS_WithSlots_6<DefineComponent< {
|
|
1434
|
+
component: Component | VNode | string;
|
|
1435
|
+
instanceId: string;
|
|
1436
|
+
provider?: ComponentProvider;
|
|
1437
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1438
|
+
component: Component | VNode | string;
|
|
1439
|
+
instanceId: string;
|
|
1440
|
+
provider?: ComponentProvider;
|
|
1441
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
|
|
1442
|
+
[x: string]: ((props: {
|
|
1443
|
+
[x: string]: unknown;
|
|
1444
|
+
}) => any) | undefined;
|
|
1445
|
+
[x: number]: ((props: {
|
|
1446
|
+
[x: string]: unknown;
|
|
1447
|
+
}) => any) | undefined;
|
|
1448
|
+
}>;
|
|
1449
|
+
|
|
1450
|
+
export declare const Spinner: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1451
|
+
"update:modelValue": (value: boolean) => any;
|
|
1452
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
1453
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1454
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1455
|
+
|
|
1456
|
+
export declare enum Status {
|
|
1457
|
+
NORMAL = "NORMAL",
|
|
1458
|
+
HIDDEN = "HIDDEN"
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
export declare type TargetData = {
|
|
1462
|
+
type: "TargetSrc";
|
|
1463
|
+
data: TargetSrc;
|
|
1464
|
+
} | {
|
|
1465
|
+
type: "RemoteSrc";
|
|
1466
|
+
data: RemoteSrc;
|
|
1467
|
+
} | {
|
|
1468
|
+
type: "Object";
|
|
1469
|
+
data: THREE.Object3D<THREE.Object3DEventMap>;
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
export declare interface TargetSrc {
|
|
1473
|
+
objectName: string;
|
|
1474
|
+
data: Record<string, any>;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
export declare interface ThreeEv {
|
|
1478
|
+
/**
|
|
1479
|
+
* OrbitControl trigger `change` event
|
|
1480
|
+
*/
|
|
1481
|
+
OrbitChanged: (e: THREE.Event<"change", OrbitControls>) => void;
|
|
1482
|
+
/**
|
|
1483
|
+
* PointerLockControls trigger `lock` event
|
|
1484
|
+
*/
|
|
1485
|
+
PointerLock: (e: THREE.Event<"lock", PointerLockControls>) => void;
|
|
1486
|
+
/**
|
|
1487
|
+
* PointerLockControls trigger `unlock` event
|
|
1488
|
+
*/
|
|
1489
|
+
PointerUnlock: (e: THREE.Event<"unlock", PointerLockControls>) => void;
|
|
1490
|
+
/**
|
|
1491
|
+
* triggered before each render loop
|
|
1492
|
+
*/
|
|
1493
|
+
Render: (delta: number) => void;
|
|
1494
|
+
RendererClick: (mouse: THREE.Vector2, intersects: THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[]) => void;
|
|
1495
|
+
/**
|
|
1496
|
+
* triggered when window resize
|
|
1497
|
+
*/
|
|
1498
|
+
Resize: () => void;
|
|
1499
|
+
/**
|
|
1500
|
+
* scene and renderer resources will be disposed
|
|
1501
|
+
*/
|
|
1502
|
+
Dispose: () => void;
|
|
1503
|
+
/**
|
|
1504
|
+
* global resource loading progress
|
|
1505
|
+
*/
|
|
1506
|
+
LoadStart: (e: LoadParam) => void;
|
|
1507
|
+
/**
|
|
1508
|
+
* global resource loading progress
|
|
1509
|
+
*/
|
|
1510
|
+
LoadProgress: (e: LoadParam) => void;
|
|
1511
|
+
/**
|
|
1512
|
+
* global resource loading progress
|
|
1513
|
+
*/
|
|
1514
|
+
Loaded: () => void;
|
|
1515
|
+
/**
|
|
1516
|
+
* global resource loading progress
|
|
1517
|
+
*/
|
|
1518
|
+
LoadError: (url: string) => void;
|
|
1519
|
+
/**
|
|
1520
|
+
* log event
|
|
1521
|
+
*/
|
|
1522
|
+
Log: (msg: {
|
|
1523
|
+
code: number;
|
|
1524
|
+
msg: string;
|
|
1525
|
+
data?: {
|
|
1526
|
+
type?: string;
|
|
1527
|
+
data?: unknown;
|
|
1528
|
+
};
|
|
1529
|
+
}) => void;
|
|
1530
|
+
/**
|
|
1531
|
+
* camera params update
|
|
1532
|
+
*/
|
|
1533
|
+
CameraUpdate: (e: {
|
|
1534
|
+
position: {
|
|
1535
|
+
x: number;
|
|
1536
|
+
y: number;
|
|
1537
|
+
z: number;
|
|
1538
|
+
};
|
|
1539
|
+
fov?: number;
|
|
1540
|
+
aspect?: number;
|
|
1541
|
+
near?: number;
|
|
1542
|
+
far?: number;
|
|
1543
|
+
}) => void;
|
|
1544
|
+
/**
|
|
1545
|
+
* custom event for eventbus
|
|
1546
|
+
*/
|
|
1547
|
+
Custom: (e: {
|
|
1548
|
+
type: string;
|
|
1549
|
+
data?: unknown;
|
|
1550
|
+
}) => void;
|
|
1551
|
+
/**
|
|
1552
|
+
* when click the specified object
|
|
1553
|
+
*/
|
|
1554
|
+
TargetClick: (e: TargetData) => void;
|
|
1555
|
+
/**
|
|
1556
|
+
* 场景加载完毕
|
|
1557
|
+
*/
|
|
1558
|
+
SceneLoaded: () => void;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
export declare const ThreePanel: __VLS_WithSlots_3<typeof __VLS_component_3, __VLS_Slots_3>;
|
|
1562
|
+
|
|
1563
|
+
export declare type ThreePanelConf = {
|
|
1564
|
+
url?: string;
|
|
1565
|
+
control: ControlConf;
|
|
1566
|
+
camera: CameraConf;
|
|
1567
|
+
renderer: RendererConf;
|
|
1568
|
+
lights: Array<LightMeta>;
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
declare interface TimeProps extends BaseProps {
|
|
1572
|
+
type: PropsType.Time;
|
|
1573
|
+
format?: string;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
export declare function useCollider(bot: Bot): {
|
|
1577
|
+
teleport: (x: number, y: number, z: number) => void;
|
|
1578
|
+
getPlayer: () => THREE.Mesh<RoundedBoxGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
1579
|
+
update: (delta: number) => void;
|
|
1580
|
+
init: () => void;
|
|
1581
|
+
jump: () => void;
|
|
1582
|
+
reset: () => void;
|
|
1583
|
+
getCapsule: () => {
|
|
1584
|
+
radius: number;
|
|
1585
|
+
segment: THREE.Line3;
|
|
1586
|
+
};
|
|
1587
|
+
getTempBoxHelper: () => THREE.Box3Helper;
|
|
1588
|
+
getGravity: () => number;
|
|
1589
|
+
setGravity: (value: number) => void;
|
|
1590
|
+
setCapsule: (raduis: number, start: THREE.Vector3Like, end: THREE.Vector3Like) => void;
|
|
1591
|
+
};
|
|
1592
|
+
|
|
1593
|
+
export declare const useCSS2DRenderer: () => {
|
|
1594
|
+
init: (globalWorld: World) => void;
|
|
1595
|
+
createCube: () => THREE.Mesh<THREE.BoxGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
|
|
1596
|
+
add: (id: string, el: HTMLElement, callback?: (delta: number, el: HTMLElement, target: CSS2DObject, container: THREE.Mesh) => void) => void;
|
|
1597
|
+
remove: (id: string) => void;
|
|
1598
|
+
dispose: () => void;
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* 动态增加debugger 面板
|
|
1603
|
+
*/
|
|
1604
|
+
export declare const useDebugger: StoreDefinition<"use-debugger", Pick<{
|
|
1605
|
+
panels: Reactive<DebugPanel[]>;
|
|
1606
|
+
addPanel: (conf: DebugPanel) => void;
|
|
1607
|
+
}, "panels">, Pick<{
|
|
1608
|
+
panels: Reactive<DebugPanel[]>;
|
|
1609
|
+
addPanel: (conf: DebugPanel) => void;
|
|
1610
|
+
}, never>, Pick<{
|
|
1611
|
+
panels: Reactive<DebugPanel[]>;
|
|
1612
|
+
addPanel: (conf: DebugPanel) => void;
|
|
1613
|
+
}, "addPanel">>;
|
|
1614
|
+
|
|
1615
|
+
export declare const useElement: <T extends Record<string, unknown> & VNodeProps>(node?: VNode) => {
|
|
1616
|
+
el: ShallowRef<HTMLElement, HTMLElement>;
|
|
1617
|
+
update: (node: VNode, prop?: T) => void;
|
|
1618
|
+
updateProps: (prop: T) => void;
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1621
|
+
export declare const useHandle: (data: {
|
|
1622
|
+
config: Ref<ScaleConfig>;
|
|
1623
|
+
targetEle: Readonly<ShallowRef<HTMLElement | null>>;
|
|
1624
|
+
dragOffset: Reactive<DragOffset>;
|
|
1625
|
+
parent?: HTMLElement;
|
|
1626
|
+
}) => {
|
|
1627
|
+
getTarget: () => HTMLElement | null;
|
|
1628
|
+
setStatus: (s: Status) => void;
|
|
1629
|
+
getStatus: () => Status;
|
|
1630
|
+
show: (animate?: boolean, dir?: AnimateDir) => Promise<void>;
|
|
1631
|
+
autoHide: (animate?: boolean) => Promise<void>;
|
|
1632
|
+
autoStick: (animate?: boolean) => Promise<void>;
|
|
1633
|
+
stickTo: (dir: AnimateDir, animate?: boolean) => Promise<void>;
|
|
1634
|
+
hideTo: (dir: AnimateDir, animate?: boolean) => Promise<void>;
|
|
1635
|
+
moveTo: (animate: boolean | undefined, dir: AnimateDir, hooks?: MoveHook) => Promise<void>;
|
|
1636
|
+
dispose: () => void;
|
|
1637
|
+
registerBeforeHideHook: (hook: AsyncCallBackFn) => void;
|
|
1638
|
+
registerBeforeStickHook: (hook: AsyncCallBackFn) => void;
|
|
1639
|
+
on: (e: HandleEv, cb: CallBackFn) => void;
|
|
1640
|
+
setTargetParent: (targetParent: HTMLElement | null | undefined) => void;
|
|
1641
|
+
getTargetParent: () => HTMLElement;
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
export declare function useKeyboard(): {
|
|
1645
|
+
ev: EventBus_2< {
|
|
1646
|
+
[x: string]: any;
|
|
1647
|
+
}>;
|
|
1648
|
+
init: () => void;
|
|
1649
|
+
dispose: () => void;
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
export declare const useScale: (data: {
|
|
1653
|
+
config: Ref<ScaleConfig>;
|
|
1654
|
+
targetEle: Readonly<Ref<HTMLElement | null | undefined>>;
|
|
1655
|
+
}) => {
|
|
1656
|
+
pointer: string[];
|
|
1657
|
+
getTarget: () => HTMLElement | null | undefined;
|
|
1658
|
+
onMouseDown: (e: MouseEvent, direction: string) => void;
|
|
1659
|
+
on: (e: ScaleEv, cb: CallBackFn) => void;
|
|
1660
|
+
dispose: () => void;
|
|
1661
|
+
};
|
|
1662
|
+
|
|
1663
|
+
export declare const useVarState: () => ComponentVarState;
|
|
1664
|
+
|
|
1665
|
+
declare enum ValueType {
|
|
1666
|
+
/**
|
|
1667
|
+
* 属性值为静态值
|
|
1668
|
+
*/
|
|
1669
|
+
Static = "Static",
|
|
1670
|
+
/**
|
|
1671
|
+
* 属性值绑定为一个变量
|
|
1672
|
+
*/
|
|
1673
|
+
Variable = "Variable",
|
|
1674
|
+
/**
|
|
1675
|
+
* 属性值从远程获取
|
|
1676
|
+
*/
|
|
1677
|
+
Remote = "Remote"
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
declare interface Variable {
|
|
1681
|
+
/**
|
|
1682
|
+
* 唯一ID
|
|
1683
|
+
*/
|
|
1684
|
+
id: string;
|
|
1685
|
+
/**
|
|
1686
|
+
* 变量名字
|
|
1687
|
+
*/
|
|
1688
|
+
name: string;
|
|
1689
|
+
/**
|
|
1690
|
+
* 变量描述
|
|
1691
|
+
*/
|
|
1692
|
+
desc: string;
|
|
1693
|
+
/**
|
|
1694
|
+
* 变量类型
|
|
1695
|
+
*/
|
|
1696
|
+
type: VarsType;
|
|
1697
|
+
/**
|
|
1698
|
+
* 变量响应式类型
|
|
1699
|
+
*/
|
|
1700
|
+
reactiveType: string;
|
|
1701
|
+
value: Ref<unknown> | Reactive<Array<unknown> | Record<string, unknown>>;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
declare type VariableSerialized = Omit<Variable, "value"> & {
|
|
1705
|
+
value: any;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
declare type VariableStatic = Omit<Variable, "id" | "value" | "type"> & Partial<Pick<Variable, "id">> & {
|
|
1709
|
+
value?: any;
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
export declare class VarState implements ComponentVarState {
|
|
1713
|
+
#private;
|
|
1714
|
+
dispose(): void;
|
|
1715
|
+
createVariable(config: VariableStatic): Variable;
|
|
1716
|
+
delVariable(varId: string): Variable | undefined;
|
|
1717
|
+
getVariable(varId: string): Variable | undefined;
|
|
1718
|
+
listVariable(): Variable[];
|
|
1719
|
+
serialize(): VariableSerialized[];
|
|
1720
|
+
deserialize(data: VariableSerialized[]): Variable[];
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
declare enum VarsType {
|
|
1724
|
+
Primitive = "Primitive",
|
|
1725
|
+
Object = "Object",
|
|
1726
|
+
Array = "Array"
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
declare interface VueProps extends BaseProps {
|
|
1730
|
+
type: PropsType.Vue;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
export declare interface World {
|
|
1734
|
+
core: Core;
|
|
1735
|
+
bot: Bot | null;
|
|
1736
|
+
scene: Scene | null;
|
|
1737
|
+
lights: Lights | null;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
export { }
|