ms-types 0.5.6 → 0.5.8
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-types",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"vitepress": "^1.6.4",
|
|
20
|
-
"vitepress-theme-teek": "^1.5.
|
|
21
|
-
"wrangler": "^4.
|
|
20
|
+
"vitepress-theme-teek": "^1.5.6",
|
|
21
|
+
"wrangler": "^4.81.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/types/hotUpdate.d.ts
CHANGED
|
@@ -35,31 +35,14 @@ declare namespace hotUpdate {
|
|
|
35
35
|
md5?: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* 热更新配置选项
|
|
40
|
-
*/
|
|
41
|
-
interface HotUpdateOptions {
|
|
42
|
-
/** 检查更新的服务器URL,未提供时从 package.json 的 update.url 读取 */
|
|
43
|
-
url?: string;
|
|
44
|
-
/** 当前版本号,未提供时从 package.json 的 appVersion 读取 */
|
|
45
|
-
version?: number;
|
|
46
|
-
/** 超时时间(毫秒),未提供时从 package.json 的 update.timeout 读取,默认10000毫秒 */
|
|
47
|
-
timeout?: number;
|
|
48
|
-
}
|
|
49
38
|
/**
|
|
50
39
|
* 检查更新(同步调用)
|
|
51
|
-
* @param options 更新配置选项(可选,不传则从package.json读取配置)
|
|
52
40
|
* @returns 检查结果
|
|
53
41
|
*
|
|
54
42
|
* @example
|
|
55
|
-
* //
|
|
43
|
+
* // 检查更新
|
|
56
44
|
* const result = hotUpdate.checkUpdate();
|
|
57
45
|
*
|
|
58
|
-
* // 或者传入自定义配置
|
|
59
|
-
* const result2 = hotUpdate.checkUpdate({
|
|
60
|
-
* url: 'https://api.example.com/check-update'
|
|
61
|
-
* });
|
|
62
|
-
*
|
|
63
46
|
* if (result.needUpdate) {
|
|
64
47
|
* logi('发现新版本');
|
|
65
48
|
* // 手动决定是否更新
|
|
@@ -69,7 +52,7 @@ declare namespace hotUpdate {
|
|
|
69
52
|
* loge('检查更新失败:', result.error);
|
|
70
53
|
* }
|
|
71
54
|
*/
|
|
72
|
-
function checkUpdate(
|
|
55
|
+
function checkUpdate(): HotUpdateResult;
|
|
73
56
|
|
|
74
57
|
/**
|
|
75
58
|
* 手动下载并安装更新, 执行成功后会自动重启脚本
|
package/types/system.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ declare namespace system {
|
|
|
8
8
|
pid: number;
|
|
9
9
|
} | null;
|
|
10
10
|
|
|
11
|
+
type InstalledAppInfo = {
|
|
12
|
+
bundleVersion: string;
|
|
13
|
+
appName: string;
|
|
14
|
+
bundleIdentifier: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
/**
|
|
12
18
|
* 启动应用
|
|
13
19
|
* @param bundleId 应用bundleId
|
|
@@ -52,6 +58,26 @@ declare namespace system {
|
|
|
52
58
|
* }
|
|
53
59
|
*/
|
|
54
60
|
function activateAppInfo(): AppInfo;
|
|
61
|
+
/**
|
|
62
|
+
* 获取后台运行的应用列表
|
|
63
|
+
* @returns 包含应用信息的字典数组,每个字典包含应用的Bundle ID和显示名称
|
|
64
|
+
* @example
|
|
65
|
+
* const apps = system.backgroundAppInfos()
|
|
66
|
+
* if (apps.length > 0) {
|
|
67
|
+
* logi(apps[0].name)
|
|
68
|
+
* }
|
|
69
|
+
*/
|
|
70
|
+
function backgroundAppInfos(): AppInfo[];
|
|
71
|
+
/**
|
|
72
|
+
* 获取安装的应用列表
|
|
73
|
+
* @returns 包含应用信息的字典数组,每个字典包含应用的Bundle ID和显示名称
|
|
74
|
+
* @example
|
|
75
|
+
* const apps = system.getInstalledAppList()
|
|
76
|
+
* if (apps.length > 0) {
|
|
77
|
+
* logi(apps[0].appName)
|
|
78
|
+
* }
|
|
79
|
+
*/
|
|
80
|
+
function getInstalledAppList(): InstalledAppInfo[];
|
|
55
81
|
/**
|
|
56
82
|
* 获取系统是否锁屏
|
|
57
83
|
* @returns 是否锁屏
|
|
@@ -33,32 +33,14 @@ declare namespace $热更新 {
|
|
|
33
33
|
md5?: 字符串;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* 热更新配置选项
|
|
38
|
-
*/
|
|
39
|
-
interface 热更新参数 {
|
|
40
|
-
/** 检查更新的服务器URL,未提供时从 package.json 的 update.url 读取 */
|
|
41
|
-
url?: 字符串;
|
|
42
|
-
/** 当前版本号,未提供时从 package.json 的 appVersion 读取 */
|
|
43
|
-
version?: 数字;
|
|
44
|
-
/** 超时时间(毫秒),未提供时从 package.json 的 update.timeout 读取,默认10000毫秒 */
|
|
45
|
-
timeout?: 数字;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
36
|
/**
|
|
49
37
|
* 检查更新(同步调用)
|
|
50
|
-
* @param options 更新配置选项(可选,不传则从package.json读取配置)
|
|
51
38
|
* @returns 检查结果
|
|
52
39
|
*
|
|
53
40
|
* @example
|
|
54
|
-
* //
|
|
41
|
+
* // 检查更新
|
|
55
42
|
* const 热更新检查结果 = $热更新.检查更新();
|
|
56
43
|
*
|
|
57
|
-
* // 或者传入自定义配置
|
|
58
|
-
* const 热更新检查结果2 = $热更新.检查更新({
|
|
59
|
-
* url: 'https://api.example.com/check-update'
|
|
60
|
-
* });
|
|
61
|
-
*
|
|
62
44
|
* if (热更新检查结果.needUpdate) {
|
|
63
45
|
* $打印信息日志('发现新版本');
|
|
64
46
|
* // 手动决定是否更新
|
|
@@ -68,7 +50,7 @@ declare namespace $热更新 {
|
|
|
68
50
|
* $打印错误日志('检查更新失败:', 热更新检查结果.error);
|
|
69
51
|
* }
|
|
70
52
|
*/
|
|
71
|
-
function 检查更新(
|
|
53
|
+
function 检查更新(): 热更新检查结果;
|
|
72
54
|
|
|
73
55
|
/**
|
|
74
56
|
* 手动下载并安装更新, 执行成功后会自动重启脚本
|
|
@@ -8,6 +8,13 @@ declare namespace $系统 {
|
|
|
8
8
|
name: string;
|
|
9
9
|
pid: number;
|
|
10
10
|
} | null;
|
|
11
|
+
|
|
12
|
+
type 安装应用信息 = {
|
|
13
|
+
bundleVersion: string;
|
|
14
|
+
appName: string;
|
|
15
|
+
bundleIdentifier: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
11
18
|
/**
|
|
12
19
|
* 启动应用
|
|
13
20
|
* @param bundleId 应用bundleId
|
|
@@ -51,6 +58,26 @@ declare namespace $系统 {
|
|
|
51
58
|
* }
|
|
52
59
|
*/
|
|
53
60
|
function 获取当前运行的应用(): APP信息;
|
|
61
|
+
/**
|
|
62
|
+
* 获取后台运行的应用列表
|
|
63
|
+
* @returns 包含应用信息的字典数组,每个字典包含应用的Bundle ID和显示名称
|
|
64
|
+
* @example
|
|
65
|
+
* const apps = $系统.获取后台运行的应用()
|
|
66
|
+
* if (apps.length > 0) {
|
|
67
|
+
* $打印信息日志(apps[0].name)
|
|
68
|
+
* }
|
|
69
|
+
*/
|
|
70
|
+
function 获取后台运行的应用列表(): APP信息[];
|
|
71
|
+
/**
|
|
72
|
+
* 获取安装的应用列表
|
|
73
|
+
* @returns 包含应用信息的字典数组,每个字典包含应用的Bundle ID和显示名称
|
|
74
|
+
* @example
|
|
75
|
+
* const apps = $系统.获取安装的应用列表()
|
|
76
|
+
* if (apps.length > 0) {
|
|
77
|
+
* $打印信息日志(apps[0].name)
|
|
78
|
+
* }
|
|
79
|
+
*/
|
|
80
|
+
function 获取安装的应用列表(): 安装应用信息[];
|
|
54
81
|
/**
|
|
55
82
|
* 获取系统是否锁屏
|
|
56
83
|
* @returns 是否锁屏
|