ms-types 0.0.26 → 0.0.27

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 (2) hide show
  1. package/package.json +1 -1
  2. package/types/system.d.ts +15 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/system.d.ts CHANGED
@@ -132,15 +132,16 @@ declare namespace system {
132
132
  function notify(msg: string, title: string, id: string): void;
133
133
  /**
134
134
  * 获取内存使用信息
135
- * @returns 内存使用信息,包含已使用内存、可用内存和总内存(单位:MB)
135
+ * @returns 内存使用信息,包含已使用内存、可用内存、总内存和使用率(单位:MB)
136
136
  * @example
137
137
  * const memInfo = system.getMemoryInfo()
138
- * logger.info(`已使用: ${memInfo.used}MB, 可用: ${memInfo.available}MB, 总计: ${memInfo.total}MB`)
138
+ * logger.info(`已使用: ${memInfo.used}MB, 可用: ${memInfo.available}MB, 总计: ${memInfo.total}MB, 使用率: ${memInfo.usagePercentage}%`)
139
139
  */
140
140
  function getMemoryInfo(): {
141
141
  used: number;
142
142
  available: number;
143
143
  total: number;
144
+ usagePercentage: number;
144
145
  };
145
146
  /**
146
147
  * 获取已使用内存
@@ -168,4 +169,16 @@ declare namespace system {
168
169
  * }
169
170
  */
170
171
  function startWDA(): boolean;
172
+ /**
173
+ * 获取 WDA 状态
174
+ * @returns WDA 是否正在运行
175
+ * @example
176
+ * const isRunning = system.getWDAStatus()
177
+ * if (isRunning) {
178
+ * logger.info("WDA 服务正在运行")
179
+ * } else {
180
+ * logger.info("WDA 服务未运行")
181
+ * }
182
+ */
183
+ function getWDAStatus(): boolean;
171
184
  }