@manycore/custom-sdk 3.0.0-beta.0 → 3.0.0

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 (3) hide show
  1. package/index.d.ts +871 -32
  2. package/index.js +54 -25
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
2
2
  import { IServClientService } from 'servkit';
3
3
  import { Number2 as Number2_2 } from '@manycore/custom-miniapp-sdk';
4
4
  import { ServService } from 'servkit';
5
- import { ServServiceMeta } from 'servkit';
6
5
 
7
6
  /**
8
7
  * 小程序发射器
@@ -16,7 +15,7 @@ export declare class AppBooter {
16
15
  private readonly proxyTerminals;
17
16
  private getCustomMiniAppService;
18
17
  constructor(option?: IApplicationStartOption);
19
- initializeServer: (option?: ITerminalConfig | undefined) => Promise<ServServiceMeta[]>;
18
+ private initializeServer;
20
19
  /**
21
20
  * 启动的小程序地址
22
21
  * @param openParam.url 打开的小程序地址
@@ -168,6 +167,11 @@ export declare class Application {
168
167
  };
169
168
  }
170
169
 
170
+ /**
171
+ * @vm-type UnknownType
172
+ */
173
+ declare type AugmentedRequired<T extends object, K extends keyof T = keyof T> = Omit<T, K> & Required<Pick<T, K>>;
174
+
171
175
  /**
172
176
  * @private
173
177
  */
@@ -175,6 +179,17 @@ declare abstract class BaseService {
175
179
  __onDestroy?(): void;
176
180
  }
177
181
 
182
+ export declare enum CameraType {
183
+ /**
184
+ * 透视相机
185
+ */
186
+ Perspective = 0,
187
+ /**
188
+ * 正交相机
189
+ */
190
+ Orthographic = 1,
191
+ }
192
+
178
193
  /**
179
194
  * 定制模型真分类过滤列表默认值
180
195
  */
@@ -231,7 +246,77 @@ export declare class CustomModelService extends BaseService {
231
246
  }
232
247
 
233
248
  /**
234
- * 自定议字段枚举类型
249
+ * 槽应用类型
250
+ */
251
+ export declare enum EAppliedGrooveType {
252
+ /**
253
+ * 板件槽
254
+ */
255
+ PLANK = "PLANK",
256
+ /**
257
+ * 五金槽
258
+ */
259
+ FITTING = "FITTING",
260
+ /**
261
+ * 辅助槽
262
+ */
263
+ AUXILIARY = "AUXILIARY",
264
+ /**
265
+ * 拉米诺槽
266
+ */
267
+ LAMELLO = "LAMELLO",
268
+ /**
269
+ * 乐扣槽
270
+ */
271
+ LOCK = "LOCK",
272
+ /**
273
+ * 边型槽
274
+ */
275
+ EDGE = "EDGE",
276
+ /**
277
+ * 隐形件槽
278
+ */
279
+ INVISIBLE = "INVISIBLE",
280
+ /**
281
+ * 阵列槽
282
+ */
283
+ ARRAY = "ARRAY"
284
+ }
285
+
286
+ /**
287
+ * 孔的应用类型
288
+ */
289
+ export declare enum EAppliedHoleType {
290
+ /**
291
+ * 板件孔
292
+ */
293
+ PLANK = "PLANK",
294
+ /**
295
+ * 五金孔
296
+ */
297
+ FITTING = "FITTING",
298
+ /**
299
+ * 辅助孔
300
+ */
301
+ AUXILIARY = "AUXILIARY"
302
+ }
303
+
304
+ /**
305
+ * 线段类型
306
+ */
307
+ export declare enum EBomCurveType {
308
+ /**
309
+ * 线段
310
+ */
311
+ LineSeg = "LineSeg",
312
+ /**
313
+ * 弧线
314
+ */
315
+ Arc = "Arc"
316
+ }
317
+
318
+ /**
319
+ * 自定义字段枚举类型
235
320
  */
236
321
 
237
322
  declare enum EBzPropertyType {
@@ -363,6 +448,26 @@ export declare enum EElementType {
363
448
  * 五金槽
364
449
  */
365
450
  HARDWARE_GROOVE = 'hardwareGroove',
451
+ /**
452
+ * 孔V2
453
+ */
454
+ HOLE_V2 = 'holeV2',
455
+ /**
456
+ * 方槽
457
+ */
458
+ SQUARE_GROOVE = 'squareGroove',
459
+ /**
460
+ * 圆角方槽
461
+ */
462
+ ROUND_CORNER_GROOVE = 'roundCornerGroove',
463
+ /**
464
+ * 异形槽
465
+ */
466
+ SPECIAL_SHAPED_GROOVE = 'specialShapedGroove',
467
+ /**
468
+ * 路径槽
469
+ */
470
+ PATH_GROOVE = 'pathGroove',
366
471
  }
367
472
 
368
473
  /**
@@ -388,7 +493,65 @@ export declare enum EFittingType {
388
493
  /**
389
494
  * 交接面信息
390
495
  */
391
- INTERSECTED = "intersected"
496
+ INTERSECTED = "intersected",
497
+ /**
498
+ * 孔V2
499
+ */
500
+ HOLE_V2 = "holeV2",
501
+ /**
502
+ * 方槽
503
+ */
504
+ SQUARE_GROOVE = "squareGroove",
505
+ /**
506
+ * 圆角方槽
507
+ */
508
+ ROUND_CORNER_GROOVE = "roundCornerGroove",
509
+ /**
510
+ * 异形槽
511
+ */
512
+ SPECIAL_SHAPED_GROOVE = "specialShapedGroove",
513
+ /**
514
+ * 路径槽
515
+ */
516
+ PATH_GROOVE = "pathGroove"
517
+ }
518
+
519
+ /**
520
+ * 槽几何类型
521
+ */
522
+ export declare enum EGrooveGeometryType {
523
+ /**
524
+ * 方槽
525
+ */
526
+ SQUARE = "SQUARE",
527
+ /**
528
+ * 圆角方槽
529
+ */
530
+ ROUND_CORNER = "ROUND_CORNER",
531
+ /**
532
+ * 路径槽
533
+ */
534
+ PATH = "PATH",
535
+ /**
536
+ * 异形槽
537
+ */
538
+ SPECIAL_SHAPED = "SPECIAL_SHAPED"
539
+ }
540
+
541
+ /**
542
+ * 五金版本
543
+ * 主要为了区分五金类别
544
+ * 避免两者在API侧互相影响
545
+ */
546
+ export declare enum EHardwareVersion {
547
+ /**
548
+ * 孔槽方案v1添加的接口
549
+ */
550
+ V1 = 'v1',
551
+ /**
552
+ * 孔槽v2添加的接口—— 临时孔槽写入
553
+ */
554
+ V2 = 'v2',
392
555
  }
