@manycore/custom-sdk 1.0.1-rc.1 → 1.0.1-rc.10

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 (5) hide show
  1. package/index.css +0 -122
  2. package/index.d.ts +969 -66
  3. package/index.js +73 -90
  4. package/package.json +10 -7
  5. package/1.index.js +0 -10
package/index.d.ts CHANGED
@@ -1,40 +1,73 @@
1
+ import { ELineType as ELineType_2 } from '@manycore/custom-miniapp-sdk';
1
2
  import { IExportModelData } from '@manycore/custom-miniapp-sdk';
3
+ import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
2
4
  import { Number3 } from '@manycore/custom-miniapp-sdk';
3
5
 
6
+ /**
7
+ * 对接2.0主应用
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const application = new Application();
12
+ * ```
13
+ */
4
14
  export declare class Application {
5
15
  constructor();
16
+ private serviceMap;
6
17
  /**
7
- * 启动当前应用
18
+ * 启动对接2.0应用
19
+ *
20
+ * 当前,在启动对接2.0应用时,默认会自动把酷家乐主工具当中,选中的模型,加载至对接2.0场景当中。
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * await application.start();
25
+ * ```
8
26
  */
9
27
  start(): Promise<void>;
10
28
  /**
11
- * 初始化语言类型
29
+ * 初始化语言类型(默认不需要处理)
30
+ *
31
+ * 如果你有多语言的诉求,可能会用到此功能
32
+ *
12
33
  * @param lang
13
34
  * @param resource
14
35
  */
15
36
  initLange(lang?: string, resource?: {}): void;
37
+ /**
38
+ * 停止对接2.0应用
39
+ *
40
+ * 当停用时,会让主工具当中,更新模型最新的锁定状态。
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * await application.stop();
45
+ * ```
46
+ */
16
47
  stop(): Promise<void>;
48
+ /**
49
+ *
50
+ * 对接2.0中,获取相关的service
51
+ *
52
+ * 如果需要调用此方法,需要确保`Application`调用过`start`方法
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const s = application.getService(FittingDesignService);
57
+ * ```
58
+ *
59
+ * @param serv
60
+ */
17
61
  getService<T extends BaseService>(serv: {
18
62
  new (): T;
19
63
  }): T;
20
64
  }
21
65
 
22
- declare class BaseService {
23
- }
24
-
25
66
  /**
26
- * 配件附加参数数据类型
67
+ * @private
27
68
  */
28
- export declare enum EFittingParametersType {
29
- /**
30
- * 字符串
31
- */
32
- string = "string",
33
- double = "double",
34
- long = "long",
35
- int = "int",
36
- float2 = "float2",
37
- float3 = "float3"
69
+ declare abstract class BaseService {
70
+ __onDestroy?(): void;
38
71
  }
39
72
 
40
73
  /**
@@ -53,14 +86,32 @@ export declare enum EFittingType {
53
86
  * 五金
54
87
  */
55
88
  HARDWARE = 3,
89
+ /**
90
+ * 五金槽
91
+ */
92
+ HARDWARE_GROOVE = 4,
56
93
  /**
57
94
  * 交接面信息
58
95
  */
59
- INTERSECTED = 4
96
+ INTERSECTED = "intersected"
97
+ }
98
+
99
+ /**
100
+ * 交接信息的产生方式
101
+ */
102
+ export declare enum EIntersectedCreatedType {
103
+ /**
104
+ * 板与板之间产生的交界
105
+ */
106
+ BOTH_PLANK = 0,
107
+ /**
108
+ * 板与五金之间产生的交界信息
109
+ */
110
+ PLANK_FURNITURE = 1
60
111
  }
61
112
 
62
113
  /**
63
- * 交接面、交接体数据类型
114
+ * 交接数据的数据类型
64
115
  */
