@manycore/custom-sdk 1.12.2-alpha.1 → 1.13.0-perf.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 +253 -89
  2. package/index.js +38 -19
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
4
4
  import { IServClientService } from 'servkit';
5
5
  import { Number2 } from '@manycore/custom-miniapp-sdk';
6
6
  import { Number3 } from '@manycore/custom-miniapp-sdk';
7
- import { PlankArea } from '@qunhe/miniapp-model-viewer-core/src/model/base/plankArea';
8
7
  import { ServService } from 'servkit';
9
8
 
10
9
  declare interface AMap<K, V> {
@@ -182,6 +181,24 @@ export declare class CustomModelService extends BaseService {
182
181
  }): Promise<void>;
183
182
  }
184
183
 
184
+ /**
185
+ * 自定议字段枚举类型
186
+ */
187
+ declare enum EBzPropertyType {
188
+ /**
189
+ * 数字类型
190
+ */
191
+ number = "number",
192
+ /**
193
+ * 字符串类型
194
+ */
195
+ string = "string",
196
+ /**
197
+ * boolean类型
198
+ */
199
+ boolean = "boolean"
200
+ }
201
+
185
202
  /**
186
203
  * 相机展示模式
187
204
  */
@@ -240,6 +257,26 @@ declare enum EClockWise {
240
257
  FALSE = "false"
241
258
  }
242
259
 
260
+ /**
261
+ * 定制模型类型
262
+ */
263
+ declare enum ECustomModelType {
264
+ /** 实体模型 */
265
+ PARAM_ENTITY = 1,
266
+ /** 家具模型,3d模型文件 */
267
+ PARAM_FURNITURE = 2,
268
+ /** 基元模型,需要计算mesh */
269
+ PARAM_PRIMITIVE = 3,
270
+ /** 虚拟模型 */
271
+ PARAM_VIRTUAL = 4,
272
+ /** 参数化组合:即在设计方案当中,选中多个模型,组合之后的结果 */
273
+ PARAM_ASSEMBLY = 5,
274
+ /**
275
+ * 参数化组合:在参数化编辑器中,对多个模型进行组合操作
276
+ */
277
+ TEMPLATE_ASSEMBLY = 6
278
+ }
279
+
243
280
  /**
244
281
  * 交互模式
245
282
  */
@@ -364,6 +401,36 @@ export declare enum ELanguage {
364
401
  VI = 'vi',
365
402
  }
366
403
 
404
+ /**
405
+ * 设计对象 ID
406
+ */
407
+ declare interface ElementId {
408
+ /** 实例 ID */
409
+ id: string;
410
+ /** 类型 */
411
+ type: ElementType;
412
+ }
413
+
414
+ /**
415
+ * 定制设计对象类型
416
+ */
417
+ declare enum ElementType {
418
+ /** 全屋定制家具 */
419
+ Wardrobe = "Wardrobe",
420
+ /** 全屋定制家具副本 */
421
+ WardrobeCopy = "WardrobeCopy",
422
+ /** 厨卫 */
423
+ Cabinet = "Cabinet",
424
+ /** 厨卫副本 */
425
+ CabinetCopy = "CabinetCopy",
426
+ /** 门窗 */
427
+ DoorWindow = "DoorWindow",
428
+ /** 门窗副本 */
429
+ DoorWindowCopy = "DoorWindowCopy",
430
+ /** 定制组合 */
431
+ CustomGroup = "CustomGroup"
432
+ }
433
+
367
434
  /**
368
435
  * 线的类型
369
436
  */
@@ -985,6 +1052,52 @@ export declare class FittingDesignService extends BaseService {
985
1052
  modelId?: string;
986
1053
  }
987
1054
 
