@manycore/custom-sdk 1.0.1-rc.4 → 1.0.1-rc.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.
Files changed (4) hide show
  1. package/1.index.js +1 -1
  2. package/index.d.ts +658 -70
  3. package/index.js +76 -55
  4. package/package.json +8 -5
package/index.d.ts CHANGED
@@ -1,44 +1,70 @@
1
- import { EToolType } from '@qunhe/custom-miniapp-sdk';
1
+ import { ELineType as ELineType_2 } from '@manycore/custom-miniapp-sdk';
2
2
  import { IExportModelData } from '@manycore/custom-miniapp-sdk';
3
- import { ITopParamModelDataResponse } from '@qunhe/custom-miniapp-sdk';
4
- import { ITopParamModelList } from '@qunhe/custom-miniapp-sdk';
5
- import { ITopParamModelListOption } from '@qunhe/custom-miniapp-sdk';
6
3
  import { Number3 } from '@manycore/custom-miniapp-sdk';
7
4
 
5
+ /**
6
+ * 对接2.0主应用
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const application = new Application();
11
+ * ```
12
+ */
8
13
  export declare class Application {
9
14
  constructor();
10
15
  /**
11
- * 启动当前应用
16
+ * 启动对接2.0应用
17
+ *
18
+ * 当前,在启动对接2.0应用时,默认会自动把酷家乐主工具当中,选中的模型,加载至对接2.0场景当中。
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * await application.start();
23
+ * ```
12
24
  */
13
25
  start(): Promise<void>;
14
26
  /**
15
- * 初始化语言类型
27
+ * 初始化语言类型(默认不需要处理)
28
+ *
29
+ * 如果你有多语言的诉求,可能会用到此功能
30
+ *
16
31
  * @param lang
17
32
  * @param resource
18
33
  */
19
34
  initLange(lang?: string, resource?: {}): void;
35
+ /**
36
+ * 停止对接2.0应用
37
+ *
38
+ * 当停用时,会让主工具当中,更新模型最新的锁定状态。
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * await application.stop();
43
+ * ```
44
+ */
20
45
  stop(): Promise<void>;
46
+ /**
47
+ *
48
+ * 对接2.0中,获取相关的service
49
+ *
50
+ * 如果需要调用此方法,需要确保`Application`调用过`start`方法
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * const s = application.getService(FittingDesignService);
55
+ * ```
56
+ *
57
+ * @param serv
58
+ */
21
59
  getService<T extends BaseService>(serv: {
22
60
  new (): T;
23
61
  }): T;
24
62
  }
25
63
 
26
- declare class BaseService {
27
- }
28
-
29
64
  /**
30
- * 配件附加参数数据类型
65
+ * @private
31
66
  */
32
- export declare enum EFittingParametersType {
33
- /**
34
- * 字符串
35
- */
36
- string = "string",
37
- double = "double",
38
- long = "long",
39
- int = "int",
40
- float2 = "float2",
41
- float3 = "float3"
67
+ declare class BaseService {
42
68
  }
43
69
 
44
70
  /**
@@ -57,14 +83,32 @@ export declare enum EFittingType {
57
83
  * 五金
58
84
  */
59
85
  HARDWARE = 3,
86
+ /**
87
+ * 五金槽
88
+ */
89
+ HARDWARE_GROOVE = 4,
60
90
  /**
61
91
  * 交接面信息
62
92
  */
63
- INTERSECTED = 4
93
+ INTERSECTED = "intersected"
94
+ }
95
+
96
+ /**
97
+ * 交接信息的产生方式
98
+ */
99
+ export declare enum EIntersectedCreatedType {
100
+ /**
101
+ * 板与板之间产生的交界
102
+ */
103
+ BOTH_PLANK = 0,
104
+ /**
105
+ * 板与五金之间产生的交界信息
106
+ */
107
+ PLANK_FURNITURE = 1
64
108
  }
65
109
 
66
110
  /**
67
- * 交接面、交接体数据类型
111
+ * 交接数据的数据类型
68
112
  */