393
556
 
394
557
  /**
@@ -500,7 +663,15 @@ declare enum ElementType {
500
663
  /** 门窗副本 */
501
664
  DoorWindowCopy = "DoorWindowCopy",
502
665
  /** 定制组合 */
503
- CustomGroup = "CustomGroup"
666
+ CustomGroup = "CustomGroup",
667
+ /** 厨卫引用模型 */
668
+ CabinetRef = "CabinetRef",
669
+ /** 厨卫副本引用模型 */
670
+ CabinetCopyRef = "CabinetCopyRef",
671
+ /** 全屋引用模型 */
672
+ WardrobeRef = "WardrobeRef",
673
+ /** 全屋副本引用模型 */
674
+ WardrobeCopyRef = "WardrobeCopyRef"
504
675
  }
505
676
 
506
677
  /**
@@ -701,6 +872,50 @@ declare enum EParamUnitType {
701
872
  NUMBER = 3
702
873
  }
703
874
 
875
+ /**
876
+ * 线的类型
877
+ */
878
+ declare enum EPlankPathLineType {
879
+ /**
880
+ * 直线
881
+ */
882
+ SEGMENT = 0,
883
+ /**
884
+ * 圆弧
885
+ */
886
+ CIRCLE_ARC = 1,
887
+ /**
888
+ * 圆
889
+ */
890
+ CIRCLE_CENTER = 4
891
+ }
892
+
893
+ /**
894
+ * 点的类型
895
+ */
896
+ declare enum EPlankPathPointType {
897
+ /**
898
+ * 普通点
899
+ */
900
+ NONE = 0,
901
+ /**
902
+ * 倒圆
903
+ */
904
+ CIRCLE = 1,
905
+ /**
906
+ * 倒角
907
+ */
908
+ LINE = 2,
909
+ /**
910
+ * 切圆,就是内挖一个倒圆的形状
911
+ */
912
+ CUT_CIRCLE = 3,
913
+ /**
914
+ * 圆心点
915
+ */
916
+ CIRCLE_CENTER = 5
917
+ }
918
+
704
919
  /**
705
920
  * 板件轮廓路径类型
706
921
  */
@@ -814,6 +1029,16 @@ export declare enum ETriggerType {
814
1029
  DB_CLICK = 'double_click',
815
1030
  }
816
1031
 
1032
+ /** @ignore */
1033
+ export declare enum Face {
1034
+ Bottom = 'bottom',
1035
+ Front = 'front',
1036
+ Left = 'left',
1037
+ Right = 'right',
1038
+ Back = 'back',
1039
+ Top = 'top',
1040
+ }
1041
+
817
1042
  /**
818
1043
  * 附加通用参数-几何体颜色key
819
1044
  * @default 孔:0x00ff00 槽:0x1e90ff 五金槽:0x1e90ff
@@ -828,7 +1053,7 @@ export declare const FITTING_PARAM_GEOMETRY_OPACITY_KEY = '$$geometry_opacity';
828
1053
 
829
1054
  /**
830
1055
  * 孔槽方案相关数据的管理
831
- *
1056
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线,请尽快使用`IDP.Custom.FittingDesignV2` 以及 `FittingViewerService`代替,解锁更丰富的孔槽类型
832
1057
  * @example
833
1058
  * ```typescript
834
1059
  * const fittingDesignService = application.getService(FittingDesignService);
@@ -848,6 +1073,7 @@ export declare class FittingDesignService extends BaseService {
848
1073
  * ```
849
1074
  *
850
1075
  * @param autoSave 默认开启自动保存
1076
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线
851
1077
  */
852
1078
  toggleAutoSave(autoSave?: boolean): void;
853
1079
  /**
@@ -857,6 +1083,7 @@ export declare class FittingDesignService extends BaseService {
857
1083
  * ```typescript
858
1084
  * fittingDesignService.isAutoSave();
859
1085
  * ```
1086
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线
860
1087
  */
861
1088
  isAutoSave(): boolean;
862
1089
  /**
@@ -868,6 +1095,7 @@ export declare class FittingDesignService extends BaseService {
868
1095
  * ```
869
1096
  *
870
1097
  * @param modelId 方案模型的ID,当没传时,就是获取场景中,正在预览的模型ID的方案数据
1098
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线, 请尽快使用`IDP.Custom.FittingDesignV2.findDesignDataAsync`代替
871
1099
  */
872
1100
  getFittingDesignData(modelId?: string): Promise<IFittingDesignData | null>;
873
1101
  /**
@@ -886,6 +1114,7 @@ export declare class FittingDesignService extends BaseService {
886
1114
  *
887
1115
  * @param modelid 模型ID,如果为空时,则表示传递的为查询当前正在编辑的模型的方案数据
888
1116
  * @param casbin 是否为五金,当modelid为五金的id时,需要为true
1117
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线, 请尽快使用`FittingViewerService.getFitting` 和 `FittingViewerService.getHardware`代替
889
1118
  */
