ms-types 0.0.27 → 0.0.29

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.0.27",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/file.d.ts CHANGED
@@ -52,6 +52,14 @@ declare namespace file {
52
52
  * @example file.readFile("config.json")
53
53
  */
54
54
  function readFile(path: string): string;
55
+ /**
56
+ * 读取资源文件
57
+ * @param fileName 文件名
58
+ * @returns 文件内容
59
+ * @example
60
+ * file.readResFile("test.txt")
61
+ */
62
+ function readResFile(fileName: string): string | null;
55
63
  /**
56
64
  * 删除文件内容
57
65
  * @param path 文件路径
package/types/image.d.ts CHANGED
@@ -70,6 +70,14 @@ declare namespace image {
70
70
  * image.release(imageId)
71
71
  */
72
72
  function readImage(path: string): string | null;
73
+ /**
74
+ * 读取资源图片
75
+ * @param fileName 文件名
76
+ * @returns 图片id ,如果读取失败则返回null
77
+ * @example
78
+ * image.readResImage("test.png")
79
+ */
80
+ function readResImage(fileName: string): string | null;
73
81
  /**
74
82
  * 旋转图片
75
83
  * @param imageId 图片id
package/types/system.d.ts CHANGED
@@ -159,6 +159,14 @@ declare namespace system {
159
159
  * logger.info(`可用内存: ${availableMemory}MB`)
160
160
  */
161
161
  function getAvailableMemory(): number;
162
+ /**
163
+ * 获取系统总内存
164
+ * @returns 系统总内存大小(单位:MB)
165
+ * @example
166
+ * const totalMemory = system.getTotalMemory()
167
+ * logger.info(`系统总内存: ${totalMemory}MB`)
168
+ */
169
+ function getTotalMemory(): number;
162
170
  /**
163
171
  * 启动 WDA 服务
164
172
  * @returns 是否启动成功
package/types/utils.d.ts CHANGED
@@ -10,22 +10,6 @@ declare namespace utils {
10
10
  * utils.timeFormat("yyyy-MM-dd hh:mm:ss")
11
11
  */
12
12
  function timeFormat(format: string): string;
13
- /**
14
- * 读取资源文件
15
- * @param fileName 文件名
16
- * @returns 文件内容
17
- * @example
18
- * utils.readResFile("test.txt")
19
- */
20
- function readResFile(fileName: string): string | null;
21
- /**
22
- * 读取资源图片
23
- * @param fileName 文件名
24
- * @returns 返回 image 模块的 imageId
25
- * @example
26
- * utils.readResImage("test.png")
27
- */
28
- function readResImage(fileName: string): string | null;
29
13
  /**
30
14
  * 生成随机数
31
15
  * @param min 最小值