@manycore/custom-sdk 1.13.8-beta.1 → 1.13.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +226 -27
  2. package/index.js +29 -39
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -178,6 +178,7 @@ export declare class CustomModelService extends BaseService {
178
178
  /**
179
179
  * 自定议字段枚举类型
180
180
  */
181
+
181
182
  declare enum EBzPropertyType {
182
183
  /**
183
184
  * 数字类型
@@ -237,20 +238,6 @@ export declare enum ECameraMoveDirection {
237
238
  BACK = "BACK"
238
239
  }
239
240
 
240
- /**
241
- * 线是否顺时针的值
242
- */
243
- declare enum EClockWise {
244
- /**
245
- * 顺时针
246
- */
247
- TRUE = "true",
248
- /**
249
- * 逆时针
250
- */
251
- FALSE = "false"
252
- }
253
-
254
241
  /**
255
242
  * 定制模型类型
256
243
  */
@@ -477,7 +464,11 @@ export declare enum ELineType {
477
464
  * 椭圆
478
465
  * 当前代码中,暂不支持
479
466
  */
480
- ELLIPSE_ARC = 3
467
+ ELLIPSE_ARC = 3,
468
+ /**
469
+ * 圆
470
+ */
471
+ CIRCLE_CENTER = 4
481
472
  }
482
473
 
483
474
  /**
@@ -498,6 +489,44 @@ export declare enum EModelType {
498
489
  FITTING_MODEL = 'fitting_model',
499
490
  }
500
491
 
492
+ /**
493
+ * 当前参数的类型
494
+ */
495
+ declare enum EParamForm {
496
+ /**
497
+ * 单值, 老数据
498
+ * */
499
+ SINGLE = 0,
500
+ /**
501
+ * 区间
502
+ * */
503
+ RANGE = 1,
504
+ /**
505
+ * 可选
506
+ * */
507
+ OPTION = 2,
508
+ /**
509
+ * 递增
510
+ * */
511
+ STEP = 3,
512
+ /**
513
+ * 复合公式, 可以在公式和值之间切换
514
+ * */
515
+ COMPOUND_FORMULA = 4,
516
+ /**
517
+ * 公式
518
+ * */
519
+ FIXED_FORMULA = 5,
520
+ /**
521
+ * 固定值
522
+ * */
523
+ FIXED_VALUE = 6,
524
+ /**
525
+ * 复合公式, 公式+可选的组合
526
+ * */
527
+ COMPOUND_FORMULA_OPTION = 7
528
+ }
529
+
501
530
  /**
502
531
  * 当前模型的类型
503
532
  */
@@ -595,6 +624,28 @@ declare enum EParamType {
595
624
  BOOLEAN_LIST = "booleanlist"
596
625
  }
597
626
 
627
+ /**
628
+ * 值的单位类型
629
+ */
630
+ declare enum EParamUnitType {
631
+ /**
632
+ * 单位默认值
633
+ */
634
+ DEFAULT = 0,
635
+ /**
636
+ * 长度单位
637
+ */
638
+ LENGTH = 1,
639
+ /**
640
+ * 面积单位
641
+ */
642
+ AREA = 2,
643
+ /**
644
+ * 数量单位
645
+ */
646
+ NUMBER = 3
647
+ }
648
+
598
649
  /**
599
650
  * 板件轮廓路径类型
600
651
  */
@@ -632,7 +683,11 @@ export declare enum EPointType {
632
683
  /**
633
684
  * 椭圆
634
685
  */
635
- ELLIPSE = 4
686
+ ELLIPSE = 4,
687
+ /**
688
+ * 圆心点
689
+ */
690
+ CIRCLE_CENTER = 5
636
691
  }
637
692
 
638
693
  /**
@@ -1004,7 +1059,7 @@ export declare class FittingDesignService extends BaseService {
1004
1059
  export declare interface IBaseOptions {
1005
1060
  /**
1006
1061
  * 最长等待时间(以ms为单位)
1007
- * @default 500000
1062
+ * @default 50000
1008
1063
  */
1009
1064
  timeout?: number;
1010
1065
  /**
@@ -1760,7 +1815,8 @@ export declare class FittingDesignService extends BaseService {
1760
1815
 
1761
1816
  /**
1762
1817
  * 对定制参数化模型进行精简处理后的结果
1763
- * @name ParamModel
1818
+ * @name CustomModel
1819
+ * @vm-type CustomModel
1764
1820
  */
1765
1821
  declare interface IParamModelLite_2 {
1766
1822
  /**
@@ -1821,6 +1877,13 @@ export declare class FittingDesignService extends BaseService {
1821
1877
  * @type boolean
1822
1878
  */
1823
1879
  readonly legal?: boolean;
1880
+ /**
1881
+ * 当前尺寸信息
1882
+ * @readonly
1883
+ * @public
1884
+ * @typedef Number3
1885
+ */
1886
+ readonly size: Number3;
1824
1887
  /**
1825
1888
  * 获取当前模型名称
1826
1889
  */
@@ -1985,6 +2048,10 @@ export declare class FittingDesignService extends BaseService {
1985
2048
  * 获取设计对象id
1986
2049
  */
1987
2050
  getElementId(): ElementId | undefined;
2051
+ /**
2052
+ * 获取当前模型中的板件轮廓信息
2053
+ */
2054
+ getPlankPathAsync(): Promise<IParamModelLitePlankPath | undefined>;
1988
2055
  }
1989
2056
 
1990
2057
  /**
@@ -1992,6 +2059,50 @@ export declare class FittingDesignService extends BaseService {
1992
2059
  * @vm-type IParamType
1993
2060
  */
1994
2061
  declare interface IParamModelLiteParam<T = any> {
2062
+ /**
2063
+ * 获取参数名称
2064
+ */
2065
+ getName(): string;
2066
+ /**
2067
+ * 当前参数描述信息
2068
+ */
2069
+ getDescription(): string | undefined;
2070
+ /**
2071
+ * 获取参数简写名称
2072
+ */
2073
+ getSimpleName(): string | undefined;
2074
+ /**
2075
+ * 获取参数的显示名称
2076
+ */
2077
+ getDisplayName(): string;
2078
+ /**
2079
+ * 当前参数在工具中是否可见
2080
+ */
2081
+ getVisible(): boolean | undefined;
2082
+ /**
2083
+ * 当前字段是否被覆盖
2084
+ */
2085
+ isOverridden(): boolean | undefined;
2086
+ /**
2087
+ * 取消当前字段被覆盖
2088
+ */
2089
+ cancelOverride(): any;
2090
+ /**
2091
+ * 获取当前字段的单位类型
2092
+ */
2093
+ getUnitType(): EParamUnitType | undefined;
2094
+ /**
2095
+ * 获取当前参数类型
2096
+ */
2097
+ getParamForm(): EParamForm | undefined;
2098
+ /**
2099
+ * 判断当前值是否使用复合公式
2100
+ */
2101
+ isUsingMixFormula(): boolean;
2102
+ /**
2103
+ * 重置当前参数使用复合公式
2104
+ */
2105
+ useMixFormula(): void;
1995
2106
  /**
1996
2107
  * 获取当前参数解析后的值内容
1997
2108
  */
@@ -2012,7 +2123,7 @@ export declare class FittingDesignService extends BaseService {
2012
2123
  */
2013
2124
  setParsedValue(value: T): any;
2014
2125
  /**
2015
- * 获取当前参数类型
2126
+ * 获取当前参数值类型
2016
2127
  */
2017
2128
  getType(): EParamType;
2018
2129
  /**
@@ -2041,16 +2152,18 @@ export declare class FittingDesignService extends BaseService {
2041
2152
  */
2042
2153
  getRecommendValues(): NamedValue[];
2043
2154
  /**
2044
- * 获取value展示的值
2155
+ * 当为多布尔值时,展示的内容
2045
2156
  */
2046
2157
  getValueDisplayNames(): string[];
2047
2158
  /**
2048
2159
  * 是否需要将设置的参数覆盖原始参数信息
2049
2160
  * 仅对部分参数设计有效,具体细节,见对应场景
2161
+ * @deprecated 直接调用isOverridden()方法即可
2050
2162
  */
2051
2163
  getPrimitiveOverride(): boolean;
2052
2164
  /**
2053
2165
  * 是否需要将设置的参数覆盖原始参数信息
2166
+ * @deprecated 此逻辑,将在调用setValue时,自动完成此步骤,此方法可以忽略
2054
2167
  * @param value {boolean}
2055
2168
  */
2056
2169
  setPrimitiveOverride(value: boolean): void;
@@ -2067,6 +2180,71 @@ export declare class FittingDesignService extends BaseService {
2067
2180
  setFormula(formula: string): void;
2068
2181
  }
2069
2182
 
2183
+ /**
2184
+ * 模型的板件轮廓信息
2185
+ */
2186
+ declare interface IParamModelLitePlankPath {
2187
+ /**
2188
+ * 获取原始外轮廓
2189
+ * 编辑器设置的外轮廓
2190
+ */
2191
+ getOriginOuterPath(): IPathData;
2192
+ /**
2193
+ * 获取原始内轮廓洞
2194
+ * 编辑器设置的内轮廓洞
2195
+ */
2196
+ getOriginInnerHoles(): IPathData[];
2197
+ /**
2198
+ * 获取外轮廓
2199
+ */
2200
+ getOuterPath(): IPathData;
2201
+ /**
2202
+ * 获取内轮廓洞的集合
2203
+ */
2204
+ getInnerHoles(): IPathData[];
2205
+ /**
2206
+ * 设置外轮廓
2207
+ * 全量替换原有的外轮廓
2208
+ */
2209
+ setOuterPath(path: IPathData): void;
2210
+ /**
2211
+ * 设置内轮廓洞
2212
+ * 全量替换原有的内轮廓洞
2213
+ */
2214
+ setInnerHoles(holes: IPathData[]): void;
2215
+ /**
2216
+ * 获取轮廓值
2217
+ * 调用updateAsync后取得准确
2218
+ * 叠加offset后的最终结果
2219
+ */
2220
+ getResult(): IPlankPathResult;
2221
+ }
2222
+
2223
+ /**
2224
+ * 轮廓数据
2225
+ */
2226
+ declare interface IPathData {
2227
+ /**
2228
+ * 轮廓上的点
2229
+ */
2230
+ paramPoints: IPlankPathPoint[];
2231
+ /**
2232
+ * 轮廓上的线
2233
+ */
2234
+ paramPathLines: IPlankPathLine[];
2235
+ /**
2236
+ * other fields
2237
+ */
2238
+ [key: string]: any;
2239
+ }
2240
+
2241
+ declare type IPathResultData = IPathData & {
2242
+ /**
2243
+ * 轮廓绕向
2244
+ */
2245
+ clockwise?: boolean;
2246
+ };
2247
+
2070
2248
  /**
2071
2249
  * 板件轮廓描述
2072
2250
  */
@@ -2144,7 +2322,7 @@ export declare class FittingDesignService extends BaseService {
2144
2322
  [key: string]: any;
2145
2323
  }
2146
2324
 
2147
- declare interface IPlankPathLineData {
2325
+ declare interface IPlankPathLine {
2148
2326
  /**
2149
2327
  * 线条类型
2150
2328
  */
@@ -2160,9 +2338,11 @@ export declare class FittingDesignService extends BaseService {
2160
2338
  /**
2161
2339
  * 半径 (只有弧线有)
2162
2340
  */
2163
- radius?: number;
2341
+ radius?: string;
2164
2342
  }
2165
2343
 
2344
+ declare type IPlankPathLineData = ILineBase;
2345
+
2166
2346
  declare interface IPlankPathPathData {
2167
2347
  /**
2168
2348
  * 偏移, 正数扩大路径范围,负数缩小路径范围
@@ -2178,12 +2358,12 @@ export declare class FittingDesignService extends BaseService {
2178
2358
  paramPathLines: IPlankPathLineData[];
2179
2359
  }
2180
2360
 
2181
- declare interface IPlankPathPointData {
2361
+ declare interface IPlankPathPoint {
2182
2362
  /**
2183
2363
  * 点的位置
2184
- *
2185
2364
  * @example
2186
2365
  * "123,-345"
2366
+ * "#W/2,#D/2"
2187
2367
  */
2188
2368
  position: string;
2189
2369
  /**
@@ -2195,9 +2375,11 @@ export declare class FittingDesignService extends BaseService {
2195
2375
  */
2196
2376
  cornerCutDistance?: [string, string];
2197
2377
  /**
2198
- * 是否顺时针, 前端必须保证逆时针
2378
+ * 切圆必传
2379
+ * 轮廓路径顺时针 true=外弧 false=内弧
2380
+ * 轮廓路径逆时针 true=内弧 false=外弧
2199
2381
  */
2200
- clockwise?: EClockWise;
2382
+ clockwise?: boolean;
2201
2383
  /**
2202
2384
  * 半径 (倒圆切圆专用)
2203
2385
  * @example
@@ -2207,7 +2389,8 @@ export declare class FittingDesignService extends BaseService {
2207
2389
  /**
2208
2390
  * 圆心偏移 (切圆专用)
2209
2391
  * @example
2210
- * "345.12"
2392
+ * "0,0"
2393
+ * "#W/2,#D/2"
2211
2394
  */
2212
2395
  offset?: string;
2213
2396
  /**
@@ -2224,6 +2407,22 @@ export declare class FittingDesignService extends BaseService {
2224
2407
  minorRadius?: string;
2225
2408
  }
2226
2409
 
2410
+ declare type IPlankPathPointData = IPointBase;
2411
+
2412
+ /**
2413
+ * 轮廓值
2414
+ */
2415
+ declare interface IPlankPathResult {
2416
+ /**
2417
+ * 外轮廓
2418
+ */
2419
+ outerPath: IPathResultData;
2420
+ /**
2421
+ * 内轮廓洞
2422
+ */
2423
+ innerHoles: IPathResultData[];
2424
+ }
2425
+
2227
2426
  /**
2228
2427
  * 轮廓路径端点表示
2229
2428
  */