890
1119
  getConnectedFittingDesign(modelid?: string, casbin?: boolean): Promise<IFittingDesignData | null>;
891
1120
  /**
@@ -893,6 +1122,7 @@ export declare class FittingDesignService extends BaseService {
893
1122
  *
894
1123
  * @param path 待验证的路径
895
1124
  * @param linkModelId 关联的模型ID
1125
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线
896
1126
  */
897
1127
  validateFittingDesign(path: IHardwareGrooveData, linkModelId: string): IFittingDesignValidateResult;
898
1128
  /**
@@ -911,6 +1141,7 @@ export declare class FittingDesignService extends BaseService {
911
1141
  *
912
1142
  * @param design 孔/槽方案信息
913
1143
  * @param option { timeout, save} 调用超时,save 是否立即保存至后端,默认为true
1144
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线, 请尽快使用`FittingViewerService.addFitting` 和 `FittingViewerService.addHardware`代替
914
1145
  */
915
1146
  appendFittingDesign(design: Partial<IFittingDesignData>, option?: {
916
1147
  /**
@@ -938,6 +1169,7 @@ export declare class FittingDesignService extends BaseService {
938
1169
  *
939
1170
  * @param design 需要保存的方案信息
940
1171
  * @param option
1172
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线, 请尽快使用 `IDP.Custom.FittingDesignV2.saveDesignDataAsync`代替
941
1173
  */
942
1174
  saveDesign(design?: IFittingDesignData, option?: {
943
1175
  timeout?: number;
@@ -953,6 +1185,7 @@ export declare class FittingDesignService extends BaseService {
953
1185
  * await fittingDesignService.clearDesign();
954
1186
  * ```
955
1187
  * @param options
1188
+ * @deprecated 接口已废弃, 预计于`2024年9月30日`完全下线, 请尽快使用 `IDP.Custom.FittingDesignV2.deleteDesignDataAsync`代替
956
1189
  */
957
1190
  clearDesign(options?: IBaseOptions): Promise<void>;
958
1191
  }
@@ -1014,6 +1247,92 @@ export declare class FittingDesignService extends BaseService {
1014
1247
  }): Promise<void>;
1015
1248
  }
1016
1249
 
1250
+ /**
1251
+ * 孔槽渲染数据的管理
1252
+ * > 坐标系统一是关联模型的中心点为原点构建的坐标系
1253
+ * > 只会影响展示效果
1254
+ * @example
1255
+ * ```typescript
1256
+ * const fittingViewerService = application.getService(FittingViewerService);
1257
+ * ```
1258
+ */
1259
+ export declare class FittingViewerService extends BaseService {
1260
+ /**
1261
+ * 往当前的场景中,新增孔、槽的渲染效果
1262
+ * 孔槽坐标系要求是其关联的元件(商品下的模型)的中心点坐标系
1263
+ * 如若获取的是左后下坐标,需要主动做偏移后写入
1264
+ * @param fittingData 孔/槽方案信息
1265
+ * @param fittingData.modelId 孔槽关联的商品
1266
+ * @param fittingData.holes 孔的集合,若不带holeId,则会生成实例id返回
1267
+ * @param fittingData.grooves 槽的集合,若不带grooveId,则会生成实例id返回
1268
+ * @returns 返回携带了实例id的孔槽集合
1269
+ * @example 展示模型id为"6CE4EFB3-59B4-41A8-8706-936800280B15"下的孔槽
1270
+ * ```typescript
1271
+ * const fittingViewerService = application.getService(FittingViewerService);
1272
+ * await fittingViewerService.addFitting({
1273
+ * modelId: "6CE4EFB3-59B4-41A8-8706-936800280B15",
1274
+ * holes: [{xxx}],
1275
+ * grooves: [{xxx}]
1276
+ * })
1277
+ * ```
1278
+ */
1279
+ addFitting(fittingData: IFittingViewerDataWithOptionalId): Promise<IFittingViewerDataWithId>;
1280
+ /**
1281
+ * 清空当前场景内的全部孔槽
1282
+ * @example 清空场景内的全部孔槽
1283
+ * ```typescript
1284
+ * const fittingViewerService = application.getService(FittingViewerService);
1285
+ * await fittingViewerService.clearFitting();
1286
+ * ```
1287
+ */
1288
+ clearFitting(): Promise<void>;
1289
+ /**
1290
+ * 获取场景中的孔槽
1291
+ * @param option.modelId 获取关联的孔槽
1292
+ * @example 获取场景中关联模型id为`89720858-5242-4756-8528-F07C3D69F9E`的孔槽
1293
+ * ```typescript
1294
+ * const fittings = fittingViewerService.getFitting({modelId: "89720858-5242-4756-8528-F07C3D69F9E"});
1295
+ * ```
1296
+ */
1297
+ getFitting(option?: {
1298
+ modelId: string;
1299
+ }): Promise<IFittingViewerDataWithId[]>;
1300
+ /**
1301
+ * 往当前的场景中,新增五金的渲染效果
1302
+ * 注意坐标系均为中心点坐标系其余与之前的五金一致
1303
+ * @param hardwareData.modelId 五金关联的商品
1304
+ * @param hardwareData.hardwares 五金的集合,若不带id,则会生成实例id返回
1305
+ * @example 展示模型id为"6CE4EFB3-59B4-41A8-8706-936800280B15"下的五金
1306
+ * ```typescript
1307
+ * const fittingViewerService = application.getService(FittingViewerService);
1308
+ * await fittingViewerService.addHardware({
1309
+ * modelId: "6CE4EFB3-59B4-41A8-8706-936800280B15",
1310
+ * hardwares: [{xxx}]
1311
+ * })
1312
+ */
1313
+ addHardware(hardwareData: IHardwareViewerDataWithOptionalId): Promise<IHardwareViewerDataWithId>;
1314
+ /**
1315
+ * 清除当前场景内的全部五金渲染效果
1316
+ * @example 清空场景内的全部五金
1317
+ * ```typescript
1318
+ * const fittingViewerService = application.getService(FittingViewerService);
1319
+ * await fittingViewerService.clearHardware();
1320
+ * ```
1321
+ */
1322
+ clearHardware(): Promise<void>;
1323
+ /**
1324
+ * 获取场景中的五金
1325
+ * @param option.modelId 获取关联的孔槽
1326
+ * @example 获取场景中关联模型id为`89720858-5242-4756-8528-F07C3D69F9E`的五金
1327
+ * ```typescript
1328
+ * const fittings = fittingViewerService.getHardware({modelId: "89720858-5242-4756-8528-F07C3D69F9E"});
1329
+ * ```
1330
+ */
1331
+ getHardware(option?: {
1332
+ modelId: string;
1333
+ }): Promise<IHardwareViewerDataWithId[]>;
1334
+ }
1335
+
1017
1336
  export declare type IApplicationStartOption = ITerminalConfig;
1018
1337
 
1019
1338
  /**
@@ -1102,7 +1421,74 @@ export declare class FittingDesignService extends BaseService {
1102
1421
  }
1103
1422
 
1104
1423
  /**
1105
- * 自定议参数
1424
+ * 通过凸度定义圆弧
1425
+ */
1426
+ declare interface IBomArcCurveByBulge {
1427
+ /**
1428
+ * 线段类型
1429
+ */
1430
+ type: EBomCurveType.Arc;
1431
+ /**
1432
+ * 凸度
1433
+ */
1434
+ bulge: number;
1435
+ }
1436
+
1437
+ /**
1438
+ * 通过半径、绕向、是否劣弧定义圆弧
1439
+ */
1440
+ declare interface IBomArcCurveByRadius {
1441
+ /**
1442
+ * 线段类型
1443
+ */
1444
+ type: EBomCurveType.Arc;
1445
+ /**
1446
+ * 逆时针
1447
+ */
1448
+ isCCW: boolean;
1449
+ /**
1450
+ * 劣弧
1451
+ */
1452
+ minorArc: boolean;
1453
+ /**
1454
+ * 半径
1455
+ */
1456
+ radius: number;
1457
+ }
1458
+
1459
+ /**
1460
+ * 线段描述
1461
+ * @vm-type UnknownType
1462
+ */
1463
+ export declare type IBomCurve = IBomLineSegCurve | IBomArcCurveByBulge | IBomArcCurveByRadius;
1464
+
1465
+ /**
1466
+ * 直线
1467
+ */
1468
+ declare interface IBomLineSegCurve {
1469
+ /**
1470
+ * 线段类型
1471
+ */
1472
+ type: EBomCurveType.LineSeg;
1473
+ }
1474
+
1475
+ /**
1476
+ * 成品板件轮廓
1477
+ * @vm-type UnknownType
1478
+ */
1479
+ export declare interface IBomProfile<T = IBomCurve> {
1480
+ /**
1481
+ * 点的坐标,每两个值代表一个点
1482
+ * eg: [100, 200, 250, 300]
1483
+ */
1484
+ points: number[];
1485
+ curves: T[];
1486
+ /** 名称 */
1487
+ name?: string;
1488
+ }
1489
+
1490
+ /**
1491
+ * 自定义参数
1106
1492
  * @vm-type IBzParamType
1107
1493
  */
1108
1494
  declare interface IBzParamModelLiteProperty<T extends number | string | boolean = string> {
@@ -1232,6 +1618,25 @@ export declare class FittingDesignService extends BaseService {
1232
1618
  | ISceneSelectOption[];
1233
1619
  }
1234
1620
 
1621
+ /**
1622
+ * 孔槽数据
1623
+ * @vm-type UnknownType
1624
+ */
1625
+ export declare interface IFittingDataV2<WithId extends boolean = false> {
1626
+ /**
1627
+ * 孔槽关联的商品id
1628
+ */
1629
+ modelId: string;
1630
+ /**
1631
+ * 孔的集合
1632
+ */
1633
+ holes?: Array<WithId extends true ? IHoleDataV2WithId : IHoleDataV2>;
1634
+ /**
1635
+ * 槽的集合
1636
+ */
1637
+ grooves?: Array<WithId extends true ? IGrooveDataV2WithId : IGrooveDataV2>;
1638
+ }
1639
+
1235
1640
  /**
1236
1641
  * 孔/槽方案的数据结构
1237
1642
  */
@@ -1258,6 +1663,21 @@ export declare class FittingDesignService extends BaseService {
1258
1663
  hardwareGrooves: IFittingHardwareGrooves_2;
1259
1664
  }
1260
1665
 
1666
+ /**
1667
+ * 孔槽方案数据
1668
+ * @vm-type UnknownType
1669
+ */
1670
+ export declare interface IFittingDesignDataV2<WithId extends boolean = false> {
1671
+ /**
1672
+ * 方案关联的顶层模型id
1673
+ */
1674
+ id: string;
1675
+ /**
1676
+ * 孔槽方案
1677
+ */
1678
+ fittingDesign: Array<IFittingDataV2<WithId>>;
1679
+ }
1680
+
1261
1681
  export declare interface IFittingDesignValidateResult {
1262
1682
  /**
1263
1683
  * 是否验证通过
@@ -1350,7 +1770,16 @@ export declare class FittingDesignService extends BaseService {
1350
1770
  /**
1351
1771
  * 方案原始数据
1352
1772
  */
1353
- originalData: IHoleData | IGrooveData | IHardwareData | IHardwareGrooveData;
1773
+ originalData:
1774
+ | IHoleData
1775
+ | IGrooveData
1776
+ | IHardwareData
1777
+ | IHardwareGrooveData
1778
+ | IHoleDataV2WithId
1779
+ | ISquareGrooveDataWithId
1780
+ | IRoundCornerGrooveDataWithId
1781
+ | ISpecialShapedGrooveDataWithId
1782
+ | IPathGrooveDataWithId;
1354
1783
 
1355
1784
  /**
1356
1785
  * 模型变更记录
@@ -1370,6 +1799,77 @@ export declare class FittingDesignService extends BaseService {
1370
1799
  setHidden(isHidden: boolean): void;
1371
1800
  }
1372
1801
 
1802
+ /**
1803
+ * 影响孔槽渲染的属性
1804
+ */
1805
+ export declare interface IFittingRenderProperty {
1806
+ /**
1807
+ * 渲染属性
1808
+ */
1809
+ renderProperty: {
1810
+ /**
1811
+ * 孔槽颜色
1812
+ * @default 默认颜色为`ModelViewerService.setting()`接口设置的holeColor/grooveColor
1813
+ */
1814
+ color?: string | number;
1815
+ /**
1816
+ * 不透明度
1817
+ * @default 默认不透明度为`ModelViewerService.setting()`接口设置的holeOpacity/grooveOpacity
1818
+ */
1819
+ opacity?: number;
1820
+ };
1821
+ }
1822
+
1823
+ export declare interface IFittingViewerDataWithId {
1824
+ /**
1825
+ * 关联的商品id
1826
+ */
1827
+ modelId: string;
1828
+ /**
1829
+ * 孔的集合
1830
+ */
1831
+ holes?: Array<IHoleDataV2WithId & Partial<IFittingRenderProperty>>;
1832
+ /**
1833
+ * 槽的集合
1834
+ */
1835
+ grooves?: Array<IGrooveDataV2WithId & Partial<IFittingRenderProperty>>;
1836
+ /**
1837
+ * 描述异形板件的轮廓
1838
+ * 主要用于BOM
1839
+ */
1840
+ finishedProfile?: IBomProfile;
1841
+ }
1842
+
1843
+ export declare interface IFittingViewerDataWithOptionalId {
1844
+ /**
1845
+ * 关联的商品id
1846
+ */
1847
+ modelId: string;
1848
+ /**
1849
+ * 孔的集合
1850
+ */
1851
+ holes?: Array<IHoleDataV2WithOptionalId & Partial<IFittingRenderProperty>>;
1852
+ /**
1853
+ * 槽的集合
1854
+ */
1855
+ grooves?: Array<IGrooveDataV2WithOptionalId & Partial<IFittingRenderProperty>>;
1856
+ /**
1857
+ * 描述异形板件的轮廓
1858
+ * 主要用于BOM
1859
+ */
1860
+ finishedProfile?: IBomProfile;
1861
+ }
1862
+
1863
+ /** 模型关联户型数据 */
1864
+ declare interface IFloorplanRelation {
1865
+ /** 关联墙体id */
1866
+ hostIds: string[];
1867
+ /** 关联墙洞id */
1868
+ openingIds: string[];
1869
+ /** 是否与墙体方向反向 与 模型旋转角度 和 内外开启参数(pushOrPull)、开门方向参数(doorOpenDirection) 共同决定展示的开向 */
1870
+ reverse?: boolean;
1871
+ }
1872
+
1373
1873
  /**
1374
1874
  * 获取模型的交接信息
1375
1875
  */
@@ -1434,6 +1934,18 @@ export declare class FittingDesignService extends BaseService {
1434
1934
  * 支持配置输出交接体/贯穿交接体
1435
1935
  */
1436
1936
  intersectedInfoType?: EIntersectedInfoType[];
1937
+ /**
1938
+ * 不足板厚,是否输出交接体
1939
+ * @default true 默认true,即输出交接体
1940
+ */
1941
+ thicknessFilterBody?: boolean;
1942
+ /**
1943
+ * 不足板厚,配置允许输出交接面的阈值范围;
1944
+ * 在阈值范围内输出交界面,在阈值范围外不输出交界面;
1945
+ * 该字段需要配合`thicknessFilter`一起使用,即 `thicknessFilter`为true时,该字段才会生效;
1946
+ * @default 0.05
1947
+ */
1948
+ thicknessFilterFaceDistTol?: number;
1437
1949
  }
1438
1950
 
1439
1951
  /**
@@ -1468,6 +1980,66 @@ export declare class FittingDesignService extends BaseService {
1468
1980
  width: number;
1469
1981
  }
1470
1982
 
1983
+ export declare interface IGrooveDataV2 {
1984
+ /**
1985
+ * 起点圆心
1986
+ */
1987
+ start?: Number3;
1988
+ /**
1989
+ * 终点
1990
+ */
1991
+ end?: Number3;
1992
+ /**
1993
+ * 板面
1994
+ */
1995
+ plankFaceId: string;
1996
+ /**
1997
+ * 槽宽
1998
+ */
1999
+ width?: number;
2000
+ /**
2001
+ * 槽应用类型
2002
+ */
2003
+ type: EAppliedGrooveType;
2004
+ /**
2005
+ * 槽几何类型,不填默认是SQUARE
2006
+ */
2007
+ geometryType?: EGrooveGeometryType;
2008
+ /**
2009
+ * 槽路径点
2010
+ */
2011
+ profile?: IProfileOrPath;
2012
+ /**
2013
+ * 圆弧路径
2014
+ */
2015
+ radius?: number;
2016
+ /**
2017
+ * 多点路径
2018
+ */
2019
+ path?: IProfileOrPath;
2020
+ /**
2021
+ * 槽深
2022
+ */
2023
+ depth: number;
2024
+ /**
2025
+ * 名称
2026
+ */
2027
+ name: string;
2028
+ }
2029
+
2030
+ export declare type IGrooveDataV2WithId = IGrooveDataV2 & IGrooveId;
2031
+
2032
+ export declare interface IGrooveDataV2WithOptionalId extends IGrooveDataV2 {
2033
+ grooveId?: string;
2034
+ }
2035
+
2036
+ declare interface IGrooveId {
2037
+ /**
2038
+ * 槽ID
2039
+ */
2040
+ grooveId: string;
2041
+ }
2042
+
1471
2043
  /**
1472
2044
  * 五金相关的信息
1473
2045
  */
@@ -1494,6 +2066,12 @@ export declare class FittingDesignService extends BaseService {
1494
2066
  linkedIds: string[];
1495
2067
  }
1496
2068
 
2069
+ export declare type IHardwareDataWithId = IHardwareData;
2070
+
2071
+ export declare interface IHardwareDataWithOptionalId extends Omit<IHardwareData, 'id'> {
2072
+ id?: string;
2073
+ }
2074
+
1497
2075
  /**
1498
2076
  * 闭合路径中的点,需要按逆时针顺序上传,否则会导致异常
1499
2077
  */
@@ -1516,6 +2094,28 @@ export declare class FittingDesignService extends BaseService {
1516
2094
  lines: ILineData[];
1517
2095
  }
1518
2096
 
2097
+ export declare interface IHardwareViewerDataWithId {
2098
+ /**
2099
+ * 关联的模型id
2100
+ */
2101
+ modelId: string;
2102
+ /**
2103
+ * 五金集合
2104
+ */
2105
+ hardwares: IHardwareDataWithId[];
2106
+ }
2107
+
2108
+ export declare interface IHardwareViewerDataWithOptionalId {
2109
+ /**
2110
+ * 关联的模型id
2111
+ */
2112
+ modelId: string;
2113
+ /**
2114
+ * 五金集合
2115
+ */
2116
+ hardwares: IHardwareDataWithOptionalId[];
2117
+ }
2118
+
1519
2119
  /**
1520
2120
  * 颜色配置信息
1521
2121
  *
@@ -1591,6 +2191,52 @@ export declare class FittingDesignService extends BaseService {
1591
2191
  diameter: number;
1592
2192
  }
1593
2193
 
2194
+ /**
2195
+ * 孔数据结构
2196
+ * 坐标原点为关联模型的中心点
2197
+ */
2198
+ export declare interface IHoleDataV2 {
2199
+ /**
2200
+ * 起点圆心
2201
+ */
2202
+ start: Number3;
2203
+ /**
2204
+ * 终点
2205
+ */
2206
+ end: Number3;
2207
+ /**
2208
+ * 板面
2209
+ */
2210
+ plankFaceId: string;
2211
+ /**
2212
+ * 应用类型
2213
+ */
2214
+ type: EAppliedHoleType;
2215
+ /**
2216
+ * 直径
2217
+ */
2218
+ diameter: number;
2219
+ /**
2220
+ * 孔深
2221
+ */
2222
+ depth: number;
2223
+ /**
2224
+ * 名称
2225
+ */
2226
+ name: string;
2227
+ }
2228
+
2229
+ export declare interface IHoleDataV2WithId extends IHoleDataV2 {
2230
+ /**
2231
+ * 孔的id
2232
+ */
2233
+ holeId: string;
2234
+ }
2235
+
2236
+ export declare interface IHoleDataV2WithOptionalId extends IHoleDataV2 {
2237
+ holeId?: string;
2238
+ }
2239
+
1594
2240
  /**
1595
2241
  * 交接信息
1596
2242
  */
@@ -1729,6 +2375,29 @@ export declare class FittingDesignService extends BaseService {
1729
2375
  radius: number;
1730
2376
  }
1731
2377
 
2378
+ export declare interface ILineV2 {
2379
+ /**
2380
+ * 线段类型
2381
+ */
2382
+ type: EBomCurveType;
2383
+ /**
2384
+ * 凸度
2385
+ */
2386
+ bulge?: number;
2387
+ /**
2388
+ * 逆时针
2389
+ */
2390
+ isCCW?: boolean;
2391
+ /**
2392
+ * 劣弧
2393
+ */
2394
+ minorArc?: boolean;
2395
+ /**
2396
+ * 半径
2397
+ */
2398
+ radius?: number;
2399
+ }
2400
+
1732
2401
  /**
1733
2402
  * 模型高亮默认配置信息
1734
2403
  * @example
@@ -1942,6 +2611,11 @@ export declare class FittingDesignService extends BaseService {
1942
2611
  * @typedef Number3
1943
2612
  */
1944
2613
  readonly size: Number3;
2614
+ /**
2615
+ * 获取当前模型的产品编码
2616
+ * 此字段相当于json输出中『modelBrandGoodCode』字段
2617
+ */
2618
+ getProductCode(): string | undefined;
1945
2619
  /**
1946
2620
  * 获取当前模型名称
1947
2621
  */
@@ -2046,6 +2720,14 @@ export declare class FittingDesignService extends BaseService {
2046
2720
  * @param child {IParamModelLite} 待添加的模型
2047
2721
  */
2048
2722
  appendChild(child: this): void;
2723
+ /**
2724
+ * 替换子模型
2725
+ * @param oldChild
2726
+ * @param newChild
2727
+ * @param option
2728
+ * @internal
2729
+ */
2730
+ replaceChild(oldChild: this, newChild: this, option?: IReplaceParamModelInfoOption): void;
2049
2731
  /**
2050
2732
  * 向当前模型中,添加一个非原生模型;一般会使用在添加五金
2051
2733
  * @param accessory {IParamModelLite} 待添加的模型
@@ -2110,6 +2792,15 @@ export declare class FittingDesignService extends BaseService {
2110
2792
  * 获取当前模型中的板件轮廓信息
2111
2793
  */
2112
2794
  getPlankPathAsync(): Promise<IParamModelLitePlankPath | undefined>;
2795
+ /**
2796
+ * 获取户型关系
2797
+ */
2798
+ getFloorplanRelation(): Readonly<IFloorplanRelation> | undefined;
2799
+ /**
2800
+ * 设置户型关系
2801
+ * @param floorplanRelation {IFloorplanRelation} 户型关系
2802
+ */
2803
+ setFloorplanRelation(floorplanRelation: Omit<IFloorplanRelation, 'hostIds'>): void;
2113
2804
  }
2114
2805
 
2115
2806
  /**
@@ -2236,6 +2927,10 @@ export declare class FittingDesignService extends BaseService {
2236
2927
  * @param formula
2237
2928
  */
2238
2929
  setFormula(formula: string): void;
2930
+ /**
2931
+ * 获取约束的产品包id
2932
+ */
2933
+ getPackageId(): string | undefined;
2239
2934
  }
2240
2935
 
2241
2936
  /**
@@ -2252,6 +2947,11 @@ export declare class FittingDesignService extends BaseService {
2252
2947
  * 编辑器设置的内轮廓洞
2253
2948
  */
2254
2949
  getOriginInnerHoles(): IPathData[];
2950
+ /**
2951
+ * 获取原始槽
2952
+ * 编辑器设置的槽
2953
+ */
2954
+ getOriginSlots(): ISlotData[];
2255
2955
  /**
2256
2956
  * 获取外轮廓
2257
2957
  */
@@ -2260,6 +2960,10 @@ export declare class FittingDesignService extends BaseService {
2260
2960
  * 获取内轮廓洞的集合
2261
2961
  */
2262
2962
  getInnerHoles(): IPathData[];
2963
+ /**
2964
+ * 获取槽
2965
+ */
2966
+ getSlots(): ISlotData[];
2263
2967
  /**
2264
2968
  * 设置外轮廓
2265
2969
  * 全量替换原有的外轮廓
@@ -2271,11 +2975,10 @@ export declare class FittingDesignService extends BaseService {
2271
2975
  */
2272
2976
  setInnerHoles(holes: IPathData[]): void;
2273
2977
  /**
2274
- * 获取轮廓值
2275
- * 调用updateAsync后取得准确
2276
- * 叠加offset后的最终结果
2978
+ * 设置槽
2979
+ * 全量替换原有的槽
2277
2980
  */
2278
- getResult(): IPlankPathResult;
2981
+ setSlots(holes: ISlotData[]): void;
2279
2982
  }
2280
2983
 
2281
2984
  /**
@@ -2296,12 +2999,33 @@ export declare class FittingDesignService extends BaseService {
2296
2999
  [key: string]: any;
2297
3000
  }
2298
3001
 
2299
- declare type IPathResultData = IPathData & {
3002
+ /**
3003
+ * 路径槽
3004
+ */
3005
+ export declare type IPathGrooveData = AugmentedRequired<IGrooveDataV2, 'width' | 'path'> & {
3006
+ geometryType: EGrooveGeometryType.PATH;
3007
+ };
3008
+
3009
+ export declare type IPathGrooveDataWithId = IPathGrooveData & IGrooveId;
3010
+
3011
+ export declare interface IPathV2 {
2300
3012
  /**
2301
- * 轮廓绕向
3013
+ * 是否闭合的路径
2302
3014
  */
2303
- clockwise?: boolean;
2304
- };
3015
+ isClosed: boolean;
3016
+ /**
3017
+ * 路径上的所有端点
3018
+ */
3019
+ points: IPointV2[];
3020
+ /**
3021
+ * 路径上的所有线段
3022
+ */
3023
+ lines: ILineV2[];
3024
+ /**
3025
+ * 获取路径上实际渲染的端点
3026
+ */
3027
+ getRenderPoints(): Number2[];
3028
+ }
2305
3029
 
2306
3030
  /**
2307
3031
  * 板件轮廓描述
@@ -2384,7 +3108,7 @@ export declare class FittingDesignService extends BaseService {
2384
3108
  /**
2385
3109
  * 线条类型
2386
3110
  */
2387
- type: ELineType;
3111
+ type: EPlankPathLineType;
2388
3112
  /**
2389
3113
  * 是否顺时针
2390
3114
  */
@@ -2427,7 +3151,7 @@ export declare class FittingDesignService extends BaseService {
2427
3151
  /**
2428
3152
  * 点的类型
2429
3153
  */
2430
- type: EPointType;
3154
+ type: EPlankPathPointType;
2431
3155
  /**
2432
3156
  * 切角两边上切点距离当前点的距离(切角专用)
2433
3157
  */
@@ -2467,20 +3191,6 @@ export declare class FittingDesignService extends BaseService {
2467
3191
 
2468
3192
  declare type IPlankPathPointData = IPointBase;
2469
3193
 
2470
- /**
2471
- * 轮廓值
2472
- */
2473
- declare interface IPlankPathResult {
2474
- /**
2475
- * 外轮廓
2476
- */
2477
- outerPath: IPathResultData;
2478
- /**
2479
- * 内轮廓洞
2480
- */
2481
- innerHoles: IPathResultData[];
2482
- }
2483
-
2484
3194
  /**
2485
3195
  * 轮廓路径端点表示
2486
3196
  */
@@ -2548,6 +3258,16 @@ export declare class FittingDesignService extends BaseService {
2548
3258
  */
2549
3259
  export declare type IPointData = IPointWithNone | IPointWithLine | IPointWithCircle | IPointWithCutCircle;
2550
3260
 
3261
+ export declare interface IPointV2 {
3262
+ /**
3263
+ * 点的位置
3264
+ *
3265
+ * @example
3266
+ * "123,-345"
3267
+ */
3268
+ position: Number2;
3269
+ }
3270
+
2551
3271
  /**
2552
3272
  * 倒圆
2553
3273
  */
@@ -2608,6 +3328,47 @@ export declare class FittingDesignService extends BaseService {
2608
3328
  clockwise?: boolean;
2609
3329
  }
2610
3330
 
3331
+ /**
3332
+ * 槽路径/轮廓
3333
+ */
3334
+ declare interface IProfileOrPath {
3335
+ /**
3336
+ * 点的坐标,每两个值代表一个点
3337
+ * eg: [100, 200, 250, 300]
3338
+ */
3339
+ points: number[];
3340
+ curves: Array<{
3341
+ /**
3342
+ * 线段类型
3343
+ * 直线 / 弧线
3344
+ */
3345
+ type: 'LineSeg' | 'Arc';
3346
+ /**
3347
+ * 逆时针
3348
+ */
3349
+ isCCW?: boolean;
3350
+ /**
3351
+ * 劣弧
3352
+ */
3353
+ minorArc?: boolean;
3354
+ /**
3355
+ * 半径
3356
+ */
3357
+ radius?: number;
3358
+ /**
3359
+ * 凸度
3360
+ */
3361
+ bulge?: number;
3362
+ }>;
3363
+ }
3364
+
3365
+ /**
3366
+ * 替换模型时的配置信息
3367
+ */
3368
+ declare interface IReplaceParamModelInfoOption {
3369
+ inherit?: boolean;
3370
+ }
3371
+
2611
3372
  /**
2612
3373
  * 房间信息
2613
3374
  */
@@ -2622,6 +3383,15 @@ export declare class FittingDesignService extends BaseService {
2622
3383
  roomName?: string;
2623
3384
  }
2624
3385
 
3386
+ /**
3387
+ * 圆角方槽
3388
+ */
3389
+ export declare type IRoundCornerGrooveData = AugmentedRequired<IGrooveDataV2, 'start' | 'end' | 'width' | 'radius'> & {
3390
+ geometryType: EGrooveGeometryType.ROUND_CORNER;
3391
+ };
3392
+
3393
+ export declare type IRoundCornerGrooveDataWithId = IRoundCornerGrooveData & IGrooveId;
3394
+
2625
3395
  /**
2626
3396
  * 高亮模型描述
2627
3397
  */
@@ -2710,6 +3480,46 @@ export declare class FittingDesignService extends BaseService {
2710
3480
  renderIgnoreCategory: number | number[];
2711
3481
  }
2712
3482
 
3483
+ /**
3484
+ * 槽数据
3485
+ */
3486
+ declare interface ISlotData {
3487
+ /**
3488
+ * 槽轮廓信息
3489
+ */
3490
+ path: IPathData;
3491
+ /**
3492
+ * 槽深度
3493
+ */
3494
+ deep: string;
3495
+ /**
3496
+ * 槽的挖槽方向
3497
+ */
3498
+ slotCaveType: SlotCaveType;
3499
+ /**
3500
+ * other fields
3501
+ */
3502
+ [key: string]: any;
3503
+ }
3504
+
3505
+ /**
3506
+ * 异形槽
3507
+ */
3508
+ export declare type ISpecialShapedGrooveData = AugmentedRequired<IGrooveDataV2, 'profile'> & {
3509
+ geometryType: EGrooveGeometryType.SPECIAL_SHAPED;
3510
+ };
3511
+
3512
+ export declare type ISpecialShapedGrooveDataWithId = ISpecialShapedGrooveData & IGrooveId;
3513
+
3514
+ /**
3515
+ * 方槽
3516
+ */
3517
+ export declare type ISquareGrooveData = AugmentedRequired<IGrooveDataV2, 'start' | 'end' | 'width'> & {
3518
+ geometryType?: EGrooveGeometryType.SQUARE;
3519
+ };
3520
+
3521
+ export declare type ISquareGrooveDataWithId = ISquareGrooveData & IGrooveId;
3522
+
2713
3523
  /**
2714
3524
  * 启动时,配置terminal信息
2715
3525
  */
@@ -3061,6 +3871,18 @@ export declare class FittingDesignService extends BaseService {
3061
3871
  * ```
3062
3872
  */
3063
3873
  moveCamera(direction: ECameraMoveDirection): void;
3874
+ /**
3875
+ * 相机视角调整
3876
+ * @param face
3877
+ * @ignore
3878
+ */
3879
+ focusFace(face: Face): void;
3880
+ /**
3881
+ * 更新相机类型
3882
+ * @param type
3883
+ * @ignore
3884
+ */
3885
+ updateCameraType(type: CameraType): void;
3064
3886
  }
3065
3887
 
3066
3888
  /**
@@ -3478,6 +4300,15 @@ export declare class FittingDesignService extends BaseService {
3478
4300
  syncModelPlankPath(plankArea: IPlankArea): void;
3479
4301
  }
3480
4302
 
4303
+ /**
4304
+ * 获取promise函数返回类型
4305
+ */
4306
+ export declare type ReturnPromiseType<T extends (...args: any[]) => Promise<any>> = T extends (
4307
+ ...args: any[]
4308
+ ) => Promise<infer R>
4309
+ ? R
4310
+ : T;
4311
+
3481
4312
  /**
3482
4313
  * 提供渲染场景的控制
3483
4314
  *
@@ -3527,4 +4358,12 @@ export declare class FittingDesignService extends BaseService {
3527
4358
  registerMultiSelectShortcut(key: KeyboardKey | KeyboardKey[]): void;
3528
4359
  }
3529
4360
 
4361
+ /**
4362
+ * 挖槽方向
4363
+ */
4364
+ declare enum SlotCaveType {
4365
+ FROM_TOP = "1",
4366
+ FROM_BOTTOM = "2"
4367
+ }
4368
+
3530
4369
  export { }