1055
+ /**
1056
+ * 自定议参数
1057
+ */
1058
+ declare interface IBzParamModelLiteProperty<T extends number | string | boolean = string> {
1059
+ /**
1060
+ * 参数命名空间
1061
+ */
1062
+ namespace: string;
1063
+ /**
1064
+ * 参数名称,为key
1065
+ */
1066
+ name: string;
1067
+ /**
1068
+ * 参数中存取的值
1069
+ */
1070
+ value: string | undefined;
1071
+ /**
1072
+ * 当前字段数据类型
1073
+ */
1074
+ type: EBzPropertyType | string;
1075
+ /**
1076
+ * 当前参数是否只读
1077
+ */
1078
+ readonly: boolean;
1079
+ /**
1080
+ * 获取参数名称
1081
+ */
1082
+ getName(): string;
1083
+ /**
1084
+ * 获取参数命名空间
1085
+ */
1086
+ getNamespace(): string;
1087
+ /**
1088
+ * 获取当前参数类型
1089
+ */
1090
+ getType(): string;
1091
+ /**
1092
+ * 读取值
1093
+ */
1094
+ getValue(): T | undefined;
1095
+ /**
1096
+ * 设置值
1097
+ */
1098
+ setValue(value: T): void;
1099
+ }
1100
+
988
1101
  declare interface IChangeMap {
989
1102
  update?: IUpdateInfo[];
990
1103
  }
@@ -1402,25 +1515,6 @@ export declare class FittingDesignService extends BaseService {
1402
1515
  ellipseCenter?: Number2;
1403
1516
  }
1404
1517
 
1405
- declare interface ILineData$1 {
1406
- /**
1407
- * 线条类型
1408
- */
1409
- type: ELineType_3;
1410
- /**
1411
- * 是否顺时针
1412
- */
1413
- clockwise?: boolean;
1414
- /**
1415
- * 优弧劣弧 (只有弧线有)
1416
- */
1417
- minorArc?: boolean;
1418
- /**
1419
- * 半径 (只有弧线有)
1420
- */
1421
- radius?: number;
1422
- }
1423
-
1424
1518
  export declare type ILineData = ILineDataBase | ILineDataCircle;
1425
1519
 
1426
1520
  /**
@@ -1609,6 +1703,12 @@ export declare class FittingDesignService extends BaseService {
1609
1703
  * @type string
1610
1704
  */
1611
1705
  readonly id: string;
1706
+ /**
1707
+ * 定制模型类型,在 @modelType 基础上进行了细分
1708
+ * @public
1709
+ * @type ECustomModelType
1710
+ */
1711
+ type: ECustomModelType;
1612
1712
  /**
1613
1713
  * 模型在方案中的名称
1614
1714
  * @readonly
@@ -1659,6 +1759,10 @@ export declare class FittingDesignService extends BaseService {
1659
1759
  * @typedef AMap<string, IParamModelLiteParam>
1660
1760
  */
1661
1761
  readonly params: AMap<string, IParamModelLiteParam>;
1762
+ /**
1763
+ * 模型当前用户自定义属性
1764
+ */
1765
+ readonly bzProperties: AMap<string, IBzParamModelLiteProperty>;
1662
1766
  /**
1663
1767
  * 商品ID,即商品后台的商品ID
1664
1768
  * @readonly
@@ -1695,6 +1799,13 @@ export declare class FittingDesignService extends BaseService {
1695
1799
  * @readonly
1696
1800
  */
1697
1801
  isRoot?: boolean;
1802
+ /**
1803
+ * 当前模型是否是合法(隐藏)模型
1804
+ * @readonly
1805
+ * @public
1806
+ * @type boolean
1807
+ */
1808
+ readonly legal?: boolean;
1698
1809
  /**
1699
1810
  * 获取当前模型名称
1700
1811
  */
