@manycore/custom-sdk 2.0.0 → 2.1.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.
- package/index.d.ts +44 -0
- package/index.js +18 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3,6 +3,30 @@ import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
|
|
|
3
3
|
import { IServClientService } from 'servkit';
|
|
4
4
|
import { Number2 as Number2_2 } from '@manycore/custom-miniapp-sdk';
|
|
5
5
|
import { ServService } from 'servkit';
|
|
6
|
+
import { ServServiceMeta } from 'servkit';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 小程序发射器
|
|
10
|
+
* 用于启动可运行于设计工具外的小程序
|
|
11
|
+
*/
|
|
12
|
+
export declare class AppBooter {
|
|
13
|
+
/** 设计工具信道 */
|
|
14
|
+
private sappSDK;
|
|
15
|
+
private readonly serverDefer;
|
|
16
|
+
/** 独立工具信道 */
|
|
17
|
+
private readonly proxyTerminals;
|
|
18
|
+
private getCustomMiniAppService;
|
|
19
|
+
constructor(option?: IApplicationStartOption);
|
|
20
|
+
initializeServer: (option?: ITerminalConfig | undefined) => Promise<ServServiceMeta[]>;
|
|
21
|
+
/**
|
|
22
|
+
* 启动的小程序地址
|
|
23
|
+
* @param openParam.url 打开的小程序地址
|
|
24
|
+
* @returns {Window} 打开的小程序引用
|
|
25
|
+
*/
|
|
26
|
+
bootstrap(openParam: {
|
|
27
|
+
url: string;
|
|
28
|
+
}): Promise<Window>;
|
|
29
|
+
}
|
|
6
30
|
|
|
7
31
|
/**
|
|
8
32
|
* app 配置服务
|
|
@@ -33,6 +57,26 @@ export declare class Application {
|
|
|
33
57
|
* 判断当前是否在定制小程序下运行
|
|
34
58
|
*/
|
|
35
59
|
isInCustomMiniAppMode(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 判断是否是独立小程序
|
|
62
|
+
*/
|
|
63
|
+
static isIndependentMiniApp(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* 获取宿主
|
|
66
|
+
* 可以通过postMessage和onMessageReceive实现与宿主的双向通信
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
getHost: () => {
|
|
70
|
+
/** 启动器窗口的引用 */
|
|
71
|
+
booter?: Window | undefined;
|
|
72
|
+
/** 向宿主发送消息 */
|
|
73
|
+
postMessage: (message: any, targetOrigin?: string | undefined) => void;
|
|
74
|
+
/** 从宿主接受消息 */
|
|
75
|
+
onMessageReceive: (fn: (ev: {
|
|
76
|
+
data: any;
|
|
77
|
+
origin: string;
|
|
78
|
+
}) => void) => void;
|
|
79
|
+
};
|
|
36
80
|
/**
|
|
37
81
|
* 添加调试的utils
|
|
38
82
|
* - 获取已初始化的service
|