@toolmain/components 1.2.7 → 1.2.9
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 +687 -0
- package/dist/index.js +14417 -6947
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,12 @@ import { GLTF } from 'three/addons';
|
|
|
11
11
|
import type { MaybeRef } from 'vue';
|
|
12
12
|
import { OrbitControls } from 'three/addons';
|
|
13
13
|
import { PointerLockControls } from 'three/addons';
|
|
14
|
+
import { Primitive } from 'type-fest';
|
|
14
15
|
import { PublicProps } from 'vue';
|
|
15
16
|
import { Reactive } from 'vue';
|
|
16
17
|
import { Ref } from 'vue';
|
|
18
|
+
import { RendererElement } from 'vue';
|
|
19
|
+
import { RendererNode } from 'vue';
|
|
17
20
|
import { RoundedBoxGeometry } from 'three/addons';
|
|
18
21
|
import { ShallowRef } from 'vue';
|
|
19
22
|
import { default as Stats_2 } from 'three/addons/libs/stats.module.js';
|
|
@@ -100,6 +103,11 @@ declare type __VLS_Props_4 = {
|
|
|
100
103
|
destroyIcon?: boolean;
|
|
101
104
|
};
|
|
102
105
|
|
|
106
|
+
declare type __VLS_Props_5 = {
|
|
107
|
+
lib: ComponentLibrary;
|
|
108
|
+
provider: ComponentProvider;
|
|
109
|
+
};
|
|
110
|
+
|
|
103
111
|
declare type __VLS_Slots = {} & {
|
|
104
112
|
default?: (props: typeof __VLS_1) => any;
|
|
105
113
|
};
|
|
@@ -156,6 +164,12 @@ declare type __VLS_WithSlots_5<T, S> = T & {
|
|
|
156
164
|
};
|
|
157
165
|
};
|
|
158
166
|
|
|
167
|
+
declare type __VLS_WithSlots_6<T, S> = T & {
|
|
168
|
+
new (): {
|
|
169
|
+
$slots: S;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
159
173
|
/**
|
|
160
174
|
* anger to rad
|
|
161
175
|
*/
|
|
@@ -170,6 +184,111 @@ export declare type AnimateDir = "left" | "top" | "bottom" | "right" | "self" |
|
|
|
170
184
|
|
|
171
185
|
declare type ArrMutKeys = "splice" | "push" | "pop" | "shift" | "unshift";
|
|
172
186
|
|
|
187
|
+
/**
|
|
188
|
+
* 组件实例数据,包含元数据
|
|
189
|
+
*/
|
|
190
|
+
export declare type BaseComponent = {
|
|
191
|
+
/**
|
|
192
|
+
* 组件实例id
|
|
193
|
+
*/
|
|
194
|
+
id: string;
|
|
195
|
+
/**
|
|
196
|
+
* 生成当前组件的组件库id
|
|
197
|
+
*/
|
|
198
|
+
libraryId: string;
|
|
199
|
+
/**
|
|
200
|
+
* 元数据
|
|
201
|
+
*/
|
|
202
|
+
raw: RawComponent;
|
|
203
|
+
node: VNode;
|
|
204
|
+
/**
|
|
205
|
+
* 组件属性
|
|
206
|
+
*/
|
|
207
|
+
props: Record<string, unknown>;
|
|
208
|
+
/**
|
|
209
|
+
* 组件自带事件
|
|
210
|
+
*/
|
|
211
|
+
events: Record<string, CallBackFn>;
|
|
212
|
+
/**
|
|
213
|
+
* 连接provider的hooks
|
|
214
|
+
*/
|
|
215
|
+
/**
|
|
216
|
+
* 全局上下文
|
|
217
|
+
*/
|
|
218
|
+
context: ComponentProvider;
|
|
219
|
+
/**
|
|
220
|
+
* 当前节点的父节点
|
|
221
|
+
*/
|
|
222
|
+
parent?: BaseComponent;
|
|
223
|
+
/**
|
|
224
|
+
* 当前节点所在父节点的插槽名称
|
|
225
|
+
*/
|
|
226
|
+
slotname?: string;
|
|
227
|
+
/**
|
|
228
|
+
* `slotname`下的子组件
|
|
229
|
+
*/
|
|
230
|
+
children: BaseComponent[];
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 只包含基础数据类型的BaseComponent
|
|
235
|
+
*/
|
|
236
|
+
export declare type BaseComponentSerialized = {
|
|
237
|
+
label: string;
|
|
238
|
+
props: Array<BaseConfigProps & {
|
|
239
|
+
propName: string;
|
|
240
|
+
}>;
|
|
241
|
+
libraryId: string;
|
|
242
|
+
slotname?: string;
|
|
243
|
+
children: BaseComponentSerialized[];
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
declare interface BaseConfigProps {
|
|
247
|
+
/**
|
|
248
|
+
* 当属性存在多种类型时,要选择最终的类型
|
|
249
|
+
*/
|
|
250
|
+
finalType?: PropsType;
|
|
251
|
+
/**
|
|
252
|
+
* 该属性设置的值,最终生成的value用于赋值给组件
|
|
253
|
+
*/
|
|
254
|
+
metaValue?: Primitive;
|
|
255
|
+
/**
|
|
256
|
+
* 属性值类型,默认为`Static`
|
|
257
|
+
*/
|
|
258
|
+
valueType?: ValueType;
|
|
259
|
+
/**
|
|
260
|
+
* 当前属性为变量时的变量id
|
|
261
|
+
*/
|
|
262
|
+
variableId?: string;
|
|
263
|
+
/**
|
|
264
|
+
* 隐藏属性,不可配置
|
|
265
|
+
*/
|
|
266
|
+
hidden?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* 禁用属性,不可配置
|
|
269
|
+
*/
|
|
270
|
+
disabled?: boolean;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare interface BaseProps extends BaseConfigProps {
|
|
274
|
+
/**
|
|
275
|
+
* 默认预设值
|
|
276
|
+
*/
|
|
277
|
+
default?: Primitive;
|
|
278
|
+
/**
|
|
279
|
+
* 允许空值
|
|
280
|
+
*/
|
|
281
|
+
allowEmpty?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* 属性值描述
|
|
284
|
+
*/
|
|
285
|
+
desc: string;
|
|
286
|
+
/**
|
|
287
|
+
* 属性值所在版本
|
|
288
|
+
*/
|
|
289
|
+
version?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
173
292
|
export declare class Bot {
|
|
174
293
|
box: THREE.Box3;
|
|
175
294
|
size: THREE.Vector3;
|
|
@@ -266,6 +385,156 @@ export declare type CameraConf = {
|
|
|
266
385
|
};
|
|
267
386
|
};
|
|
268
387
|
|
|
388
|
+
declare interface ColorProps extends BaseProps {
|
|
389
|
+
type: PropsType.Color;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
declare type CombArray<T> = T | T[];
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* UI组件拥有的默认事件
|
|
396
|
+
*/
|
|
397
|
+
export declare type ComponentEvents = {
|
|
398
|
+
name: string;
|
|
399
|
+
desc: string;
|
|
400
|
+
/**
|
|
401
|
+
* 事件回调函数参数
|
|
402
|
+
*
|
|
403
|
+
* eg: ["value:string|number"]
|
|
404
|
+
*/
|
|
405
|
+
args: string[];
|
|
406
|
+
returnType?: string;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export declare class ComponentGenerator {
|
|
410
|
+
#private;
|
|
411
|
+
constructor(provider: ComponentProvider);
|
|
412
|
+
generate(raw: RawComponent): BaseComponent | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* 刷新current组件所有属性
|
|
415
|
+
*/
|
|
416
|
+
refresh(newProps: Record<string, Props>, current: BaseComponent): void;
|
|
417
|
+
/**
|
|
418
|
+
* 刷新单个current组件属性
|
|
419
|
+
*/
|
|
420
|
+
refreshProp(propName: string, newProp: Props, current: BaseComponent): void;
|
|
421
|
+
getPropsGenerator(): PropsGenerator;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export declare enum ComponentLabel {
|
|
425
|
+
/**
|
|
426
|
+
* 空label占位符
|
|
427
|
+
*/
|
|
428
|
+
NULL = "NULL",
|
|
429
|
+
/**
|
|
430
|
+
* 占位组件名称,只用于填充组件默认插槽的元素的名称
|
|
431
|
+
*/
|
|
432
|
+
PLACEHOLDER = "PLACEHOLDER",
|
|
433
|
+
/**
|
|
434
|
+
* 占位文本,一般用于默认插槽中添加纯文本
|
|
435
|
+
*/
|
|
436
|
+
PLAIN = "PLAIN"
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* 组件库接口
|
|
441
|
+
*/
|
|
442
|
+
export declare interface ComponentLibrary {
|
|
443
|
+
/**
|
|
444
|
+
* 组件库唯一ID
|
|
445
|
+
*/
|
|
446
|
+
getId: () => string;
|
|
447
|
+
/**
|
|
448
|
+
* 注册组件到当前组件库
|
|
449
|
+
*/
|
|
450
|
+
registerComponent: (raw: RawComponent, node: VNode | Component) => void;
|
|
451
|
+
/**
|
|
452
|
+
* 获取元组件列表
|
|
453
|
+
*/
|
|
454
|
+
getRawConfig: () => RawComponent[];
|
|
455
|
+
/**
|
|
456
|
+
* 获取元组件
|
|
457
|
+
*/
|
|
458
|
+
getRaw: (label: string) => RawComponent | undefined;
|
|
459
|
+
/**
|
|
460
|
+
* 生成当前组件库设置的默认组件实例,该组件标识为一个容器,
|
|
461
|
+
* 用于在插槽中放置多个子组件,不会被渲染
|
|
462
|
+
*/
|
|
463
|
+
getDefault: () => RawComponent;
|
|
464
|
+
/**
|
|
465
|
+
* 是否是组件库中的默认组件
|
|
466
|
+
*/
|
|
467
|
+
isDefault(raw: RawComponent): boolean;
|
|
468
|
+
/**
|
|
469
|
+
* 是否是组件库中的占位组件
|
|
470
|
+
*/
|
|
471
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
472
|
+
/**
|
|
473
|
+
* 组件库是否拥有该组件
|
|
474
|
+
*/
|
|
475
|
+
hasComponent(raw: RawComponent): boolean;
|
|
476
|
+
/**
|
|
477
|
+
* 获取组件库的原始组件
|
|
478
|
+
*/
|
|
479
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* 全局组件provider调度器
|
|
484
|
+
*/
|
|
485
|
+
export declare interface ComponentProvider extends EventBus<ProviderEv> {
|
|
486
|
+
/**
|
|
487
|
+
* 获取最后一次拖到画布的组件元数据,获取一次后清除
|
|
488
|
+
*/
|
|
489
|
+
getCurrent: () => DeliverParam | undefined;
|
|
490
|
+
/**
|
|
491
|
+
* 向provider提供即将要生成的组件
|
|
492
|
+
*/
|
|
493
|
+
setCurrent: (raw: DeliverParam) => void;
|
|
494
|
+
/**
|
|
495
|
+
* 添加组件库
|
|
496
|
+
*/
|
|
497
|
+
addLibrary: (library: ComponentLibrary) => void;
|
|
498
|
+
/**
|
|
499
|
+
* 获取组件库
|
|
500
|
+
*/
|
|
501
|
+
getLibrary: (libraryId: string) => ComponentLibrary | undefined;
|
|
502
|
+
/**
|
|
503
|
+
* 通过`RawComponent`获取所属组件库
|
|
504
|
+
*/
|
|
505
|
+
getLibraryByRaw: (raw: RawComponent) => ComponentLibrary | undefined;
|
|
506
|
+
/**
|
|
507
|
+
* 通过`BaseComponent`获取所属组件库
|
|
508
|
+
*/
|
|
509
|
+
getLibraryByComponent: (component: BaseComponent) => ComponentLibrary | undefined;
|
|
510
|
+
/**
|
|
511
|
+
* 获取所有组件库
|
|
512
|
+
*/
|
|
513
|
+
getLibraries: () => ComponentLibrary[];
|
|
514
|
+
/**
|
|
515
|
+
* 获取节点树数据结构
|
|
516
|
+
*/
|
|
517
|
+
getNodeTree: () => NodeTree;
|
|
518
|
+
/**
|
|
519
|
+
* 获取组件生成器
|
|
520
|
+
*/
|
|
521
|
+
getComponentGenerator: () => ComponentGenerator;
|
|
522
|
+
/**
|
|
523
|
+
* 获取变量状态管理器
|
|
524
|
+
*/
|
|
525
|
+
getVarState: () => ComponentVarState;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare interface ComponentVarState {
|
|
529
|
+
dispose: () => void;
|
|
530
|
+
createVariable: (config: VariableStatic) => Variable;
|
|
531
|
+
delVariable: (varId: string) => Variable | undefined;
|
|
532
|
+
getVariable: (varId: string) => Variable | undefined;
|
|
533
|
+
listVariable: () => Variable[];
|
|
534
|
+
serialize: () => VariableSerialized[];
|
|
535
|
+
deserialize: (data: VariableSerialized[]) => Variable[];
|
|
536
|
+
}
|
|
537
|
+
|
|
269
538
|
export declare type ControlConf = {
|
|
270
539
|
target: {
|
|
271
540
|
x: number;
|
|
@@ -349,6 +618,19 @@ declare interface DebugPanel {
|
|
|
349
618
|
node: VNode | Component | string;
|
|
350
619
|
}
|
|
351
620
|
|
|
621
|
+
export declare type DeliverParam = {
|
|
622
|
+
instanceId?: string;
|
|
623
|
+
raw?: RawComponent;
|
|
624
|
+
/**
|
|
625
|
+
* 事件触发时鼠标的X坐标
|
|
626
|
+
*/
|
|
627
|
+
clientX?: number;
|
|
628
|
+
/**
|
|
629
|
+
* 事件触发时鼠标的Y坐标
|
|
630
|
+
*/
|
|
631
|
+
clientY?: number;
|
|
632
|
+
};
|
|
633
|
+
|
|
352
634
|
export declare const DialogPanel: __VLS_WithSlots_4<typeof __VLS_component_4, __VLS_Slots_4>;
|
|
353
635
|
|
|
354
636
|
declare type Dir = "horizontal" | "vertical" | "any";
|
|
@@ -424,6 +706,34 @@ export declare interface ElRect {
|
|
|
424
706
|
y: number;
|
|
425
707
|
}
|
|
426
708
|
|
|
709
|
+
declare interface EnumProps extends BaseProps {
|
|
710
|
+
type: PropsType.Enum;
|
|
711
|
+
enums: Array<string | number | boolean>;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export declare const EpComponentFlag = "EpComponent";
|
|
715
|
+
|
|
716
|
+
export declare class EpComponentParser implements ExtendPropsParser {
|
|
717
|
+
extendType(): string;
|
|
718
|
+
parse(props: Props): PropsValue;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare class EpLibrary implements ComponentLibrary {
|
|
722
|
+
#private;
|
|
723
|
+
constructor();
|
|
724
|
+
getId(): string;
|
|
725
|
+
registerComponent(raw: RawComponent, node: VNode | Component): void;
|
|
726
|
+
getRawConfig(): RawComponent[];
|
|
727
|
+
getRaw(label: string): RawComponent | undefined;
|
|
728
|
+
getDefault(): RawComponent;
|
|
729
|
+
hasComponent(raw: RawComponent): boolean;
|
|
730
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
731
|
+
isDefault(raw: RawComponent): boolean;
|
|
732
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export declare const EpLibraryUI: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
736
|
+
|
|
427
737
|
/**
|
|
428
738
|
* @description changed origin: https://github.com/browserify/events
|
|
429
739
|
*/
|
|
@@ -445,6 +755,18 @@ declare interface EventBus<T extends Record<string, any>> {
|
|
|
445
755
|
once<K extends keyof T>(type: K, listener: T[K]): void;
|
|
446
756
|
}
|
|
447
757
|
|
|
758
|
+
declare type EventBusCallback = (...args: any[]) => any;
|
|
759
|
+
|
|
760
|
+
declare interface ExtendProps extends BaseProps {
|
|
761
|
+
type: PropsType.Extend;
|
|
762
|
+
extendType: string;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
declare interface ExtendPropsParser {
|
|
766
|
+
parse(value: Props): PropsValue;
|
|
767
|
+
extendType(): string;
|
|
768
|
+
}
|
|
769
|
+
|
|
448
770
|
export declare function fetchRemote(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
449
771
|
code: number;
|
|
450
772
|
msg: string;
|
|
@@ -458,6 +780,32 @@ declare type FixedArray<T, L extends number> = Pick<T[], Exclude<keyof T[], ArrM
|
|
|
458
780
|
readonly length: L;
|
|
459
781
|
};
|
|
460
782
|
|
|
783
|
+
declare interface FunctionProps extends BaseProps {
|
|
784
|
+
type: PropsType.Function;
|
|
785
|
+
/**
|
|
786
|
+
* 实际的参数字符串会被传送到`Function`的参数中
|
|
787
|
+
*/
|
|
788
|
+
args: string[];
|
|
789
|
+
returnType: string;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* HTML 默认文本组件库
|
|
794
|
+
*/
|
|
795
|
+
export declare class GeneralLibrary implements ComponentLibrary {
|
|
796
|
+
#private;
|
|
797
|
+
constructor();
|
|
798
|
+
getId(): string;
|
|
799
|
+
registerComponent(raw: RawComponent, node: VNode | Component): void;
|
|
800
|
+
getRawConfig(): RawComponent[];
|
|
801
|
+
getRaw(label: string): RawComponent | undefined;
|
|
802
|
+
getDefault(): RawComponent;
|
|
803
|
+
hasComponent(raw: RawComponent): boolean;
|
|
804
|
+
getRawNode(raw: RawComponent): VNode | Component | undefined;
|
|
805
|
+
isDefault(raw: RawComponent): boolean;
|
|
806
|
+
isPlaceHolder(raw: RawComponent): boolean;
|
|
807
|
+
}
|
|
808
|
+
|
|
461
809
|
export declare function getModel(url: string, onProgress?: (progress: LoadProgressData) => void): Promise<{
|
|
462
810
|
code: number;
|
|
463
811
|
msg: string;
|
|
@@ -471,8 +819,20 @@ export declare function gradientColor(startColorHex: string, endColorHex: string
|
|
|
471
819
|
*/
|
|
472
820
|
export declare function hex2rgb(sColor: string): Array<number>;
|
|
473
821
|
|
|
822
|
+
export declare const htmlTextConfig: (label: string, libraryId: string) => RawComponent;
|
|
823
|
+
|
|
824
|
+
export declare const htmlTextLabel: string[];
|
|
825
|
+
|
|
826
|
+
declare interface IconProps extends BaseProps {
|
|
827
|
+
type: PropsType.Icon;
|
|
828
|
+
}
|
|
829
|
+
|
|
474
830
|
declare type InitType = "auto" | "inherit" | "initial" | "unset";
|
|
475
831
|
|
|
832
|
+
declare interface JSONProps extends BaseProps {
|
|
833
|
+
type: PropsType.JSON;
|
|
834
|
+
}
|
|
835
|
+
|
|
476
836
|
export declare enum KeyCode {
|
|
477
837
|
init = "KEYBOARD:INIT",
|
|
478
838
|
keydown = "KEYBOARD:KEYDOWN",
|
|
@@ -608,6 +968,10 @@ export declare interface LoadProgressData {
|
|
|
608
968
|
describe?: string;
|
|
609
969
|
}
|
|
610
970
|
|
|
971
|
+
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">> & {
|
|
972
|
+
type: Array<PropsType>;
|
|
973
|
+
};
|
|
974
|
+
|
|
611
975
|
export declare interface MoveHook {
|
|
612
976
|
x?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
613
977
|
y?: (oldVal: number, newVal: number, width: number, height: number) => number;
|
|
@@ -626,13 +990,234 @@ export declare type MoveParams = DragAttr & {
|
|
|
626
990
|
translateY: number;
|
|
627
991
|
};
|
|
628
992
|
|
|
993
|
+
declare class NodeTree {
|
|
994
|
+
#private;
|
|
995
|
+
constructor();
|
|
996
|
+
/**
|
|
997
|
+
* @description 根据实例id搜索节点
|
|
998
|
+
*/
|
|
999
|
+
findByInstanceId(instanceId: string): BaseComponent | undefined;
|
|
1000
|
+
findParent(instanceId: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1001
|
+
findChild(instanceId: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1002
|
+
findSibling(instanceId: string, prev: boolean, provider: ComponentProvider): BaseComponent | undefined;
|
|
1003
|
+
/**
|
|
1004
|
+
* @description 删除`childId`子节点,如果`parentId`不存在,则删除根节点
|
|
1005
|
+
* 如果已经删除了节点,则只删除对应的map映射
|
|
1006
|
+
*/
|
|
1007
|
+
removeChild(childId: string): BaseComponent | undefined;
|
|
1008
|
+
appendNode(target: BaseComponent, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1009
|
+
pushRaw(source: RawComponent, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1010
|
+
moveTo(srcId: string, provider: ComponentProvider, index: number, append: boolean, parentId?: string, slotname?: string): BaseComponent | undefined;
|
|
1011
|
+
/**
|
|
1012
|
+
* @description 清空`target`的`slotname`插槽
|
|
1013
|
+
*/
|
|
1014
|
+
clearSlot(target: BaseComponent, slotname: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1015
|
+
/**
|
|
1016
|
+
* @description 创建`target`的`slotname`插槽
|
|
1017
|
+
*/
|
|
1018
|
+
createSlot(target: BaseComponent, slotname: string, provider: ComponentProvider): BaseComponent | undefined;
|
|
1019
|
+
/**
|
|
1020
|
+
* 设置根节点
|
|
1021
|
+
*/
|
|
1022
|
+
setNodes(root: BaseComponent[]): void;
|
|
1023
|
+
/**
|
|
1024
|
+
* @description 获取节点树中的所有节点
|
|
1025
|
+
*/
|
|
1026
|
+
getNodes(): BaseComponent[];
|
|
1027
|
+
getNodesLength(): number;
|
|
1028
|
+
clearNodes(): void;
|
|
1029
|
+
/**
|
|
1030
|
+
* @description 静态节点树恢复成组件树
|
|
1031
|
+
*/
|
|
1032
|
+
deserialize(provider: ComponentProvider, root: BaseComponentSerialized[], parent?: BaseComponent): BaseComponent[];
|
|
1033
|
+
/**
|
|
1034
|
+
* @description 获取节点树静态数据
|
|
1035
|
+
*/
|
|
1036
|
+
serialize(parent: BaseComponent[]): BaseComponentSerialized[];
|
|
1037
|
+
}
|
|
1038
|
+
|
|
629
1039
|
export declare const ParentView: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
630
1040
|
|
|
1041
|
+
export declare const placeholderNode: () => VNode<RendererNode, RendererElement, {
|
|
1042
|
+
[key: string]: any;
|
|
1043
|
+
}>;
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* 仅用于占位的元素
|
|
1047
|
+
*/
|
|
1048
|
+
export declare const placeholderRaw: () => RawComponent;
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* 基础数据类型的单个或者数组结构类型
|
|
1052
|
+
*/
|
|
1053
|
+
declare interface PrimitiveProps extends BaseProps {
|
|
1054
|
+
type: CombArray<PropsType.Number | PropsType.String | PropsType.Boolean | PropsType.Undefined | PropsType.Null | PropsType.Symbol | PropsType.BigInt>;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
declare type Props = PrimitiveProps | ColorProps | JSONProps | TimeProps | EnumProps | FunctionProps | VueProps | ExtendProps | IconProps | MixedProps;
|
|
1058
|
+
|
|
1059
|
+
declare interface PropsGenerator {
|
|
1060
|
+
addParser(parser: PropsParser): this;
|
|
1061
|
+
addExtendParser(extendParser: ExtendPropsParser): this;
|
|
1062
|
+
getParsers(): PropsParser[];
|
|
1063
|
+
getExtendParsers(): ExtendPropsParser[];
|
|
1064
|
+
parse(props: Props): PropsValue | undefined;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
export declare class PropsGeneratorImpl implements PropsGenerator {
|
|
1068
|
+
#private;
|
|
1069
|
+
constructor();
|
|
1070
|
+
addParser(parser: PropsParser): this;
|
|
1071
|
+
addExtendParser(extendParser: ExtendPropsParser): this;
|
|
1072
|
+
getParsers(): PropsParser[];
|
|
1073
|
+
getExtendParsers(): ExtendPropsParser[];
|
|
1074
|
+
parse(props: Props): PropsValue | undefined;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
declare interface PropsParser {
|
|
1078
|
+
parse(value: Props): PropsValue;
|
|
1079
|
+
propsType(): PropsType;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
declare enum PropsType {
|
|
1083
|
+
Number = "Number",
|
|
1084
|
+
String = "String",
|
|
1085
|
+
Boolean = "Boolean",
|
|
1086
|
+
Undefined = "Undefined",
|
|
1087
|
+
Null = "Null",
|
|
1088
|
+
Symbol = "Symbol",
|
|
1089
|
+
BigInt = "BigInt",
|
|
1090
|
+
Time = "Time",
|
|
1091
|
+
Color = "Color",
|
|
1092
|
+
JSON = "JSON",
|
|
1093
|
+
Enum = "Enum",
|
|
1094
|
+
Function = "Function",
|
|
1095
|
+
Icon = "Icon",
|
|
1096
|
+
/**
|
|
1097
|
+
* 表示为vue内置组件
|
|
1098
|
+
*/
|
|
1099
|
+
Vue = "Vue",
|
|
1100
|
+
/**
|
|
1101
|
+
* 拓展类型拥有独立的解析器
|
|
1102
|
+
*/
|
|
1103
|
+
Extend = "Extend"
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
declare type PropsValue = Props & {
|
|
1107
|
+
value: unknown;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
export declare class Provider implements ComponentProvider {
|
|
1111
|
+
#private;
|
|
1112
|
+
constructor();
|
|
1113
|
+
getNodeTree(): NodeTree;
|
|
1114
|
+
getCurrent(): DeliverParam | undefined;
|
|
1115
|
+
setCurrent(component: DeliverParam): void;
|
|
1116
|
+
addLibrary(library: ComponentLibrary): void;
|
|
1117
|
+
getLibrary(libraryId: string): ComponentLibrary | undefined;
|
|
1118
|
+
getLibraryByRaw(raw: RawComponent): ComponentLibrary | undefined;
|
|
1119
|
+
getLibraryByComponent(component: BaseComponent): ComponentLibrary | undefined;
|
|
1120
|
+
getLibraries(): ComponentLibrary[];
|
|
1121
|
+
getComponentGenerator(): ComponentGenerator;
|
|
1122
|
+
getVarState(): ComponentVarState;
|
|
1123
|
+
setMaxListeners(n: number): void;
|
|
1124
|
+
addListener(type: string, listener: EventBusCallback): void;
|
|
1125
|
+
removeAllListeners(type?: string): void;
|
|
1126
|
+
removeListener(type: string, listener: EventBusCallback): void;
|
|
1127
|
+
prependListener(type: string, listener: EventBusCallback): void;
|
|
1128
|
+
emit(type: string, ...args: any[]): void;
|
|
1129
|
+
on(type: string, listener: EventBusCallback): void;
|
|
1130
|
+
off(type: string, listener: EventBusCallback): void;
|
|
1131
|
+
once(type: string, listener: EventBusCallback): void;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* 全局provider事件分发和订阅器
|
|
1136
|
+
*/
|
|
1137
|
+
export declare interface ProviderEv {
|
|
1138
|
+
/**
|
|
1139
|
+
* 组件未被点击,只是hover
|
|
1140
|
+
*/
|
|
1141
|
+
InstanceHover: (data?: DeliverParam) => void;
|
|
1142
|
+
/**
|
|
1143
|
+
* 右键画布中的组件时触发
|
|
1144
|
+
*/
|
|
1145
|
+
InstanceContextmenu: (data?: DeliverParam) => void;
|
|
1146
|
+
/**
|
|
1147
|
+
* 组件点击事件,向Provider传递元信息
|
|
1148
|
+
*/
|
|
1149
|
+
InstanceClick: (data: DeliverParam) => void;
|
|
1150
|
+
/**
|
|
1151
|
+
* 当source组件实例开始拖动时
|
|
1152
|
+
*/
|
|
1153
|
+
InstanceDragstart: (src: DeliverParam) => void;
|
|
1154
|
+
InstanceDragend: (src: DeliverParam) => void;
|
|
1155
|
+
/**
|
|
1156
|
+
* `实例组件/元组件`拖动到`实例组件/根组件`时触发
|
|
1157
|
+
*
|
|
1158
|
+
* 1. 元数据 拖向实例组件: src.raw && dst.instanceId
|
|
1159
|
+
* 2. 元数据 拖向根组件: src.raw
|
|
1160
|
+
* 3. 实例组件拖向实例组件: src.instanceId && dst.instanceId
|
|
1161
|
+
* 4. 实例组件拖向根组件: src.instanceId
|
|
1162
|
+
*/
|
|
1163
|
+
InstanceDrop: (data: {
|
|
1164
|
+
src?: DeliverParam;
|
|
1165
|
+
dst?: DeliverParam;
|
|
1166
|
+
}) => void;
|
|
1167
|
+
InstanceDragenter: (data: DeliverParam) => void;
|
|
1168
|
+
InstanceDragleave: (data: DeliverParam) => void;
|
|
1169
|
+
InstanceDragover: (data: DeliverParam) => void;
|
|
1170
|
+
/**
|
|
1171
|
+
* 组件内部自有事件被触发
|
|
1172
|
+
*/
|
|
1173
|
+
DefaultEventsTrigger: (data: {
|
|
1174
|
+
eventName: string;
|
|
1175
|
+
instanceId: string;
|
|
1176
|
+
data: unknown;
|
|
1177
|
+
}) => void;
|
|
1178
|
+
/**
|
|
1179
|
+
* 组件库面板中双击元组件时触发
|
|
1180
|
+
*/
|
|
1181
|
+
RawDbClick: (raw: DeliverParam) => void;
|
|
1182
|
+
/**
|
|
1183
|
+
* 通知provider组件数据结构已更新
|
|
1184
|
+
*/
|
|
1185
|
+
NeedUpdate: () => void;
|
|
1186
|
+
/**
|
|
1187
|
+
* 通知provider单个组件属性已更新
|
|
1188
|
+
*/
|
|
1189
|
+
NeedUpdateProps: (instanceId: string, key: string, prop: Props) => void;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
631
1192
|
/**
|
|
632
1193
|
* rad to anger
|
|
633
1194
|
*/
|
|
634
1195
|
export declare function r2a(radian: number): number;
|
|
635
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* 组件元数据
|
|
1199
|
+
*/
|
|
1200
|
+
export declare type RawComponent = {
|
|
1201
|
+
/**
|
|
1202
|
+
* 组件名
|
|
1203
|
+
*/
|
|
1204
|
+
label: string | ComponentLabel;
|
|
1205
|
+
/**
|
|
1206
|
+
* 组件描述
|
|
1207
|
+
*/
|
|
1208
|
+
desc: string;
|
|
1209
|
+
/**
|
|
1210
|
+
* 属性元数据
|
|
1211
|
+
*/
|
|
1212
|
+
props: Record<string, Props>;
|
|
1213
|
+
slots?: Record<string, RawComponent>;
|
|
1214
|
+
/**
|
|
1215
|
+
* UI组件默认事件
|
|
1216
|
+
*/
|
|
1217
|
+
events?: Record<string, ComponentEvents>;
|
|
1218
|
+
version?: string;
|
|
1219
|
+
};
|
|
1220
|
+
|
|
636
1221
|
/**
|
|
637
1222
|
* 远程资源,贴图,视频等
|
|
638
1223
|
*/
|
|
@@ -658,6 +1243,16 @@ export declare interface RemoteSrc {
|
|
|
658
1243
|
content?: string;
|
|
659
1244
|
}
|
|
660
1245
|
|
|
1246
|
+
export declare const Renderer: DefineComponent< {
|
|
1247
|
+
data: BaseComponent[];
|
|
1248
|
+
parentId: string;
|
|
1249
|
+
provider: ComponentProvider;
|
|
1250
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1251
|
+
data: BaseComponent[];
|
|
1252
|
+
parentId: string;
|
|
1253
|
+
provider: ComponentProvider;
|
|
1254
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1255
|
+
|
|
661
1256
|
export declare type RendererConf = {
|
|
662
1257
|
clearColor: string;
|
|
663
1258
|
};
|
|
@@ -824,6 +1419,23 @@ export declare class Scene {
|
|
|
824
1419
|
private initSceneInteraction;
|
|
825
1420
|
}
|
|
826
1421
|
|
|
1422
|
+
export declare const Shell: __VLS_WithSlots_6<DefineComponent< {
|
|
1423
|
+
component: Component | VNode | string;
|
|
1424
|
+
instanceId: string;
|
|
1425
|
+
provider?: ComponentProvider;
|
|
1426
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1427
|
+
component: Component | VNode | string;
|
|
1428
|
+
instanceId: string;
|
|
1429
|
+
provider?: ComponentProvider;
|
|
1430
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, {
|
|
1431
|
+
[x: string]: ((props: {
|
|
1432
|
+
[x: string]: unknown;
|
|
1433
|
+
}) => any) | undefined;
|
|
1434
|
+
[x: number]: ((props: {
|
|
1435
|
+
[x: string]: unknown;
|
|
1436
|
+
}) => any) | undefined;
|
|
1437
|
+
}>;
|
|
1438
|
+
|
|
827
1439
|
export declare const Spinner: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
828
1440
|
"update:modelValue": (value: boolean) => any;
|
|
829
1441
|
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
@@ -945,6 +1557,11 @@ export declare type ThreePanelConf = {
|
|
|
945
1557
|
lights: Array<LightMeta>;
|
|
946
1558
|
};
|
|
947
1559
|
|
|
1560
|
+
declare interface TimeProps extends BaseProps {
|
|
1561
|
+
type: PropsType.Time;
|
|
1562
|
+
format?: string;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
948
1565
|
export declare function useCollider(bot: Bot): {
|
|
949
1566
|
teleport: (x: number, y: number, z: number) => void;
|
|
950
1567
|
getPlayer: () => THREE.Mesh<RoundedBoxGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
@@ -1009,6 +1626,76 @@ export declare const useScale: (data: {
|
|
|
1009
1626
|
dispose: () => void;
|
|
1010
1627
|
};
|
|
1011
1628
|
|
|
1629
|
+
export declare const useVarState: () => ComponentVarState;
|
|
1630
|
+
|
|
1631
|
+
declare enum ValueType {
|
|
1632
|
+
/**
|
|
1633
|
+
* 属性值为静态值
|
|
1634
|
+
*/
|
|
1635
|
+
Static = "Static",
|
|
1636
|
+
/**
|
|
1637
|
+
* 属性值绑定为一个变量
|
|
1638
|
+
*/
|
|
1639
|
+
Variable = "Variable",
|
|
1640
|
+
/**
|
|
1641
|
+
* 属性值从远程获取
|
|
1642
|
+
*/
|
|
1643
|
+
Remote = "Remote"
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
declare interface Variable {
|
|
1647
|
+
/**
|
|
1648
|
+
* 唯一ID
|
|
1649
|
+
*/
|
|
1650
|
+
id: string;
|
|
1651
|
+
/**
|
|
1652
|
+
* 变量名字
|
|
1653
|
+
*/
|
|
1654
|
+
name: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* 变量描述
|
|
1657
|
+
*/
|
|
1658
|
+
desc: string;
|
|
1659
|
+
/**
|
|
1660
|
+
* 变量类型
|
|
1661
|
+
*/
|
|
1662
|
+
type: VarsType;
|
|
1663
|
+
/**
|
|
1664
|
+
* 变量响应式类型
|
|
1665
|
+
*/
|
|
1666
|
+
reactiveType: string;
|
|
1667
|
+
value: Ref<unknown> | Reactive<Array<unknown> | Record<string, unknown>>;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
declare type VariableSerialized = Omit<Variable, "value"> & {
|
|
1671
|
+
value: any;
|
|
1672
|
+
};
|
|
1673
|
+
|
|
1674
|
+
declare type VariableStatic = Omit<Variable, "id" | "value" | "type"> & Partial<Pick<Variable, "id">> & {
|
|
1675
|
+
value?: any;
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
export declare class VarState implements ComponentVarState {
|
|
1679
|
+
#private;
|
|
1680
|
+
dispose(): void;
|
|
1681
|
+
createVariable(config: VariableStatic): Variable;
|
|
1682
|
+
delVariable(varId: string): Variable | undefined;
|
|
1683
|
+
getVariable(varId: string): Variable | undefined;
|
|
1684
|
+
listVariable(): Variable[];
|
|
1685
|
+
serialize(): VariableSerialized[];
|
|
1686
|
+
deserialize(data: VariableSerialized[]): Variable[];
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
declare enum VarsType {
|
|
1690
|
+
Primitive = "Primitive",
|
|
1691
|
+
Object = "Object",
|
|
1692
|
+
Array = "Array"
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
declare interface VueProps extends BaseProps {
|
|
1696
|
+
type: PropsType.Vue;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1012
1699
|
export declare interface World {
|
|
1013
1700
|
core: Core;
|
|
1014
1701
|
bot: Bot | null;
|