65
116
  export declare enum EIntersectedType {
66
117
  /**
@@ -73,6 +124,9 @@ export declare enum EIntersectedType {
73
124
  FACE = "2"
74
125
  }
75
126
 
127
+ /**
128
+ * 语言
129
+ */
76
130
  export declare enum ELanguage {
77
131
  ZH_CN = "zh_CN",
78
132
  EN_US = "en_US",
@@ -88,6 +142,50 @@ export declare enum ELanguage {
88
142
  VI = "vi"
89
143
  }
90
144
 
145
+ /**
146
+ * 线的类型
147
+ */
148
+ export declare enum ELineType {
149
+ /**
150
+ * 直线
151
+ */
152
+ SEGMENT = 0,
153
+ /**
154
+ * 圆弧
155
+ */
156
+ CIRCLE_ARC = 1,
157
+ /**
158
+ * 椭圆
159
+ * 当前代码中,暂不支持
160
+ */
161
+ ELLIPSE_ARC = 3
162
+ }
163
+
164
+ /**
165
+ * 点的类型
166
+ */
167
+ export declare enum EPointType {
168
+ /**
169
+ * 普通点
170
+ */
171
+ NONE = 0,
172
+ /**
173
+ * 倒圆
174
+ */
175
+ CIRCLE = 1,
176
+ /**
177
+ * 倒角
178
+ */
179
+ LINE = 2,
180
+ /**
181
+ * 切圆,就是内挖一个倒圆的形状
182
+ */
183
+ CUT_CIRCLE = 3
184
+ }
185
+
186
+ /**
187
+ * 处理选中的内容
188
+ */
91
189
  export declare enum ESelectedType {
92
190
  /**
93
191
  * 未选中模型
@@ -103,53 +201,176 @@ export declare enum ESelectedType {
103
201
  CASBIN = 2
104
202
  }
105
203
 
204
+ /**
205
+ * 设置选中内容类型
206
+ */
207
+ export declare enum ESetSelectType {
208
+ /**
209
+ * 模型或商品
210
+ */
211
+ MODEL = 1,
212
+ /**
213
+ * 五金
214
+ */
215
+ CASBIN = 2
216
+ }
217
+
218
+ /**
219
+ * 定制行业工具线
220
+ */
221
+ export declare enum EToolType {
222
+ /**
223
+ * 定制厨卫
224
+ */
225
+ CABINET = "CABINET",
226
+ /**
227
+ * 定制家居
228
+ */
229
+ WARDROBE = "WARDROBE",
230
+ /**
231
+ * 定制门窗
232
+ */
233
+ DOOR_WINDOW = "DW",
234
+ /**
235
+ * 定制厨卫副本工具线
236
+ */
237
+ CABINET_COPY = "CABINET_COPY",
238
+ /**
239
+ * 定制家居副本工具线
240
+ */
241
+ WARDROBE_COPY = "WARDROBE_COPY",
242
+ /**
243
+ * 定制门窗副本工具线
244
+ */
245
+ DOOR_WINDOW_COPY = "DW_COPY"
246
+ }
247
+
248
+ /**
249
+ * 孔槽方案相关数据的管理
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * const fittingDesignService = application.getService(FittingDesignService);
254
+ * ```
255
+ */
106
256
  export declare class FittingDesignService extends BaseService {
107
257
  /**
108
258
  * 设置孔槽方案自动保存
109
259
  *
260
+ * 当你调用`appendFittingDesign`时,如果开启自动保存,就会将当前数据与之前数据作合并,并保存至后台。如果不开启,那只会临时暂存在状态中,后续调用`saveDesign`时,才会保存至后端。
261
+ *
262
+ * @default true 自动保存
263
+ *
264
+ * @example
265
+ * ```typescript
266
+ * fittingDesignService.toggleAutoSave(false);
267
+ * ```
268
+ *
110
269
  * @param autoSave 默认开启自动保存
111
270
  */
112
271
  toggleAutoSave(autoSave?: boolean): void;
113
272
  /**
114
- * 是否开启了自动保存功能
273
+ * 获取当前是否开启了自动保存
274
+ *
275
+ * @example
276
+ * ```typescript
277
+ * fittingDesignService.isAutoSave();
278
+ * ```
115
279
  */
116
280
  isAutoSave(): boolean;
117
281
  /**
282
+ * 获取孔/槽方案数据
283
+ *
284
+ * @example
285
+ * ```typescript
286
+ * fittingDesignService.getFittingDesignData();
287
+ * ```
288
+ *
289
+ * @param modelId 方案模型的ID,当没传时,就是获取场景中,正在预览的模型ID的方案数据
290
+ */
291
+ getFittingDesignData(modelId?: string): Promise<IFittingDesignData | null>;
292
+ /**
293
+ *
294
+ * 获取某个元件关联的孔/槽方案数据(仅作用于当前正在处理的模型)
295
+ *
296
+ * @example
297
+ * ```typescript
298
+ * // 获取当前正在编辑的方案信息
299
+ * fittingDesignService.getConnectedFittingDesign();
118
300
  *
119
- * 槽方案数据
301
+ * // 获取某块板上关联的孔/槽数据
302
+ * fittingDesignService.getConnectedFittingDesign('id');
120
303
  *
121
- * @param modelid 模型ID,如果为空时,则表示传递的为查询当前模型的数据
304
+ * ```
305
+ *
306
+ * @param modelid 模型ID,如果为空时,则表示传递的为查询当前正在编辑的模型的方案数据
122
307
  * @param casbin 是否为五金,当modelid为五金的id时,需要为true
123
308
  */
124
309
  getConnectedFittingDesign(modelid?: string, casbin?: boolean): Promise<IFittingDesignData | null>;
310
+ /**
311
+ * 五金槽路径验证API(非稳定API,暂不建议使用)
312
+ *
313
+ * @param path 待验证的路径
314
+ * @param linkModelId 关联的模型ID
315
+ */
316
+ validateFittingDesign(path: IHardwareGrooveData, linkModelId: string): IFittingDesignValidateResult;
125
317
  /**
126
318
  * 往当前方案中,新增孔/槽数据
127
319
  *
128
320
  * 会自动merge数据,但同一块板上,会进行覆盖
129
321
  *
130
- * @param design
322
+ * > 如果没有开启自动保存,调用此API只影响视图展示,不会立即存储至后端。
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * await fittingDesignService.save({
327
+ * ...
328
+ * })
329
+ * ```
330
+ *
331
+ * @param design 孔/槽方案信息
131
332
  * @param option { timeout, save} 调用超时,save 是否立即保存至后端,默认为true
132
333
  */
133
334
  appendFittingDesign(design: Partial<IFittingDesignData>, option?: {
335
+ /**
336
+ * 超时时间(只有在往后端保存时,才有效)
337
+ */
134
338
  timeout?: number;
339
+ /**
340
+ * 是否强制立即保存(即覆盖是否自动保存参数)
341
+ */
135
342
  save?: boolean;
136
343
  }): Promise<void>;
137
344
  /**
138
345
  * 保存孔/槽数据至方案
139
- * 如果design不传,即表示将分步保存数据保存至后端
346
+ * 如果design不传,即表示将分步保存数据存储至后端
140
347
  *
141
- * @param design
348
+ * @example
349
+ * ```typescript
350
+ * await fittingDesignService.saveDesign({
351
+ * ...
352
+ * })
353
+ * ```
354
+ *
355
+ * @param design 需要保存的方案信息
142
356
  * @param option
143
357
  */
144
358
  saveDesign(design?: IFittingDesignData, option?: {
145
359
  timeout?: number;
146
360
  }): Promise<void>;
147
361
  /**
148
- * 清空当前孔槽方案
362
+ * 删除当前孔槽方案(解锁主工具模型)
363
+ *
364
+ * 主工具当中,模型的锁定与解锁,与当前模型是不存在孔槽方案有关
365
+ * 默认情况下,option不传时,清空当前正在编辑的模型的孔槽方案,当传入modelId时,表示清空指定模型的孔槽方案数据
149
366
  *
150
- * @param timeout
367
+ * * @example
368
+ * ```typescript
369
+ * await fittingDesignService.clearDesign();
370
+ * ```
371
+ * @param options
151
372
  */
152
- clearDesign(timeout?: number): Promise<void>;
373
+ clearDesign(options?: IBaseOptions): Promise<void>;
153
374
  }
154
375
 
155
376
  /**
@@ -157,25 +378,34 @@ export declare class FittingDesignService extends BaseService {
157
378
  */
158
379
  export declare interface IBaseFittingData {
159
380
  /**
160
- * 孔槽的id
381
+ * 开发者自己生成的孔、槽信息标识ID(自行区分)
161
382
  */
162
383
  id: string;
163
384
  /**
164
- * 类型
385
+ * 当前数据类型
165
386
  */
166
387
  fittingType: EFittingType;
167
388
  /**
168
- * 附加通用参数
389
+ * 附加通用参数,开发者可以自己存储一些数据
169
390
  */
170
- params?: EFittingParametersType[];
391
+ params?: IBaseFittingParameters[];
171
392
  }
172
393
 
173
394
  /**
174
395
  * 附加通用参数存储
175
396
  */
176
397
  export declare interface IBaseFittingParameters {
398
+ /**
399
+ * 通用参数的key
400
+ */
177
401
  key: string;
402
+ /**
403
+ * 通用参数的value
404
+ */
178
405
  value: string;
406
+ /**
407
+ * 当前value值的数据类型
408
+ */
179
409
  type: string;
180
410
  }
181
411
 
@@ -201,31 +431,57 @@ export declare class FittingDesignService extends BaseService {
201
431
  end: Number3;
202
432
  }
203
433
 
434
+ /**
435
+ * 交接信息
436
+ */
204
437
  export declare interface IBaseIntersected {
205
438
  /**
206
- * 板面
439
+ * 当前交接信息所处的板面信息
207
440
  */
208
441
  plankFaceId: number;
209
442
  /**
210
- * 所有点的信息
443
+ * 当前交接信息所有顶点的信息
444
+ * * 如果为交接面,length为4
445
+ * * 如果为交接体,length为8
211
446
  */
212
447
  points: Number3[];
213
448
  /**
214
- * 关联的模型ID
449
+ * 当前交接信息产生的元件ID
215
450
  */
216
451
  linkedModelId: string;
217
452
  /**
218
- * 关联的父级模型ID
453
+ * 交接信息产生元件的父母ID
219
454
  */
220
455
  linkedParentModelId: string;
221
456
  /**
222
- * 交接类型
457
+ * 交接数据的数据类型
223
458
  */
224
459
  '@type': EIntersectedType;
225
460
  /**
461
+ * @ignore
226
462
  * 交接体的shell数据
227
463
  */
228
464
  shell?: string;
465
+ /**
466
+ * 交接体板面是否需要开槽
467
+ * 当五金与板面产生的交接信息,为板面的部分,则为true
468
+ */
469
+ needGroove?: boolean;
470
+ }
471
+
472
+ /**
473
+ * 获取模型数据/交界面/体数据参数
474
+ */
475
+ export declare interface IBaseOptions {
476
+ /**
477
+ * 最长等待时间(以ms为单位)
478
+ * @default 500000
479
+ */
480
+ timeout?: number;
481
+ /**
482
+ * 模型ID
483
+ */
484
+ modelId?: string;
229
485
  }
230
486
 
231
487
  /**
@@ -248,6 +504,17 @@ export declare class FittingDesignService extends BaseService {
248
504
  * 五金数据
249
505
  */
250
506
  hardwares: IFittingHardwareCollect;
507
+ /**
508
+ * 五金槽数据
509
+ */
510
+ hardwareGrooves: IFittingHardwareGrooves;
511
+ }
512
+
513
+ export declare interface IFittingDesignValidateResult {
514
+ /**
515
+ * 是否验证通过
516
+ */
517
+ validated: boolean;
251
518
  }
252
519
 
253
520
  /**
@@ -260,6 +527,11 @@ export declare class FittingDesignService extends BaseService {
260
527
  */
261
528
  export declare type IFittingHardwareCollect = Record<string, IHardwareData[]>;
262
529
 
530
+ /**
531
+ * 五金槽数据
532
+ */
533
+ export declare type IFittingHardwareGrooves = Record<string, IHardwareGrooveData[]>;
534
+
263
535
  /**
264
536
  * 方案中,所有孔的数据
265
537
  */
@@ -295,6 +567,89 @@ export declare class FittingDesignService extends BaseService {
295
567
  linkedIds: string[];
296
568
  }
297
569
 
570
+ /**
571
+ * 闭合路径中的点,需要按逆时针顺序上传,否则会导致异常
572
+ */
573
+ export declare interface IHardwareGrooveData extends IBaseFittingData {
574
+ /**
575
+ * 槽的深度
576
+ */
577
+ depth: number;
578
+ /**
579
+ * 所处的板面
580
+ */
581
+ plankFaceId: number;
582
+ /**
583
+ * 闭合路径的所有点
584
+ */
585
+ points: IPointData[];
586
+ /**
587
+ * 闭合路径的所有线
588
+ */
589
+ lines: ILineData[];
590
+ }
591
+
592
+ /**
593
+ * 颜色配置信息
594
+ *
595
+ * @example
596
+ * ```json
597
+ * {
598
+ * "color": "#234432",
599
+ * "opacity": 0.8
600
+ * }
601
+ * ```
602
+ */
603
+ export declare interface IHintBase {
604
+ /**
605
+ * 颜色,以#开头,16进制
606
+ *
607
+ * @example
608
+ * ```
609
+ * #FFB6C1
610
+ * ```
611
+ */
612
+ color: string;
613
+ /**
614
+ * 透明度,范围为 0~1 ;当为1时,表示不透明;为0时,表示为全透明
615
+ */
616
+ opacity: number;
617
+ }
618
+
619
+ /**
620
+ * 配置默认的高亮配置信息
621
+ */
622
+ export declare interface IHintPlank {
623
+ /**
624
+ * 边框高亮颜色
625
+ */
626
+ hintOutline?: boolean | IHintBase;
627
+ /**
628
+ * 高亮的板面信息
629
+ */
630
+ hintPlankFace?: Array<IHintPlankFace | Omit<IHintPlankFace, keyof IHintBase>>;
631
+ }
632
+
633
+ /**
634
+ * 板面配置信息
635
+ *
636
+ * @example
637
+ * ```json
638
+ * {
639
+ * "color": "#234432",
640
+ * "opacity": 0.8,
641
+ * "plankFaceId": 1
642
+ * }
643
+ * ```
644
+ */
645
+ export declare interface IHintPlankFace extends IHintBase {
646
+ /**
647
+ * 需要展示的该信息的板面
648
+ * 支持多个板面ID或单个
649
+ */
650
+ plankFaceId: number | number[];
651
+ }
652
+
298
653
  export declare interface IHoleData extends IBaseHoleGrooveData {
299
654
  /**
300
655
  * 孔直径
@@ -302,27 +657,145 @@ export declare class FittingDesignService extends BaseService {
302
657
  diameter: number;
303
658
  }
304
659
 
660
+ /**
661
+ * 一组交接信息
662
+ */
305
663
  export declare interface IIntersectedGroup {
306
664
  /**
307
- * 交接面ID
665
+ * 交接信息的唯一标识ID
308
666
  */
309
667
  id: string;
310
668
  /**
311
- * 交接面信息
669
+ * 交接信息的产生来源
670
+ */
671
+ intersectType: EIntersectedCreatedType;
672
+ /**
673
+ * 关联元素产生的多组交接信息
312
674
  */
313
675
  intersecteds: IBaseIntersected[];
314
676
  }
315
677
 
316
678
  /**
317
- * 交接面信息
679
+ * 交接信息
318
680
  */
319
681
  export declare interface IIntersectedResult {
682
+ /**
683
+ * 交接信息集合
684
+ */
320
685
  intersectedGroups: IIntersectedGroup[];
321
686
  }
322
687
 
688
+ export declare type ILineData = ILineDataBase | ILineDataCircle;
689
+
690
+ export declare interface ILineDataBase {
691
+ /**
692
+ * 线条类型
693
+ */
694
+ type: ELineType_2.SEGMENT;
695
+ }
696
+
697
+ export declare interface ILineDataCircle {
698
+ /**
699
+ * 线条类型
700
+ */
701
+ type: ELineType_2.CIRCLE_ARC;
702
+ /**
703
+ * 是否顺时针
704
+ */
705
+ clockwise: boolean;
706
+ /**
707
+ * 优弧劣弧 (只有弧线有)
708
+ */
709
+ minorArc: boolean;
710
+ /**
711
+ * 半径 (只有弧线有)
712
+ */
713
+ radius: number;
714
+ }
715
+
716
+ /**
717
+ * 模型高亮默认配置信息
718
+ * @example
719
+ * ```json
720
+ * {
721
+ * "outline": {
722
+ * "color": "#234432",
723
+ * "opacity": 0.8,
724
+ * },
725
+ * "plankFace":{
726
+ * "color": "#234432",
727
+ * "opacity": 0.8,
728
+ * }
729
+ * }
730
+ * ```
731
+ */
732
+ export declare interface IModelDefaultHintOption {
733
+ /**
734
+ * 模型轮廓高亮信息
735
+ */
736
+ outline?: IHintBase;
737
+ /**
738
+ * 板面高亮配置信息
739
+ */
740
+ plankFace?: IHintBase;
741
+ }
742
+
743
+ /**
744
+ * 设置模型高亮时的配置信息
745
+ * @example
746
+ * ```typescript
747
+ * {
748
+ * "89D2793C-2B23-41A9-BA6E-4E3908490057": {
749
+ * // 使用默认的高亮配置信息
750
+ * "hintBorder": true,
751
+ * // 板件高亮
752
+ * "hintPlankFace": [
753
+ * {
754
+ * "color": "#234432",
755
+ * "opacity": 0.8,
756
+ * // 仅单个板面
757
+ * "plankFaceId": 1
758
+ * },
759
+ * {
760
+ * "color": "#233242",
761
+ * "opacity": 0.8,
762
+ * // 多个板面
763
+ * "plankFaceId": [2, 4]
764
+ * },
765
+ * // 使用默认颜色
766
+ * {
767
+ * "plankFaceId": 3
768
+ * }
769
+ * ]
770
+ * },
771
+ * "89D2793C-2B23-41A9-BA6E-4E3FS8490057": {
772
+ * // 自定议高亮配置信息
773
+ * "hintBorder": {
774
+ * "color": "#234432",
775
+ * "opacity": 0.8
776
+ * }
777
+ * }
778
+ * }
779
+ * ```
780
+ */
781
+ export declare type IModelHintOption = Record<string, IHintPlank>;
782
+
783
+ /**
784
+ * 获取交接信息
785
+ *
786
+ * @example
787
+ * ```typescript
788
+ * const intersectedService = application.getService(IntersectedService);
789
+ * ```
790
+ */
323
791
  export declare class IntersectedService extends BaseService {
324
792
  /**
325
- * 是否显示交接面信息
793
+ * 是否展示交接信息
794
+ *
795
+ * @example
796
+ * ```typescript
797
+ * intersectedService.toggleModelViewIntersected(true);
798
+ * ```
326
799
  *
327
800
  * @param flag
328
801
  */
@@ -330,24 +803,157 @@ export declare class FittingDesignService extends BaseService {
330
803
  /**
331
804
  * 切换展示的交接面、交接体坐标
332
805
  *
806
+ * @example
807
+ * ```typescript
808
+ * intersectedService.toggleModelViewedIntersected({
809
+ * references: true,
810
+ * plankFaceIds: [1],
811
+ * });
812
+ * ```
813
+ *
333
814
  * @param option
334
815
  */
335
816
  toggleModelViewedIntersected(option?: IToggleIntersectedViewOption): void;
336
817
  }
337
818
 
338
- export declare interface IPoint3d {
339
- x: number;
340
- y: number;
341
- z: number;
819
+ export { IParamModelPhotoResponse }
820
+
821
+ /**
822
+ * 点的基本类型
823
+ */
824
+ export declare interface IPointBase {
825
+ type: EPointType;
826
+ /**
827
+ * 点的位置
828
+ *
829
+ * @example
830
+ * "123,-345"
831
+ */
832
+ position: Number3;
833
+ }
834
+
835
+ /**
836
+ * 点的类型参数
837
+ */
838
+ export declare type IPointData = IPointWithNone | IPointWithLine | IPointWithCircle | IPointWithCutCircle;
839
+
840
+ /**
841
+ * 倒圆
842
+ */
843
+ export declare interface IPointWithCircle extends IPointBase {
844
+ /**
845
+ * 切角类型
846
+ */
847
+ type: EPointType.CIRCLE;
848
+ /**
849
+ * 切角边边距
850
+ */
851
+ /**
852
+ * 半径 (倒圆切圆专用)
853
+ * @example
854
+ * "345.12"
855
+ */
856
+ radius: number;
857
+ }
858
+
859
+ /**
860
+ * 切圆(就是内挖一个倒圆的形状)
861
+ */
862
+ export declare interface IPointWithCutCircle extends Omit<IPointWithCircle, 'type'> {
863
+ type: EPointType.CUT_CIRCLE;
864
+ /**
865
+ * 是否顺时针
866
+ * 未设置时,则为false
867
+ */
868
+ clockwise: boolean;
869
+ }
870
+
871
+ /**
872
+ * 切角
873
+ */
874
+ export declare interface IPointWithLine extends IPointBase {
875
+ /**
876
+ * 切角类型
877
+ */
878
+ type: EPointType.LINE;
879
+ /**
880
+ * 切角边边距
881
+ */
882
+ cornerCutDistance: [number, number];
883
+ }
884
+
885
+ /**
886
+ * 普通点类型
887
+ */
888
+ export declare interface IPointWithNone extends IPointBase {
889
+ /**
890
+ * 普通点
891
+ */
892
+ type: EPointType.NONE;
893
+ /**
894
+ * 是否顺时针
895
+ * 未设置时,则为false
896
+ */
897
+ clockwise?: boolean;
898
+ }
899
+
900
+ /**
901
+ * 房间信息
902
+ */
903
+ declare interface IRoomInfo {
904
+ /**
905
+ * 所属房间ID
906
+ */
907
+ roomId?: string;
908
+ /**
909
+ * 所属房间名
910
+ */
911
+ roomName?: string;
342
912
  }
343
913
 
914
+ /**
915
+ * 当前选中的数据
916
+ */
344
917
  export declare interface ISelected {
918
+ /**
919
+ * 选中的数据内容
920
+ */
345
921
  data: IExportModelData[] | IHardwareData[];
922
+ /**
923
+ * 选中的数据类型
924
+ */
346
925
  type: ESelectedType;
347
926
  }
348
927
 
349
928
  /**
350
- * 处理场景当中
929
+ * 通过ID选中模型参数
930
+ */
931
+ export declare interface ISetSelectedByIdOption {
932
+ /**
933
+ * 模型ID/五金ID
934
+ */
935
+ id: string;
936
+ /**
937
+ * 选中的类型
938
+ */
939
+ type: ESetSelectType;
940
+ }
941
+
942
+ /**
943
+ * 场景中,模型的颜色配置能力
944
+ *
945
+ * @example
946
+ * ```json
947
+ * {
948
+ * // 交接页数据信息
949
+ * intersectedColor: 0xff4500,
950
+ * // 交接体颜色
951
+ * intersectedBodyColor: 0xff00ff,
952
+ * holeColor: 0x00ff00,
953
+ * grooveColor: 0x1e90ff,
954
+ * }
955
+ * ```
956
+ *
351
957
  */
352
958
  export declare interface ISettingColor {
353
959
  /**
@@ -358,6 +964,14 @@ export declare class FittingDesignService extends BaseService {
358
964
  * 交接体展示时,使用的颜色
359
965
  */
360
966
  intersectedBodyColor: number;
967
+ /**
968
+ * 五金与柜体之间,交接面产生的颜色
969
+ */
970
+ grooveIntersectedColor: number;
971
+ /**
972
+ * 五金与柜体之间,交接体产生的颜色
973
+ */
974
+ grooveIntersectedBodyColor: number;
361
975
  /**
362
976
  * 孔展示
363
977
  */
@@ -368,80 +982,369 @@ export declare class FittingDesignService extends BaseService {
368
982
  grooveColor: number;
369
983
  }
370
984
 
985
+ /**
986
+ * 展示交接信息时的筛选行为
987
+ */
371
988
  export declare interface IToggleIntersectedViewOption {
372
989
  /**
373
- * 是否展示
374
- * 默认为false
990
+ * 切换展示交接信息数据
991
+ *
992
+ * * `true` 显示第一组交接数据
993
+ * * `false`: 显示第二组交接数据
994
+ *
995
+ * @default false
375
996
  */
376
997
  references?: boolean;
377
- plankFaceIds?: number[];
998
+ /**
999
+ * 根据板面信息来筛选展示内容,null 表示空板面
1000
+ */
1001
+ plankFaceIds?: Array<number | null>;
378
1002
  }
379
1003
 
1004
+ /**
1005
+ * 获取顶层模型返回值
1006
+ */
1007
+ export declare interface ITopParamModelDataResponse {
1008
+ /**
1009
+ * 当前查询总数
1010
+ */
1011
+ count: number;
1012
+ /**
1013
+ * 当前页码
1014
+ */
1015
+ currPage: number;
1016
+ /**
1017
+ * 是否还有可查询的结果
1018
+ */
1019
+ hasMore: boolean;
1020
+ /**
1021
+ * 查询的顶层模型结果
1022
+ */
1023
+ result: ITopParamModelList[];
1024
+ /**
1025
+ * 总的页数
1026
+ */
1027
+ totalPage: number;
1028
+ }
1029
+
1030
+ /**
1031
+ * 顶层模型信息
1032
+ */
1033
+ export declare interface ITopParamModelList {
1034
+ /**
1035
+ * 模型ID
1036
+ */
1037
+ id: string;
1038
+ /**
1039
+ * 所属工具线
1040
+ */
1041
+ toolType: EToolType;
1042
+ /**
1043
+ * 模型名称
1044
+ */
1045
+ name: string;
1046
+ /**
1047
+ * 户型信息
1048
+ */
1049
+ roomInfo: IRoomInfo;
1050
+ /**
1051
+ * 模型是否已拆单
1052
+ */
1053
+ isSplit: boolean;
1054
+ /**
1055
+ * 模型是否锁定
1056
+ */
1057
+ isLocked: boolean;
1058
+ /**
1059
+ * 模型是否隐藏
1060
+ */
1061
+ isHidden: boolean;
1062
+ /**
1063
+ * 模型是否提审
1064
+ */
1065
+ isAudited: boolean;
1066
+ }
1067
+
1068
+ /**
1069
+ * 获取顶层模型参数
1070
+ */
1071
+ export declare interface ITopParamModelListOption {
1072
+ /**
1073
+ * 第几页
1074
+ * page 默认为 1
1075
+ */
1076
+ pageSize?: number;
1077
+ /**
1078
+ * 每页模型数量
1079
+ * size 默认为 20
1080
+ * 最大值为 500
1081
+ */
1082
+ pageNum?: number;
1083
+ }
1084
+
1085
+ /**
1086
+ * 配置板件特殊标识
1087
+ *
1088
+ * @example
1089
+ * ```typescript
1090
+ * const modelHintService = application.getService(ModelHintService);
1091
+ * ```
1092
+ */
1093
+ export declare class ModelHintService extends BaseService {
1094
+ /**
1095
+ * 设置板件标识的特殊颜色
1096
+ * @example
1097
+ * modelHintService.setDefaultHint({
1098
+ * "outline": {
1099
+ * "color": "#234432",
1100
+ * "opacity": 0.8,
1101
+ * },
1102
+ * "plankFace":{
1103
+ * "color": "#234432",
1104
+ * "opacity": 0.8,
1105
+ * }
1106
+ * });
1107
+ */
1108
+ setDefaultHint(option: IModelDefaultHintOption): void;
1109
+ /**
1110
+ * 设置模型高亮
1111
+ *
1112
+ * @example
1113
+ * ```typescript
1114
+ * modelHintService.setModelHint({
1115
+ * "89D2793C-2B23-41A9-BA6E-4E3908490057": {
1116
+ * // 使用默认的标识信息
1117
+ * "hintBorder": true,
1118
+ * // 板件高亮
1119
+ * "hintPlankFace": [
1120
+ * {
1121
+ * "color": "#234432",
1122
+ * "opacity": 0.8,
1123
+ * // 仅单个板面
1124
+ * "plankFaceId": 1
1125
+ * },
1126
+ * {
1127
+ * "color": "#233242",
1128
+ * "opacity": 0.8,
1129
+ * // 多个板面
1130
+ * "plankFaceId": [2, 4]
1131
+ * },
1132
+ * // 使用默认颜色配置
1133
+ * {
1134
+ * "plankFaceId": 1
1135
+ * },
1136
+ * ]
1137
+ * },
1138
+ * "89D2793C-2B23-41A9-BA6E-4E3FS8490057": {
1139
+ * // 自定议标识颜色
1140
+ * "hintBorder": {
1141
+ * "color": "#234432",
1142
+ * "opacity": 0.8
1143
+ * }
1144
+ * }
1145
+ * })
1146
+ * ```
1147
+ */
1148
+ setModelHint(config: IModelHintOption): void;
1149
+ /**
1150
+ * 清空当前已经配置的标识信息
1151
+ *
1152
+ * 当id不传时,清空所有,当id传入部分时,则清除对应的内容
1153
+ *
1154
+ * @example
1155
+ * ```typescript
1156
+ * modelHintService.clearModelHint()
1157
+ * ```
1158
+ *
1159
+ * @param id 待删除标识信息的ID
1160
+ */
1161
+ clearModelHint(id?: string[]): void;
1162
+ }
1163
+
1164
+ /**
1165
+ * 主要提供了获取当前模型的 JSON 输出数据,以及当前模型的交接信息的功能。
1166
+ *
1167
+ * @example
1168
+ * ```typescript
1169
+ * const modelService = application.getService(ModelService);
1170
+ * ```
1171
+ */
380
1172
  export declare class ModelService extends BaseService {
381
1173
  /**
382
- * 获取当前整个模型数据信息
1174
+ * 开发者,通常需要来获取某个模型的 JSON 数据,所以需要用此 API。当前 API 获取 JSON 数据,主要是拿的是当前正在编辑的模型的 JSON 数据。
1175
+ * 如果传入modelId,则表示获取其他模型的JSON输出数据。
1176
+ *
1177
+ * 底层其实是通过`servkit`服务实现的。使用的是`MiniAppParamModelJsonDataService`服务。
383
1178
  *
384
- * @param timeout
1179
+ * 使用servkit实现示例如下:
1180
+ *
1181
+ * @example
1182
+ * ```typescript
1183
+ * import { MiniAppParamModelJsonDataService } from '@manycore/custom-miniapp-sdk';
1184
+ * import { sappSDK } from 'servkit';
1185
+ *
1186
+ * const service = sappSDK.getServiceUnsafe(MiniAppParamModelJsonDataService);
1187
+ *
1188
+ * const json = await service.getModelJsonDataByModelId('请输入模型ID');
1189
+ * ```
1190
+ *
1191
+ * > 以上 API 暂不建议在非对接 2.0 环境下使用,主要是与孔/槽方案数据存在关联关系。
1192
+ > > 替代的 service 为`CustomDesignExportService`,将会在 9 月底最新的`@manycore/custom-miniapp-sdk`中提供。
1193
+ *
1194
+ * @example
1195
+ * ```typescript
1196
+ * await modelService.getParamData();
1197
+ * ```
1198
+ *
1199
+ * @param options
385
1200
  */
386
- getParamData(timeout?: number): Promise<any>;
1201
+ getParamData(options?: IBaseOptions): Promise<any>;
387
1202
  /**
388
- * 获取交接面信息
1203
+ * 获取模型的交接数据
389
1204
  *
390
- * @param timeout
1205
+ * @example
1206
+ * ```typescript
1207
+ * await modelService.getParamData();
1208
+ * ```
1209
+ *
1210
+ * @param options
1211
+ */
1212
+ getParamIntersected(options?: IBaseOptions): Promise<IIntersectedResult>;
1213
+ /**
1214
+ * 获取方案顶层模型列表
1215
+ * @param options
391
1216
  */
392
- getParamIntersected(timeout?: number): Promise<IIntersectedResult>;
1217
+ getTopParamModels(options?: ITopParamModelListOption): Promise<ITopParamModelDataResponse>;
1218
+ /**
1219
+ * 获取模型缩略图信息
1220
+ * @param modelId
1221
+ * @returns 模型缩略图信息
1222
+ */
1223
+ getParamModelPhotoById(modelId: string | string[]): Promise<IParamModelPhotoResponse[]>;
393
1224
  }
394
1225
 
1226
+ /**
1227
+ * 主要是用来与场景交互的,监听当前选中的对象, 获取选中的内容
1228
+ *
1229
+ * @example
1230
+ * ```typescript
1231
+ * const viewerSelectionService = application.getService(ModelViewerSelectionService);
1232
+ * ```
1233
+ */
395
1234
  export declare class ModelViewerSelectionService extends BaseService {
396
1235
  constructor();
397
1236
  /**
398
- * 获取当前选中模型
1237
+ * 获取当前选中的数据
399
1238
  */
400
1239
  getSelected(): ISelected;
401
1240
  /**
402
- * 设置当前选中内容
1241
+ * 设置选中的模型
1242
+ * 同时选中多个模型暂未支持,请勿使用
1243
+ * @param option ISetSelectedByIdOption
1244
+ * @example
1245
+ * ```
1246
+ * const viewerSelectionService = application.getService(ModelViewerSelectionService);
1247
+ * const selectOption = {
1248
+ * id: 'modelId...',
1249
+ * type: ESetSelectType.MODEL,
1250
+ * };
1251
+ *
1252
+ * viewerSelectionService.select(selectOption);
1253
+ * ```
1254
+ */
1255
+ select(option: ISetSelectedByIdOption | ISetSelectedByIdOption[]): void;
1256
+ /**
1257
+ * 取消场景当中选中内容
1258
+ * 同时取消多个模型暂未支持,请勿使用
1259
+ * @param option
1260
+ * @example
1261
+ * ```
1262
+ * const viewerSelectionService = application.getService(ModelViewerSelectionService);
1263
+ * const selectOption = {
1264
+ * id: 'modelId...',
1265
+ * type: ESetSelectType.MODEL,
1266
+ * };
1267
+ *
1268
+ * // 取消指定选中模型
1269
+ * viewerSelectionService.unSelect(selectOption);
1270
+ * // 默认取消全部选中模型
1271
+ * viewerSelectionService.unSelect();
1272
+ * ```
1273
+ */
1274
+ unSelect(option?: ISetSelectedByIdOption | ISetSelectedByIdOption[]): void;
1275
+ /**
1276
+ * 根据参数生成entity
1277
+ * @param option
1278
+ * @returns entity
1279
+ * @private
1280
+ * @ignore
403
1281
  */
404
- select(selected: any[]): void;
1282
+ private __generateEntity;
405
1283
  /**
406
- * 取消选中所有内容
1284
+ * @ignore
407
1285
  */
408
- unSelect(): void;
409
1286
  private onSelectedChanged;
1287
+ /**
1288
+ * 监听当前选中内容
1289
+ * @param fn
1290
+ */
410
1291
  on(fn: (param: ISelected) => any): void;
1292
+ /**
1293
+ * 取消监听选中变化
1294
+ * @param fn
1295
+ */
411
1296
  off(fn?: (param: ISelected) => any): void;
1297
+ /**
1298
+ * 监听当前选中的内容(触发一次后自动取消)
1299
+ * @param fn
1300
+ */
412
1301
  once(fn: (param: ISelected) => any): void;
1302
+ /**
1303
+ * @ignore
1304
+ */
413
1305
  __onDestroy(): void;
414
1306
  }
415
1307
 
416
1308
  /**
417
- * 模型展示的服务
1309
+ * 主要提供了模型展示的控制能力:重置视角,边框,半透明,以及展示颜色配置
1310
+ *
1311
+ * @example
1312
+ * ```typescript
1313
+ * const modelViewerService = application.getService(ModelViewerService);
1314
+ * ```
418
1315
  */
419
1316
  export declare class ModelViewerService extends BaseService {
420
1317
  /**
421
- * 查看当前选中的模型
1318
+ * 将工具方案中,选中的模型,加载到对接 2.0 小程序中展示
1319
+ *
1320
+ * 此方法,会成Application.start方法中,默认执行
1321
+ *
422
1322
  */
423
1323
  viewSelected(): Promise<void>;
424
1324
  /**
425
- * 通过模型的ID来显示某个模型
1325
+ * 指定模型的 ID,将当前模型加载到工具方案当中
1326
+ *
426
1327
  * @param id 模型ID
427
1328
  */
428
1329
  viewModelById(id: string | string[]): Promise<void>;
429
1330
  /**
430
- * 重置视角
1331
+ * 重置视图展示视角
431
1332
  */
432
1333
  resetPerspective(): void;
433
1334
  /**
434
- * 模型渲染是都显示边框
1335
+ * 模型渲染是否显示边框
435
1336
  * @param flag
436
1337
  */
437
1338
  toggleModelBorder(flag: boolean): void;
438
1339
  /**
439
- * 模型渲染是否半透明
1340
+ * 模型渲染是否为半透明
440
1341
  * @param flag
441
1342
  */
442
1343
  toggleModelTransparent(flag: boolean): void;
443
1344
  /**
444
- * 配置场景展示界面
1345
+ * 设置交接信息展示颜色
1346
+ *
1347
+ * > `settings`,需要在application.start()后,立即被设置,否则展示会读取至之前配置信息,展示可能存在异常。
445
1348
  */
446
1349
  setting(settings: Partial<ISettingColor>): void;
447
1350
  }