@@ -1747,10 +1858,20 @@ export declare class FittingDesignService extends BaseService {
1747
1858
  * 获取当前模型相对父级的旋转信息
1748
1859
  */
1749
1860
  getRotation(): Number3_2;
1861
+ /**
1862
+ * 获取当前模型所处的工具线
1863
+ */
1864
+ getToolType(): EToolType_2 | undefined;
1865
+ /**
1866
+ * 设置当前模型工具线
1867
+ * @param toolType
1868
+ * @throws 如果工具线不被允许,将会报错
1869
+ */
1870
+ setToolType(toolType: EToolType_2): void;
1750
1871
  /**
1751
1872
  * 模型的复制,返回一个新的`ParamModel`对象
1752
1873
  */
1753
- clone(): IParamModelLite_2;
1874
+ clone(): this;
1754
1875
  /**
1755
1876
  * 将当前模型与父级模型断开联系
1756
1877
  * 可以更直接的理解为:删除当前模型
@@ -1760,31 +1881,32 @@ export declare class FittingDesignService extends BaseService {
1760
1881
  /**
1761
1882
  * 查找当前模型的父节点
1762
1883
  */
1763
- getParent(): IParamModelLite_2 | undefined;
1884
+ getParent(): this | undefined;
1764
1885
  /**
1765
- * 获取当前模型的顶层模型,如果当前模型就是顶层模型,则会返回undefined
1886
+ * 获取root节点,如果当前模型为root节点,则返回自身
1887
+ * @param recursion 存在多root时,是否获取最顶层root
1766
1888
  */
1767
- getRoot(): IParamModelLite_2 | undefined;
1889
+ getRoot(recursion?: boolean): this;
1768
1890
  /**
1769
1891
  * 获取当前模型的所有子模型
1770
1892
  */
1771
- getChild(): IParamModelLite_2[];
1893
+ getChild(): this[];
1772
1894
  /**
1773
1895
  * 获取当前模型下的所有非原生模型
1774
1896
  * @description 说明一下:非原生模型可以大致理解为:在方案当中,手动生成一个模型,添加到其他模型上;与之对应子模型可以理解为原生模型,即参数
1775
1897
  * 化编辑中自带的模型
1776
1898
  */
1777
- getAccessory(): IParamModelLite_2[];
1899
+ getAccessory(): this[];
1778
1900
  /**
1779
1901
  * 向当前模型中,添加一个子模型;一般会向包裹层当中,添加子模型;另外,五金配件,也必须使用此方法添加
1780
1902
  * @param child {IParamModelLite} 待添加的模型
1781
1903
  */
1782
- appendChild(child: IParamModelLite_2): void;
1904
+ appendChild(child: this): void;
1783
1905
  /**
1784
1906
  * 向当前模型中,添加一个非原生模型;一般会使用在添加五金
1785
1907
  * @param accessory {IParamModelLite} 待添加的模型
1786
1908
  */
1787
- appendAccessory(accessory: IParamModelLite_2): void;
1909
+ appendAccessory(accessory: this): void;
1788
1910
  /**
1789
1911
  * 获取当前模型中的参数信息(参数即在参数化编辑中的信息)
1790
1912
  * @example
@@ -1792,6 +1914,25 @@ export declare class FittingDesignService extends BaseService {
1792
1914
  * @param name {string} 参数名称
1793
1915
  */
1794
1916
  getParam(name: string): IParamModelLiteParam | undefined;
1917
+ /**
1918
+ * 获取用户自定义属性
1919
+ * @param name {string} 属性名称
1920
+ * @param namespace {string} 命名空间(当不传时,即表示当前小程序下的命名空间,格式如下:miniapp-${appId})
1921
+ */
1922
+ getBzProperty(name: string, namespace?: string): IBzParamModelLiteProperty | undefined;
1923
+ /**
1924
+ * 判断当前模型是否包含某个属性
1925
+ * @param name {string} 属性名称
1926
+ * @param namespace {string} 命名空间
1927
+ */
1928
+ hasBzProperty(name: string, namespace?: string): boolean;
1929
+ /**
1930
+ * 删除自定义属性、当删除成功时,将返回true,否则返回false
1931
+ *
1932
+ * @param name
1933
+ * @param namespace
1934
+ */
1935
+ removeBzProperty(name: string, namespace?: string): boolean;
1795
1936
  /**
1796
1937
  * 判断当前模型是否包含某个参数
1797
1938
  * @param name {string} 参数名称
@@ -1809,7 +1950,7 @@ export declare class FittingDesignService extends BaseService {
1809
1950
  /**
1810
1951
  * 将一个序列化之后的模型,进行反序列化操作
1811
1952
  */
1812
- deserialize(model: string): IParamModelLite_2;
1953
+ deserialize(model: string): this;
1813
1954
  /**
1814
1955
  * 刷新某个模型,此API仅适用于反向对接的模型:
1815
1956
  * 当前某个模型在后台更新了,但用户方案中,存储的仍然是之前的版本,调用此方法后,会自动将当前模型更新成后台最新的版本。
@@ -1817,6 +1958,10 @@ export declare class FittingDesignService extends BaseService {
1817
1958
  * > 模型中,添加的appendChild或addAccessory等参数,可能会失效不起作用
1818
1959
  */
1819
1960
  forceUpdate(update?: boolean): void;
1961
+ /**
1962
+ * 获取设计对象id
1963
+ */
1964
+ getElementId(): ElementId | undefined;
1820
1965
  }
