@manycore/custom-sdk 1.7.0-rc.0 → 1.8.0-rc.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 +69 -4
  2. package/index.js +10 -10
  3. package/package.json +8 -3
package/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { ELineType as ELineType_2 } from '@manycore/custom-miniapp-sdk';
2
2
  import { IExportModelData } from '@manycore/custom-miniapp-sdk';
3
3
  import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
4
+ import { IServClientService } from 'servkit';
4
5
  import { Number3 } from '@manycore/custom-miniapp-sdk';
6
+ import { ServService } from 'servkit';
5
7
 
6
8
  declare interface AMap<K, V> {
7
9
  clear(): void;
@@ -22,8 +24,13 @@ declare interface AMap<K, V> {
22
24
  * ```
23
25
  */
24
26
  export declare class Application {
25
- constructor();
26
27
  private serviceMap;
28
+ private sappSDK;
29
+ constructor();
30
+ /**
31
+ * 判断当前是否在定制小程序下运行
32
+ */
33
+ isInCustomMiniAppMode(): boolean;
27
34
  /**
28
35
  * 启动对接2.0应用
29
36
  *
@@ -34,7 +41,7 @@ export declare class Application {
34
41
  * await application.start();
35
42
  * ```
36
43
  */
37
- start(): Promise<void>;
44
+ start(option?: IApplicationStartOption): Promise<void>;
38
45
  /**
39
46
  * 初始化语言类型(默认不需要处理)
40
47
  *
@@ -71,6 +78,44 @@ export declare class Application {
71
78
  getService<T extends BaseService>(serv: {
72
79
  new (): T;
73
80
  }): T;
81
+ /**
82
+ * 在对接2.0,提供调用定制小程序服务的能力,兼容历史代码
83
+ *
84
+ * 可以参见[定制小程序相关API](https://manual.kujiale.com/custom-miniapp-sdk/)
85
+ *
86
+ * @example
87
+ * ```
88
+ * import { CustomDesignParamModelService } from '@manycore/custom-miniapp-sdk';
89
+ *
90
+ * const s = application.getCustomMiniAppService(CustomDesignParamModelService);
91
+ * ```
92
+ *
93
+ */
94
+ getCustomMiniAppService<T extends typeof ServService>(decl: T): IServClientService<T> | undefined;
95
+ getCustomMiniAppService<M extends {
96
+ [key: string]: typeof ServService;
97
+ }>(decls: M): {
98
+ [key in keyof M]: IServClientService<M[key]> | undefined;
99
+ };
100
+ /**
101
+ * 在对接2.0,提供调用定制小程序服务的能力,兼容历史代码
102
+ *
103
+ * 可以参见[定制小程序相关API](https://manual.kujiale.com/custom-miniapp-sdk/)
104
+ *
105
+ * @example
106
+ * ```
107
+ * import { CustomDesignParamModelService } from '@manycore/custom-miniapp-sdk';
108
+ *
109
+ * const s = application.getCustomMiniAppServiceUnSafe(CustomDesignParamModelService);
110
+ * ```
111
+ *
112
+ */
113
+ getCustomMiniAppServiceUnSafe<T extends typeof ServService>(decl: T): IServClientService<T>;
114
+ getCustomMiniAppServiceUnSafe<M extends {
115
+ [key: string]: typeof ServService;
116
+ }>(decls: M): {
117
+ [key in keyof M]: IServClientService<M[key]>;
118
+ };
74
119
  }
75
120
 
76
121
  /**
@@ -595,6 +640,8 @@ export declare class FittingDesignService extends BaseService {
595
640
  }): Promise<void>;
596
641
  }
597
642
 
643
+ export declare type IApplicationStartOption = ITerminalConfig;
644
+
598
645
  /**
599
646
  * 孔槽数据基础示意
600
647
  */
@@ -837,9 +884,13 @@ export declare class FittingDesignService extends BaseService {
837
884
  export declare interface IGetParamModelJsonOption extends IBaseOptions {
838
885
  /**
839
886
  * 是否强制重新获取
840
- * @default true 默认值为true,当前浏览模型时,获取json数据时,将会缓存
887
+ * @default false 默认值为false,当获取正在查看的模型json数据时,默认情况会使用状态中的缓存数据,如果需要强制走后端重新获取,此字段需要传入true
841
888
  */
842
889
  force?: boolean;
890
+ /**
891
+ * 模板id
892
+ */
893
+ templateId?: string;
843
894
  }
844
895
 
845
896
  export declare interface IGrooveData extends IBaseHoleGrooveData {
@@ -1574,6 +1625,20 @@ export declare class FittingDesignService extends BaseService {
1574
1625
  grooveColor: number;
1575
1626
  }
1576
1627
 
1628
+ /**
1629
+ * 启动时,配置terminal信息
1630
+ */
1631
+ export declare interface ITerminalConfig {
1632
+ /**
1633
+ * 请输入clientId
1634
+ */
1635
+ clientId?: string;
1636
+ /**
1637
+ * 请输入连接超时时间
1638
+ */
1639
+ timeout?: number;
1640
+ }
1641
+
1577
1642
  /**
1578
1643
  * 展示交接信息时的筛选行为
1579
1644
  */
@@ -2031,7 +2096,7 @@ export declare class FittingDesignService extends BaseService {
2031
2096
  *
2032
2097
  * @example
2033
2098
  * ```typescript
2034
- * await modelService.getParamData();
2099
+ * await modelService.getParamIntersected();
2035
2100
  * ```
2036
2101
  *
2037
2102
  * @param options