69
113
  export declare enum EIntersectedType {
70
114
  /**
@@ -77,6 +121,9 @@ export declare enum EIntersectedType {
77
121
  FACE = "2"
78
122
  }
79
123
 
124
+ /**
125
+ * 语言
126
+ */
80
127
  export declare enum ELanguage {
81
128
  ZH_CN = "zh_CN",
82
129
  EN_US = "en_US",
@@ -92,6 +139,50 @@ export declare enum ELanguage {
92
139
  VI = "vi"
93
140
  }
94
141
 
142
+ /**
143
+ * 线的类型
144
+ */
145
+ export declare enum ELineType {
146
+ /**
147
+ * 直线
148
+ */
149
+ SEGMENT = 0,
150
+ /**
151
+ * 圆弧
152
+ */
153
+ CIRCLE_ARC = 1,
154
+ /**
155
+ * 椭圆
156
+ * 当前代码中,暂不支持
157
+ */
158
+ ELLIPSE_ARC = 3
159
+ }
160
+
161
+ /**
162
+ * 点的类型
163
+ */
164
+ export declare enum EPointType {
165
+ /**
166
+ * 普通点
167
+ */
168
+ NONE = 0,
169
+ /**
170
+ * 倒圆
171
+ */
172
+ CIRCLE = 1,
173
+ /**
174
+ * 倒角
175
+ */
176
+ LINE = 2,
177
+ /**
178
+ * 切圆,就是内挖一个倒圆的形状
179
+ */
180
+ CUT_CIRCLE = 3
181
+ }
182
+
183
+ /**
184
+ * 处理选中的内容
185
+ */
95
186
  export declare enum ESelectedType {
96
187
  /**
97
188
  * 未选中模型
@@ -107,53 +198,160 @@ export declare enum ESelectedType {
107
198
  CASBIN = 2
108
199
  }
109
200
 
110
- export { EToolType }
201
+ /**
202
+ * 定制行业工具线
203
+ */
204
+ export declare enum EToolType {
205
+ /**
206
+ * 定制厨卫
207
+ */
208
+ CABINET = "CABINET",
209
+ /**
210
+ * 定制家居
211
+ */
212
+ WARDROBE = "WARDROBE",
213
+ /**
214
+ * 定制门窗
215
+ */
216
+ DOOR_WINDOW = "DW",
217
+ /**
218
+ * 定制厨卫副本工具线
219
+ */
220
+ CABINET_COPY = "CABINET_COPY",
221
+ /**
222
+ * 定制家居副本工具线
223
+ */
224
+ WARDROBE_COPY = "WARDROBE_COPY",
225
+ /**
226
+ * 定制门窗副本工具线
227
+ */
228
+ DOOR_WINDOW_COPY = "DW_COPY"
229
+ }
111
230
 
231
+ /**
232
+ * 孔槽方案相关数据的管理
233
+ *
234
+ * @example
235
+ * ```typescript
236
+ * const fittingDesignService = application.getService(FittingDesignService);
237
+ * ```
238
+ */
112
239
  export declare class FittingDesignService extends BaseService {
113
240
  /**
114
241
  * 设置孔槽方案自动保存
115
242
  *
243
+ * 当你调用`appendFittingDesign`时,如果开启自动保存,就会将当前数据与之前数据作合并,并保存至后台。如果不开启,那只会临时暂存在状态中,后续调用`saveDesign`时,才会保存至后端。
244
+ *
245
+ * @default true 自动保存
246
+ *
247
+ * @example
248
+ * ```typescript
249
+ * fittingDesignService.toggleAutoSave(false);
250
+ * ```
251
+ *
116
252
  * @param autoSave 默认开启自动保存
117
253
  */
118
254
  toggleAutoSave(autoSave?: boolean): void;
119
255
  /**
120
- * 是否开启了自动保存功能
256
+ * 获取当前是否开启了自动保存
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * fittingDesignService.isAutoSave();
261
+ * ```
121
262
  */
122
263
  isAutoSave(): boolean;
264
+ /**
265
+ * 获取孔/槽方案数据
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * fittingDesignService.getFittingDesignData();
270
+ * ```
271
+ *
272
+ * @param modelId 方案模型的ID,当没传时,就是获取场景中,正在预览的模型ID的方案数据
273
+ */
274
+ getFittingDesignData(modelId?: string): Promise<IFittingDesignData | null>;
123
275
  /**
124
276
  *
125
- * 槽方案数据
277
+ * 获取某个元件关联的孔/槽方案数据(仅作用于当前正在处理的模型)
126
278
  *
127
- * @param modelid 模型ID,如果为空时,则表示传递的为查询当前模型的数据
279
+ * @example
280
+ * ```typescript
281
+ * // 获取当前正在编辑的方案信息
282
+ * fittingDesignService.getConnectedFittingDesign();
283
+ *
284
+ * // 获取某块板上关联的孔/槽数据
285
+ * fittingDesignService.getConnectedFittingDesign('id');
286
+ *
287
+ * ```
288
+ *
289
+ * @param modelid 模型ID,如果为空时,则表示传递的为查询当前正在编辑的模型的方案数据
128
290
  * @param casbin 是否为五金,当modelid为五金的id时,需要为true
129
291
  */
130
292
  getConnectedFittingDesign(modelid?: string, casbin?: boolean): Promise<IFittingDesignData | null>;
293
+ /**
294
+ * 五金槽路径验证API(非稳定API,暂不建议使用)
295
+ *
296
+ * @param path 待验证的路径
297
+ * @param linkModelId 关联的模型ID
298
+ */
299
+ validateFittingDesign(path: IHardwareGrooveData, linkModelId: string): IFittingDesignValidateResult;
131
300
  /**
132
301
  * 往当前方案中,新增孔/槽数据
133
302
  *
134
303
  * 会自动merge数据,但同一块板上,会进行覆盖
135
304
  *
136
- * @param design
305
+ * > 如果没有开启自动保存,调用此API只影响视图展示,不会立即存储至后端。
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * await fittingDesignService.save({
310
+ * ...
311
+ * })
312
+ * ```
313
+ *
314
+ * @param design 孔/槽方案信息
137
315
  * @param option { timeout, save} 调用超时,save 是否立即保存至后端,默认为true
138
316
  */
139
317
  appendFittingDesign(design: Partial<IFittingDesignData>, option?: {
318
+ /**
319
+ * 超时时间(只有在往后端保存时,才有效)
320
+ */
140
321
  timeout?: number;
322
+ /**
323
+ * 是否强制立即保存(即覆盖是否自动保存参数)
324
+ */
141
325
  save?: boolean;
142
326
  }): Promise<void>;
143
327
  /**
144
328
  * 保存孔/槽数据至方案
145
- * 如果design不传,即表示将分步保存数据保存至后端
329
+ * 如果design不传,即表示将分步保存数据存储至后端
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * await fittingDesignService.saveDesign({
334
+ * ...
335
+ * })
336
+ * ```
146
337
  *
147
- * @param design
338
+ * @param design 需要保存的方案信息
148
339
  * @param option
149
340
  */
150
341
  saveDesign(design?: IFittingDesignData, option?: {
151
342
  timeout?: number;
152
343
  }): Promise<void>;
153
344
  /**
154
- * 清空当前孔槽方案
345
+ * 删除当前孔槽方案(解锁主工具模型)
155
346
  *
156
- * @param timeout
347
+ * 主工具当中,模型的锁定与解锁,与当前模型是不存在孔槽方案有关
348
+ * 默认情况下,option不传时,清空当前正在编辑的模型的孔槽方案,当传入modelId时,表示清空指定模型的孔槽方案数据
349
+ *
350
+ * * @example
351
+ * ```typescript
352
+ * await fittingDesignService.clearDesign();
353
+ * ```
354
+ * @param options
157
355
  */
158
356
  clearDesign(options?: IBaseOptions): Promise<void>;
159
357
  }
@@ -163,25 +361,34 @@ export declare class FittingDesignService extends BaseService {
163
361
  */
164
362
  export declare interface IBaseFittingData {
165
363
  /**
166
- * 孔槽的id
364
+ * 开发者自己生成的孔、槽信息标识ID(自行区分)
167
365
  */
168
366
  id: string;
169
367
  /**
170
- * 类型
368
+ * 当前数据类型
171
369
  */
172
370
  fittingType: EFittingType;
173
371
  /**
174
- * 附加通用参数
372
+ * 附加通用参数,开发者可以自己存储一些数据
175
373
  */
176
- params?: EFittingParametersType[];
374
+ params?: IBaseFittingParameters[];
177
375
  }
178
376
 
179
377
  /**
180
378
  * 附加通用参数存储
181
379
  */
182
380
  export declare interface IBaseFittingParameters {
381
+ /**
382
+ * 通用参数的key
383
+ */
183
384
  key: string;
385
+ /**
386
+ * 通用参数的value
387
+ */
184
388
  value: string;
389
+ /**
390
+ * 当前value值的数据类型
391
+ */
185
392
  type: string;
186
393
  }
187
394
 
@@ -207,33 +414,40 @@ export declare class FittingDesignService extends BaseService {
207
414
  end: Number3;
208
415
  }
209
416
 
417
+ /**
418
+ * 交接信息
419
+ */
210
420
  export declare interface IBaseIntersected {
211
421
  /**
212
- * 板面
422
+ * 当前交接信息所处的板面信息
213
423
  */
214
424
  plankFaceId: number;
215
425
  /**
216
- * 所有点的信息
426
+ * 当前交接信息所有顶点的信息
427
+ * * 如果为交接面,length为4
428
+ * * 如果为交接体,length为8
217
429
  */
218
430
  points: Number3[];
219
431
  /**
220
- * 关联的模型ID
432
+ * 当前交接信息产生的元件ID
221
433
  */
222
434
  linkedModelId: string;
223
435
  /**
224
- * 关联的父级模型ID
436
+ * 交接信息产生元件的父母ID
225
437
  */
226
438
  linkedParentModelId: string;
227
439
  /**
228
- * 交接类型
440
+ * 交接数据的数据类型
229
441
  */
230
442
  '@type': EIntersectedType;
231
443
  /**
444
+ * @ignore
232
445
  * 交接体的shell数据
233
446
  */
234
447
  shell?: string;
235
448
  /**
236
- * 交接体版面是否需要开槽
449
+ * 交接体板面是否需要开槽
450
+ * 当五金与板面产生的交接信息,为板面的部分,则为true
237
451
  */
238
452
  needGroove?: boolean;
239
453
  }
@@ -243,7 +457,8 @@ export declare class FittingDesignService extends BaseService {
243
457
  */
244
458
  export declare interface IBaseOptions {
245
459
  /**
246
- * 超时时间
460
+ * 最长等待时间(以ms为单位)
461
+ * @default 500000
247
462
  */
248
463
  timeout?: number;
249
464
  /**
@@ -272,6 +487,17 @@ export declare class FittingDesignService extends BaseService {
272
487
  * 五金数据
273
488
  */
274
489
  hardwares: IFittingHardwareCollect;
490
+ /**
491
+ * 五金槽数据
492
+ */
493
+ hardwareGrooves: IFittingHardwareGrooves;
494
+ }
495
+
496
+ export declare interface IFittingDesignValidateResult {
497
+ /**
498
+ * 是否验证通过
499
+ */
500
+ validated: boolean;
275
501
  }
276
502
 
277
503
  /**
@@ -284,6 +510,11 @@ export declare class FittingDesignService extends BaseService {
284
510
  */
285
511
  export declare type IFittingHardwareCollect = Record<string, IHardwareData[]>;
286
512
 
513
+ /**
514
+ * 五金槽数据
515
+ */
516
+ export declare type IFittingHardwareGrooves = Record<string, IHardwareGrooveData[]>;
517
+
287
518
  /**
288
519
  * 方案中,所有孔的数据
289
520
  */
@@ -319,6 +550,28 @@ export declare class FittingDesignService extends BaseService {
319
550
  linkedIds: string[];
320
551
  }
321
552
 
553
+ /**
554
+ * 闭合路径中的点,需要按逆时针顺序上传,否则会导致异常
555
+ */
556
+ export declare interface IHardwareGrooveData extends IBaseFittingData {
557
+ /**
558
+ * 槽的深度
559
+ */
560
+ depth: number;
561
+ /**
562
+ * 所处的板面
563
+ */
564
+ plankFaceId: number;
565
+ /**
566
+ * 闭合路径的所有点
567
+ */
568
+ points: IPointData[];
569
+ /**
570
+ * 闭合路径的所有线
571
+ */
572
+ lines: ILineData[];
573
+ }
574
+
322
575
  export declare interface IHoleData extends IBaseHoleGrooveData {
323
576
  /**
324
577
  * 孔直径
@@ -326,27 +579,78 @@ export declare class FittingDesignService extends BaseService {
326
579
  diameter: number;
327
580
  }
328
581
 
582
+ /**
583
+ * 一组交接信息
584
+ */
329
585
  export declare interface IIntersectedGroup {
330
586
  /**
331
- * 交接面ID
587
+ * 交接信息的唯一标识ID
332
588
  */
333
589
  id: string;
334
590
  /**
335
- * 交接面信息
591
+ * 交接信息的产生来源
592
+ */
593
+ intersectType: EIntersectedCreatedType;
594
+ /**
595
+ * 关联元素产生的多组交接信息
336
596
  */
337
597
  intersecteds: IBaseIntersected[];
338
598
  }
339
599
 
340
600
  /**
341
- * 交接面信息
601
+ * 交接信息
342
602
  */
343
603
  export declare interface IIntersectedResult {
604
+ /**
605
+ * 交接信息集合
606
+ */
344
607
  intersectedGroups: IIntersectedGroup[];
345
608
  }
346
609
 
610
+ export declare type ILineData = ILineDataBase | ILineDataCircle;
611
+
612
+ export declare interface ILineDataBase {
613
+ /**
614
+ * 线条类型
615
+ */
616
+ type: ELineType_2.SEGMENT;
617
+ }
618
+
619
+ export declare interface ILineDataCircle {
620
+ /**
621
+ * 线条类型
622
+ */
623
+ type: ELineType_2.CIRCLE_ARC;
624
+ /**
625
+ * 是否顺时针
626
+ */
627
+ clockwise: boolean;
628
+ /**
629
+ * 优弧劣弧 (只有弧线有)
630
+ */
631
+ minorArc: boolean;
632
+ /**
633
+ * 半径 (只有弧线有)
634
+ */
635
+ radius: number;
636
+ }
637
+
638
+ /**
639
+ * 获取交接信息
640
+ *
641
+ * @example
642
+ * ```typescript
643
+ * const intersectedService = application.getService(IntersectedService);
644
+ * ```
645
+ */
347
646
  export declare class IntersectedService extends BaseService {
348
647
  /**
349
- * 是否显示交接面信息
648
+ * 是否展示交接信息
649
+ *
650
+ * @example
651
+ * ```typescript
652
+ * intersectedService.toggleModelViewIntersected(true);
653
+ * ```
350
654
  *
351
655
  * @param flag
352
656
  */
@@ -354,24 +658,141 @@ export declare class FittingDesignService extends BaseService {
354
658
  /**
355
659
  * 切换展示的交接面、交接体坐标
356
660
  *
661
+ * @example
662
+ * ```typescript
663
+ * intersectedService.toggleModelViewedIntersected({
664
+ * references: true,
665
+ * plankFaceIds: [1],
666
+ * });
667
+ * ```
668
+ *
357
669
  * @param option
358
670
  */
359
671
  toggleModelViewedIntersected(option?: IToggleIntersectedViewOption): void;
360
672
  }
361
673
 
362
- export declare interface IPoint3d {
363
- x: number;
364
- y: number;
365
- z: number;
674
+ /**
675
+ * 点的基本类型
676
+ */
677
+ export declare interface IPointBase {
678
+ type: EPointType;
679
+ /**
680
+ * 点的位置
681
+ *
682
+ * @example
683
+ * "123,-345"
684
+ */
685
+ position: Number3;
366
686
  }
367
687
 
688
+ /**
689
+ * 点的类型参数
690
+ */
691
+ export declare type IPointData = IPointWithNone | IPointWithLine | IPointWithCircle | IPointWithCutCircle;
692
+
693
+ /**
694
+ * 倒圆
695
+ */
696
+ export declare interface IPointWithCircle extends IPointBase {
697
+ /**
698
+ * 切角类型
699
+ */
700
+ type: EPointType.CIRCLE;
701
+ /**
702
+ * 切角边边距
703
+ */
704
+ /**
705
+ * 半径 (倒圆切圆专用)
706
+ * @example
707
+ * "345.12"
708
+ */
709
+ radius: number;
710
+ }
711
+
712
+ /**
713
+ * 切圆(就是内挖一个倒圆的形状)
714
+ */
715
+ export declare interface IPointWithCutCircle extends Omit<IPointWithCircle, 'type'> {
716
+ type: EPointType.CUT_CIRCLE;
717
+ /**
718
+ * 是否顺时针
719
+ * 未设置时,则为false
720
+ */
721
+ clockwise: boolean;
722
+ }
723
+
724
+ /**
725
+ * 切角
726
+ */
727
+ export declare interface IPointWithLine extends IPointBase {
728
+ /**
729
+ * 切角类型
730
+ */
731
+ type: EPointType.LINE;
732
+ /**
733
+ * 切角边边距
734
+ */
735
+ cornerCutDistance: [number, number];
736
+ }
737
+
738
+ /**
739
+ * 普通点类型
740
+ */
741
+ export declare interface IPointWithNone extends IPointBase {
742
+ /**
743
+ * 普通点
744
+ */
745
+ type: EPointType.NONE;
746
+ /**
747
+ * 是否顺时针
748
+ * 未设置时,则为false
749
+ */
750
+ clockwise?: boolean;
751
+ }
752
+
753
+ /**
754
+ * 房间信息
755
+ */
756
+ declare interface IRoomInfo {
757
+ /**
758
+ * 所属房间ID
759
+ */
760
+ roomId?: string;
761
+ /**
762
+ * 所属房间名
763
+ */
764
+ roomName?: string;
765
+ }
766
+
767
+ /**
768
+ * 当前选中的数据
769
+ */
368
770
  export declare interface ISelected {
771
+ /**
772
+ * 选中的数据内容
773
+ */
369
774
  data: IExportModelData[] | IHardwareData[];
775
+ /**
776
+ * 选中的数据类型
777
+ */
370
778
  type: ESelectedType;
371
779
  }
372
780
 
373
781
  /**
374
- * 处理场景当中
782
+ * 场景中,模型的颜色配置能力
783
+ *
784
+ * @example
785
+ * ```json
786
+ * {
787
+ * // 交接页数据信息
788
+ * intersectedColor: 0xff4500,
789
+ * // 交接体颜色
790
+ * intersectedBodyColor: 0xff00ff,
791
+ * holeColor: 0x00ff00,
792
+ * grooveColor: 0x1e90ff,
793
+ * }
794
+ * ```
795
+ *
375
796
  */
376
797
  export declare interface ISettingColor {
377
798
  /**
@@ -382,6 +803,14 @@ export declare class FittingDesignService extends BaseService {
382
803
  * 交接体展示时,使用的颜色
383
804
  */
384
805
  intersectedBodyColor: number;
806
+ /**
807
+ * 五金与柜体之间,交接面产生的颜色
808
+ */
809
+ grooveIntersectedColor: number;
810
+ /**
811
+ * 五金与柜体之间,交接体产生的颜色
812
+ */
813
+ grooveIntersectedBodyColor: number;
385
814
  /**
386
815
  * 孔展示
387
816
  */
@@ -392,32 +821,153 @@ export declare class FittingDesignService extends BaseService {
392
821
  grooveColor: number;
393
822
  }
394
823
 
824
+ /**
825
+ * 展示交接信息时的筛选行为
826
+ */
395
827
  export declare interface IToggleIntersectedViewOption {
396
828
  /**
397
- * 是否展示
398
- * 默认为false
829
+ * 切换展示交接信息数据
830
+ *
831
+ * * `true` 显示第一组交接数据
832
+ * * `false`: 显示第二组交接数据
833
+ *
834
+ * @default false
399
835
  */
400
836
  references?: boolean;
401
- plankFaceIds?: number[];
837
+ /**
838
+ * 根据板面信息来筛选展示内容,null 表示空板面
839
+ */
840
+ plankFaceIds?: Array<number | null>;
402
841
  }
403
842
 
404
- export { ITopParamModelDataResponse }
843
+ /**
844
+ * 获取顶层模型返回值
845
+ */
846
+ export declare interface ITopParamModelDataResponse {
847
+ /**
848
+ * 当前查询总数
849
+ */
850
+ count: number;
851
+ /**
852
+ * 当前页码
853
+ */
854
+ currPage: number;
855
+ /**
856
+ * 是否还有可查询的结果
857
+ */
858
+ hasMore: boolean;
859
+ /**
860
+ * 查询的顶层模型结果
861
+ */
862
+ result: ITopParamModelList[];
863
+ /**
864
+ * 总的页数
865
+ */
866
+ totalPage: number;
867
+ }
405
868
 
406
- export { ITopParamModelList }
869
+ /**
870
+ * 顶层模型信息
871
+ */
872
+ export declare interface ITopParamModelList {
873
+ /**
874
+ * 模型ID
875
+ */
876
+ id: string;
877
+ /**
878
+ * 所属工具线
879
+ */
880
+ toolType: EToolType;
881
+ /**
882
+ * 模型名称
883
+ */
884
+ name: string;
885
+ /**
886
+ * 户型信息
887
+ */
888
+ roomInfo: IRoomInfo;
889
+ /**
890
+ * 模型是否已拆单
891
+ */
892
+ isSplit: boolean;
893
+ /**
894
+ * 模型是否锁定
895
+ */
896
+ isLocked: boolean;
897
+ /**
898
+ * 模型是否隐藏
899
+ */
900
+ isHidden: boolean;
901
+ /**
902
+ * 模型是否提审
903
+ */
904
+ isAudited: boolean;
905
+ }
407
906
 
408
- export { ITopParamModelListOption }
907
+ /**
908
+ * 获取顶层模型参数
909
+ */
910
+ export declare interface ITopParamModelListOption {
911
+ /**
912
+ * 第几页
913
+ * page 默认为 1
914
+ */
915
+ pageSize?: number;
916
+ /**
917
+ * 每页模型数量
918
+ * size 默认为 20
919
+ * 最大值为 500
920
+ */
921
+ pageNum?: number;
922
+ }
409
923
 
924
+ /**
925
+ * 主要提供了获取当前模型的 JSON 输出数据,以及当前模型的交接信息的功能。
926
+ *
927
+ * @example
928
+ * ```typescript
929
+ * const modelService = application.getService(ModelService);
930
+ * ```
931
+ */
410
932
  export declare class ModelService extends BaseService {
411
933
  /**
412
- * 获取当前整个模型数据信息
934
+ * 开发者,通常需要来获取某个模型的 JSON 数据,所以需要用此 API。当前 API 获取 JSON 数据,主要是拿的是当前正在编辑的模型的 JSON 数据。
935
+ * 如果传入modelId,则表示获取其他模型的JSON输出数据。
936
+ *
937
+ * 底层其实是通过`servkit`服务实现的。使用的是`MiniAppParamModelJsonDataService`服务。
413
938
  *
414
- * @param timeout
939
+ * 使用servkit实现示例如下:
940
+ *
941
+ * @example
942
+ * ```typescript
943
+ * import { MiniAppParamModelJsonDataService } from '@manycore/custom-miniapp-sdk';
944
+ * import { sappSDK } from 'servkit';
945
+ *
946
+ * const service = sappSDK.getServiceUnsafe(MiniAppParamModelJsonDataService);
947
+ *
948
+ * const json = await service.getModelJsonDataByModelId('请输入模型ID');
949
+ * ```
950
+ *
951
+ * > 以上 API 暂不建议在非对接 2.0 环境下使用,主要是与孔/槽方案数据存在关联关系。
952
+ > > 替代的 service 为`CustomDesignExportService`,将会在 9 月底最新的`@manycore/custom-miniapp-sdk`中提供。
953
+ *
954
+ * @example
955
+ * ```typescript
956
+ * await modelService.getParamData();
957
+ * ```
958
+ *
959
+ * @param options
415
960
  */
416
961
  getParamData(options?: IBaseOptions): Promise<any>;
417
962
  /**
418
- * 获取交接面信息
963
+ * 获取模型的交接数据
419
964
  *
420
- * @param timeout
965
+ * @example
966
+ * ```typescript
967
+ * await modelService.getParamData();
968
+ * ```
969
+ *
970
+ * @param options
421
971
  */
422
972
  getParamIntersected(options?: IBaseOptions): Promise<IIntersectedResult>;
423
973
  /**
@@ -427,56 +977,94 @@ export declare class FittingDesignService extends BaseService {
427
977
  getTopParamModels(options?: ITopParamModelListOption): Promise<ITopParamModelDataResponse>;
428
978
  }
429
979
 
980
+ /**
981
+ * 主要是用来与场景交互的,监听当前选中的对象, 获取选中的内容
982
+ *
983
+ * @example
984
+ * ```typescript
985
+ * const viewerSelectionService = application.getService(ModelViewerSelectionService);
986
+ * ```
987
+ */
430
988
  export declare class ModelViewerSelectionService extends BaseService {
431
989
  constructor();
432
990
  /**
433
- * 获取当前选中模型
991
+ * 获取当前选中的数据
434
992
  */
435
993
  getSelected(): ISelected;
436
994
  /**
995
+ * @ignore
437
996
  * 设置当前选中内容
438
997
  */
439
998
  select(selected: any[]): void;
440
999
  /**
441
- * 取消选中所有内容
1000
+ * 取消场景当中选中内容
442
1001
  */
443
1002
  unSelect(): void;
1003
+ /**
1004
+ * @ignore
1005
+ */
444
1006
  private onSelectedChanged;
1007
+ /**
1008
+ * 监听当前选中内容
1009
+ * @param fn
1010
+ */
445
1011
  on(fn: (param: ISelected) => any): void;
1012
+ /**
1013
+ * 取消监听选中变化
1014
+ * @param fn
1015
+ */
446
1016
  off(fn?: (param: ISelected) => any): void;
1017
+ /**
1018
+ * 监听当前选中的内容(触发一次后自动取消)
1019
+ * @param fn
1020
+ */
447
1021
  once(fn: (param: ISelected) => any): void;
1022
+ /**
1023
+ * @ignore
1024
+ */
448
1025
  __onDestroy(): void;
449
1026
  }
450
1027
 
451
1028
  /**
452
- * 模型展示的服务
1029
+ * 主要提供了模型展示的控制能力:重置视角,边框,半透明,以及展示颜色配置
1030
+ *
1031
+ * @example
1032
+ * ```typescript
1033
+ * const modelViewerService = application.getService(ModelViewerService);
1034
+ * ```
453
1035
  */
454
1036
  export declare class ModelViewerService extends BaseService {
455
1037
  /**
456
- * 查看当前选中的模型
1038
+ * 将工具方案中,选中的模型,加载到对接 2.0 小程序中展示
1039
+ *
1040
+ * 此方法,会成Application.start方法中,默认执行
1041
+ *
457
1042
  */
458
1043
  viewSelected(): Promise<void>;
459
1044
  /**
460
- * 通过模型的ID来显示某个模型
1045
+ * 指定模型的 ID,将当前模型加载到工具方案当中
1046
+ *
461
1047
  * @param id 模型ID
462
1048
  */
463
1049
  viewModelById(id: string | string[]): Promise<void>;
464
1050
  /**
465
- * 重置视角
1051
+ * 重置视图展示视角
466
1052
  */
467
1053
  resetPerspective(): void;
468
1054
  /**
469
- * 模型渲染是都显示边框
1055
+ * 模型渲染是否显示边框
470
1056
  * @param flag
471
1057
  */
472
1058
  toggleModelBorder(flag: boolean): void;
473
1059
  /**
474
- * 模型渲染是否半透明
1060
+ * 模型渲染是否为半透明
475
1061
  * @param flag
476
1062
  */
477
1063
  toggleModelTransparent(flag: boolean): void;
478
1064
  /**
479
- * 配置场景展示界面
1065
+ * 设置交接信息展示颜色
1066
+ *
1067
+ * > `settings`,需要在application.start()后,立即被设置,否则展示会读取至之前配置信息,展示可能存在异常。
480
1068
  */
481
1069
  setting(settings: Partial<ISettingColor>): void;
482
1070
  }