1821
1966
 
1822
1967
  /**
@@ -1887,21 +2032,6 @@ export declare class FittingDesignService extends BaseService {
1887
2032
  setPrimitiveOverride(value: boolean): void;
1888
2033
  }
1889
2034
 
1890
- declare interface IPathData {
1891
- /**
1892
- * 偏移, 正数扩大路径范围,负数缩小路径范围
1893
- */
1894
- offset?: number;
1895
- /**
1896
- * 轮廓上的点
1897
- */
1898
- paramPoints: IPointData$1[];
1899
- /**
1900
- * 轮廓上的线
1901
- */
1902
- paramPathLines: ILineData$1[];
1903
- }
1904
-
1905
2035
  /**
1906
2036
  * 板件轮廓描述
1907
2037
  */
@@ -1956,74 +2086,49 @@ export declare class FittingDesignService extends BaseService {
1956
2086
  }
1957
2087
 
1958
2088
  declare interface IPlankPathData {
1959
- path?: IPathData;
1960
- holes: IPathData[];
2089
+ path?: IPlankPathPathData;
2090
+ holes: IPlankPathPathData[];
1961
2091
  /**
1962
2092
  * other fields
1963
2093
  */
1964
2094
  [key: string]: any;
1965
2095
  }
1966
2096
 
