@manycore/custom-sdk 1.13.4 → 2.0.0-beta.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 +63 -5
  2. package/index.js +18 -18
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export declare class Application {
26
26
  private serviceMap;
27
27
  private sappSDK;
28
28
  constructor();
29
+ private startOnApiCalledEvent;
29
30
  /**
30
31
  * 判断当前是否在定制小程序下运行
31
32
  */
@@ -756,12 +757,14 @@ export declare class FittingDesignService extends BaseService {
756
757
  * ```
757
758
  *
758
759
  * @param autoSave 默认开启自动保存
760
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
759
761
  */
760
762
  toggleAutoSave(autoSave?: boolean): void;
761
763
  /**
762
764
  * 获取当前是否开启了自动保存
763
765
  *
764
766
  * @example
767
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
765
768
  * ```typescript
766
769
  * fittingDesignService.isAutoSave();
767
770
  * ```
@@ -774,8 +777,8 @@ export declare class FittingDesignService extends BaseService {
774
777
  * ```typescript
775
778
  * fittingDesignService.getFittingDesignData();
776
779
  * ```
777
- *
778
780
  * @param modelId 方案模型的ID,当没传时,就是获取场景中,正在预览的模型ID的方案数据
781
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
779
782
  */
780
783
  getFittingDesignData(modelId?: string): Promise<IFittingDesignData | null>;
781
784
  /**
@@ -794,6 +797,7 @@ export declare class FittingDesignService extends BaseService {
794
797
  *
795
798
  * @param modelid 模型ID,如果为空时,则表示传递的为查询当前正在编辑的模型的方案数据
796
799
  * @param casbin 是否为五金,当modelid为五金的id时,需要为true
800
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
797
801
  */
798
802
  getConnectedFittingDesign(modelid?: string, casbin?: boolean): Promise<IFittingDesignData | null>;
799
803
  /**
@@ -819,6 +823,7 @@ export declare class FittingDesignService extends BaseService {
819
823
  *
820
824
  * @param design 孔/槽方案信息
821
825
  * @param option { timeout, save} 调用超时,save 是否立即保存至后端,默认为true
826
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
822
827
  */
823
828
  appendFittingDesign(design: Partial<IFittingDesignData>, option?: {
824
829
  /**
@@ -846,6 +851,7 @@ export declare class FittingDesignService extends BaseService {
846
851
  *
847
852
  * @param design 需要保存的方案信息
848
853
  * @param option
854
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
849
855
  */
850
856
  saveDesign(design?: IFittingDesignData, option?: {
851
857
  timeout?: number;
@@ -861,8 +867,25 @@ export declare class FittingDesignService extends BaseService {
861
867
  * await fittingDesignService.clearDesign();
862
868
  * ```
863
869
  * @param options
870
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
864
871
  */
865
872
  clearDesign(options?: IBaseOptions): Promise<void>;
873
+ /**
874
+ * 渲染五金孔槽数据到场景中,不影响五金孔槽数据保存
875
+ *
876
+ * @param option.data 五金孔槽数据
877
+ * ```
878
+ * const fittingData = getFittingData(); // 获取五金孔槽数据
879
+ * viewFitting({ data: fittingData }); // 初次渲染
880
+ *
881
+ * const newFittingData = getFittingData(); // 新的五金孔槽数据
882
+ * viewFitting({ data: newFittingData }); // 更新场景内展示的五金孔槽
883
+ * viewFitting({}); // 清除场景内展示的五金孔槽
884
+ * ```
885
+ */
886
+ viewFitting(option?: {
887
+ data?: IFittingDesignData;
888
+ }): void;
866
889
  }
867
890
 
868
891
  /**
@@ -980,6 +1003,7 @@ export declare class FittingDesignService extends BaseService {
980
1003
 
981
1004
  /**
982
1005
  * 交接信息
1006
+ * @vm-type UnknownType
983
1007
  */
984
1008
  export declare interface IBaseIntersected {
985
1009
  /**
@@ -1033,6 +1057,7 @@ export declare class FittingDesignService extends BaseService {
1033
1057
 
1034
1058
  /**
1035
1059
  * 自定议参数
1060
+ * @vm-type IBzParamType
1036
1061
  */
1037
1062
  declare interface IBzParamModelLiteProperty<T extends number | string | boolean = string> {
1038
1063
  /**
@@ -1657,7 +1682,7 @@ export declare class FittingDesignService extends BaseService {
1657
1682
  * ]
1658
1683
  * },
1659
1684
  * "89D2793C-2B23-41A9-BA6E-4E3FS8490057": {
1660
- * // 自定议高亮配置信息
1685
+ * // 自定义高亮配置信息
1661
1686
  * "hintBorder": {
1662
1687
  * "color": "#234432",
1663
1688
  * "opacity": 0.8
@@ -2013,6 +2038,7 @@ export declare class FittingDesignService extends BaseService {
2013
2038
 
2014
2039
  /**
2015
2040
  * 模型的参数信息
2041
+ * @vm-type IParamType
2016
2042
  */
2017
2043
  declare interface IParamModelLiteParam<T = any> {
2018
2044
  /**
@@ -2085,13 +2111,21 @@ export declare class FittingDesignService extends BaseService {
2085
2111
  export declare interface IPlankArea {
2086
2112
  /**
2087
2113
  * 由板件原始轮廓数据解析出的所有路径
2114
+ * >包含一个外轮廓路径和任意个内部轮廓路径
2088
2115
  */
2089
2116
  paths: IPlankPath[];
2090
2117
 
2091
2118
  /**
2092
- * 对板件原始轮廓数据进行非直角端点处理、重合、偏移计算后的实际展示路径
2119
+ * 对板件原始轮廓数据进行非直角端点处理、重合、偏移计算后的实际展示路径,高亮时会将轮廓中心点放置到 (0, 0)
2120
+ * @param option.resetCenter 是否重置轮廓中心点为 (0, 0),默认为true
2121
+ * @param option.force 忽略计算缓存,同一个PlankArea对象,getRealPaths计算结果会被缓存,默认为false
2093
2122
  */
2094
- getRealPaths(): IPlankArea;
2123
+ getRealPaths(option?: { resetCenter?: boolean; force?: boolean }): IPlankArea;
2124
+
2125
+ /**
2126
+ * 获取外轮廓路径中心点坐标
2127
+ */
2128
+ getCenterPoint(): Number2_2;
2095
2129
  }
2096
2130
 
2097
2131
  /**
@@ -2881,7 +2915,7 @@ export declare class FittingDesignService extends BaseService {
2881
2915
  * ]
2882
2916
  * },
2883
2917
  * "89D2793C-2B23-41A9-BA6E-4E3FS8490057": {
2884
- * // 自定议标识颜色
2918
+ * // 自定义标识颜色
2885
2919
  * "hintBorder": {
2886
2920
  * "color": "#234432",
2887
2921
  * "opacity": 0.8
@@ -2952,6 +2986,7 @@ export declare class FittingDesignService extends BaseService {
2952
2986
  * ```
2953
2987
  *
2954
2988
  * @param options
2989
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
2955
2990
  */
2956
2991
  getParamData(options?: IGetParamModelJsonOption): Promise<any>;
2957
2992
  /**
@@ -2978,8 +3013,15 @@ export declare class FittingDesignService extends BaseService {
2978
3013
  * 获取方案顶层模型列表
2979
3014
  * @param options
2980
3015
  * @param options.ignoreCategory 真分类id过滤,默认值 CUSTOM_MODEL_CATEGORY_FILTER
3016
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
2981
3017
  */
2982
3018
  getTopParamModels(options?: ITopParamModelListOption): Promise<ITopParamModelDataResponse>;
3019
+ /**
3020
+ * 获取模型缩略图信息
3021
+ * @param modelId
3022
+ * @returns 模型缩略图信息
3023
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3024
+ */
2983
3025
  getParamModelPhotoById(modelId: string | string[]): Promise<IParamModelPhotoResponse[]>;
2984
3026
  }
2985
3027
 
@@ -3000,6 +3042,7 @@ export declare class FittingDesignService extends BaseService {
3000
3042
  * 主要是用来与场景交互的,监听当前选中的对象, 获取选中的内容
3001
3043
  *
3002
3044
  * @example
3045
+ * @deprecated a legacy service in sdk(version >= 2.0.0).
3003
3046
  * ```typescript
3004
3047
  * const viewerSelectionService = application.getService(ModelViewerSelectionService);
3005
3048
  * ```
@@ -3013,6 +3056,7 @@ export declare class FittingDesignService extends BaseService {
3013
3056
  private hasWatchSelectionChange;
3014
3057
  /**
3015
3058
  * 获取当前选中的数据
3059
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3016
3060
  */
3017
3061
  getSelected(): ISelected;
3018
3062
  /**
@@ -3020,6 +3064,7 @@ export declare class FittingDesignService extends BaseService {
3020
3064
  * 同时选中多个模型暂未支持,请勿使用
3021
3065
  * @param option ISetSelectedByIdOption
3022
3066
  * @example
3067
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3023
3068
  * ```
3024
3069
  * const viewerSelectionService = application.getService(ModelViewerSelectionService);
3025
3070
  * const selectOption = {
@@ -3036,6 +3081,7 @@ export declare class FittingDesignService extends BaseService {
3036
3081
  * 同时取消多个模型暂未支持,请勿使用
3037
3082
  * @param option
3038
3083
  * @example
3084
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3039
3085
  * ```
3040
3086
  * const viewerSelectionService = application.getService(ModelViewerSelectionService);
3041
3087
  * const selectOption = {
@@ -3069,16 +3115,19 @@ export declare class FittingDesignService extends BaseService {
3069
3115
  /**
3070
3116
  * 监听当前选中内容
3071
3117
  * @param fn
3118
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3072
3119
  */
3073
3120
  on(fn: (param: ISelected) => any): void;
3074
3121
  /**
3075
3122
  * 取消监听选中变化
3076
3123
  * @param fn
3124
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3077
3125
  */
3078
3126
  off(fn?: (param: ISelected) => any): void;
3079
3127
  /**
3080
3128
  * 监听当前选中的内容(触发一次后自动取消)
3081
3129
  * @param fn
3130
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3082
3131
  */
3083
3132
  once(fn: (param: ISelected) => any): void;
3084
3133
  /**
@@ -3177,14 +3226,23 @@ export declare class FittingDesignService extends BaseService {
3177
3226
  *
3178
3227
  * 此方法,会成Application.start方法中,默认执行
3179
3228
  *
3229
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3180
3230
  */
3181
3231
  viewSelected(): Promise<void>;
3182
3232
  /**
3183
3233
  * 指定模型的 ID,将当前模型加载到工具方案当中
3184
3234
  *
3185
3235
  * @param id 模型ID
3236
+ * @deprecated a legacy api in sdk(version >= 2.0.0).
3186
3237
  */
3187
3238
  viewModelById(id: string | string[]): Promise<void>;
3239
+ /**
3240
+ * 通过模型id渲染指定模型
3241
+ * >目前仅支持顶层模型、组合渲染
3242
+ */
3243
+ viewParamModel({ id }: {
3244
+ id: string;
3245
+ }): Promise<void>;
3188
3246
  /**
3189
3247
  * 重置视图展示视角
3190
3248
  */