ms-types 0.5.7 → 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.7",
3
+ "version": "0.5.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
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 是否锁屏
@@ -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 是否锁屏