1967
- /**
1968
- * 轮廓路径端点表示
1969
- */
1970
- export declare interface IPoint extends IPointBase {
2097
+ declare interface IPlankPathLineData {
1971
2098
  /**
1972
- * 获取实际渲染端点
1973
- * >非直角端点为渲染线段的两端,直角端点两个端点相同
2099
+ * 线条类型
1974
2100
  */
1975
- getRenderPoints(): [Number2, Number2];
2101
+ type: ELineType_3;
1976
2102
  /**
1977
- * 设置非直角端点渲染线段的高亮,高亮深度为板件厚度
1978
- * @param hint 高亮配置
2103
+ * 是否顺时针
1979
2104
  */
1980
- setHint(hint: IHintBase): void;
2105
+ clockwise?: boolean;
1981
2106
  /**
1982
- * 清除高亮
2107
+ * 优弧劣弧 (只有弧线有)
1983
2108
  */
1984
- clearHint(): void;
2109
+ minorArc?: boolean;
1985
2110
  /**
1986
- * 获取高亮
2111
+ * 半径 (只有弧线有)
1987
2112
  */
1988
- getHint(): IHintBase | undefined;
2113
+ radius?: number;
1989
2114
  }
1990
2115
 
1991
- /**
1992
- * 点的基本类型
1993
- */
1994
- export declare interface IPointBase {
1995
- type: EPointType;
1996
- /**
1997
- * 点的位置
1998
- */
1999
- position: Number3 | Number2;
2116
+ declare interface IPlankPathPathData {
2000
2117
  /**
2001
- * 切角长度
2002
- */
2003
- cornerCutDistance?: [number, number];
2004
- /**
2005
- * 椭圆端点长轴
2006
- */
2007
- majorRadius?: number;
2008
- /**
2009
- * 椭圆端点短轴
2010
- */
2011
- minorRadius?: number;
2012
- /**
2013
- * 圆弧、切圆半径
2118
+ * 偏移, 正数扩大路径范围,负数缩小路径范围
2014
2119
  */
2015
- radius?: number;
2120
+ offset?: number;
2016
2121
  /**
2017
- * 圆弧是否为顺时针
2122
+ * 轮廓上的点
2018
2123
  */
2019
- clockwise?: boolean;
2124
+ paramPoints: IPlankPathPointData[];
2020
2125
  /**
2021
- * 圆弧、椭圆弧圆心偏移
2126
+ * 轮廓上的线
2022
2127
  */
2023
- offset?: Number2;
2128
+ paramPathLines: IPlankPathLineData[];
2024
2129
  }
2025
2130
 
2026
- declare interface IPointData$1 {
2131
+ declare interface IPlankPathPointData {
2027
2132
  /**
2028
2133
  * 点的位置
2029
2134
  *
@@ -2069,6 +2174,65 @@ export declare class FittingDesignService extends BaseService {
2069
2174
  minorRadius?: string;
2070
2175
  }
2071
2176
 
2177
+ /**
2178
+ * 轮廓路径端点表示
2179
+ */
2180
+ export declare interface IPoint extends IPointBase {
2181
+ /**
2182
+ * 获取实际渲染端点
2183
+ * >非直角端点为渲染线段的两端,直角端点两个端点相同
2184
+ */
2185
+ getRenderPoints(): [Number2, Number2];
2186
+ /**
2187
+ * 设置非直角端点渲染线段的高亮,高亮深度为板件厚度
2188
+ * @param hint 高亮配置
2189
+ */
2190
+ setHint(hint: IHintBase): void;
2191
+ /**
2192
+ * 清除高亮
2193
+ */
2194
+ clearHint(): void;
2195
+ /**
2196
+ * 获取高亮
2197
+ */
2198
+ getHint(): IHintBase | undefined;
2199
+ }
2200
+
2201
+ /**
2202
+ * 点的基本类型
2203
+ */
2204
+ export declare interface IPointBase {
2205
+ type: EPointType;
2206
+ /**
2207
+ * 点的位置
2208
+ */
2209
+ position: Number3 | Number2;
2210
+ /**
2211
+ * 切角长度
2212
+ */
2213
+ cornerCutDistance?: [number, number];
2214
+ /**
2215
+ * 椭圆端点长轴
2216
+ */
2217
+ majorRadius?: number;
2218
+ /**
2219
+ * 椭圆端点短轴
2220
+ */
2221
+ minorRadius?: number;
2222
+ /**
2223
+ * 圆弧、切圆半径
2224
+ */
2225
+ radius?: number;
2226
+ /**
2227
+ * 圆弧是否为顺时针
2228
+ */
2229
+ clockwise?: boolean;
2230
+ /**
2231
+ * 圆弧、椭圆弧圆心偏移
2232
+ */
2233
+ offset?: Number2;
2234
+ }
2235
+
2072
2236
  /**
2073
2237
  * 点的类型参数
2074
2238
  */
@@ -3056,7 +3220,7 @@ export declare class FittingDesignService extends BaseService {
3056
3220
  parseModelPlankPath(option: {
3057
3221
  modelID: string;
3058
3222
  data: IPlankPathData;
3059
- }): PlankArea;
3223
+ }): IPlankArea;
3060
3224
  /**
3061
3225
  * 同步板件轮廓修改到渲染场景中
3062
3226
  *