ms-types 0.4.28 → 0.5.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/package.json
CHANGED
package/types/system.d.ts
CHANGED
|
@@ -6,17 +6,11 @@ declare namespace system {
|
|
|
6
6
|
bundleId: string;
|
|
7
7
|
name: string;
|
|
8
8
|
pid: number;
|
|
9
|
-
processArguments: {
|
|
10
|
-
env: Record<string, any>;
|
|
11
|
-
args: string[];
|
|
12
|
-
};
|
|
13
9
|
} | null;
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
12
|
* 启动应用
|
|
17
13
|
* @param bundleId 应用bundleId
|
|
18
|
-
* @param args 应用参数
|
|
19
|
-
* @param env 应用环境变量
|
|
20
14
|
* @returns 是否启动成功
|
|
21
15
|
* @example
|
|
22
16
|
* const started = system.startApp("cn.magicnode.script")
|
|
@@ -24,11 +18,7 @@ declare namespace system {
|
|
|
24
18
|
* logi("启动成功")
|
|
25
19
|
* }
|
|
26
20
|
*/
|
|
27
|
-
function startApp(
|
|
28
|
-
bundleId: string,
|
|
29
|
-
args?: string[],
|
|
30
|
-
env?: Record<string, any>,
|
|
31
|
-
): boolean;
|
|
21
|
+
function startApp(bundleId: string): boolean;
|
|
32
22
|
/**
|
|
33
23
|
* 关闭应用
|
|
34
24
|
* @param bundleId 应用bundleId
|
|
@@ -181,6 +171,16 @@ declare namespace system {
|
|
|
181
171
|
* }
|
|
182
172
|
*/
|
|
183
173
|
function startAgent(): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* 关闭 Agent 服务
|
|
176
|
+
* @returns 是否关闭成功
|
|
177
|
+
* @example
|
|
178
|
+
* const stopped = system.stopAgent()
|
|
179
|
+
* if (stopped) {
|
|
180
|
+
* logi("Agent 服务关闭成功")
|
|
181
|
+
* }
|
|
182
|
+
*/
|
|
183
|
+
function stopAgent(): boolean;
|
|
184
184
|
/**
|
|
185
185
|
* 获取 Agent 状态
|
|
186
186
|
* @returns Agent 是否正在运行
|
package/types/ui.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace ms {
|
|
|
6
6
|
*/
|
|
7
7
|
function registerUIFunc(
|
|
8
8
|
name: string,
|
|
9
|
-
func: (data: Record<string, any>) => void
|
|
9
|
+
func: (data: Record<string, any>) => void,
|
|
10
10
|
): void;
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -87,6 +87,12 @@ declare namespace ms {
|
|
|
87
87
|
*/
|
|
88
88
|
function startAgent(): Promise<boolean>;
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* 停止Agent服务
|
|
92
|
+
* @returns 如果调用成功返回true,否则返回false。注意:返回值仅表示调用是否成功,不代表Agent服务是否停止成功
|
|
93
|
+
*/
|
|
94
|
+
function stopAgent(): Promise<boolean>;
|
|
95
|
+
|
|
90
96
|
/**
|
|
91
97
|
* 打开URL
|
|
92
98
|
* @param url URL地址
|
|
@@ -114,7 +120,7 @@ declare namespace ui {
|
|
|
114
120
|
* })
|
|
115
121
|
*/
|
|
116
122
|
function onEvent(
|
|
117
|
-
event: (event: string, data: Record<string, any>) => void
|
|
123
|
+
event: (event: string, data: Record<string, any>) => void,
|
|
118
124
|
): void;
|
|
119
125
|
|
|
120
126
|
/**
|
|
@@ -7,16 +7,10 @@ declare namespace $系统 {
|
|
|
7
7
|
bundleId: string;
|
|
8
8
|
name: string;
|
|
9
9
|
pid: number;
|
|
10
|
-
processArguments: {
|
|
11
|
-
env: Record<string, any>;
|
|
12
|
-
args: string[];
|
|
13
|
-
};
|
|
14
10
|
} | null;
|
|
15
11
|
/**
|
|
16
12
|
* 启动应用
|
|
17
13
|
* @param bundleId 应用bundleId
|
|
18
|
-
* @param args 应用参数
|
|
19
|
-
* @param env 应用环境变量
|
|
20
14
|
* @returns 是否启动成功
|
|
21
15
|
* @example
|
|
22
16
|
* const 是否启动成功 = $系统.启动应用("cn.magicnode.script")
|
|
@@ -24,11 +18,7 @@ declare namespace $系统 {
|
|
|
24
18
|
* $打印信息日志("启动成功")
|
|
25
19
|
* }
|
|
26
20
|
*/
|
|
27
|
-
function 启动应用(
|
|
28
|
-
bundleId: 字符串,
|
|
29
|
-
args?: 字符串[],
|
|
30
|
-
env?: 字典<任意类型>,
|
|
31
|
-
): 布尔值;
|
|
21
|
+
function 启动应用(bundleId: 字符串): 布尔值;
|
|
32
22
|
/**
|
|
33
23
|
* 停止应用
|
|
34
24
|
* @param bundleId 应用bundleId
|
|
@@ -181,6 +171,17 @@ declare namespace $系统 {
|
|
|
181
171
|
*/
|
|
182
172
|
function 启动Agent服务(): 布尔值;
|
|
183
173
|
|
|
174
|
+
/**
|
|
175
|
+
* 关闭 Agent 服务
|
|
176
|
+
* @returns 是否关闭成功
|
|
177
|
+
* @example
|
|
178
|
+
* const 是否关闭成功 = $系统.关闭Agent服务()
|
|
179
|
+
* if (是否关闭成功) {
|
|
180
|
+
* $打印信息日志("Agent 服务关闭成功")
|
|
181
|
+
* }
|
|
182
|
+
*/
|
|
183
|
+
function 关闭Agent服务(): 布尔值;
|
|
184
|
+
|
|
184
185
|
/**
|
|
185
186
|
* 获取 Agent 状态
|
|
186
187
|
* @returns Agent 是否正在运行
|