ms-types 0.4.5 → 0.4.7

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.4.5",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/config.d.ts CHANGED
@@ -8,6 +8,13 @@ declare namespace config {
8
8
  * @example config.all()
9
9
  */
10
10
  function all(): Record<string, any>;
11
+ /**
12
+ * 设置所有配置项
13
+ * @param config 包含所有配置项的字典
14
+ * @returns 如果设置成功返回true,否则返回false
15
+ * @example config.setAll({"key": 100})
16
+ */
17
+ function setAll(config: Record<string, any>): boolean;
11
18
  /**
12
19
  * 设置配置
13
20
  * @param key 配置key
package/types/global.d.ts CHANGED
@@ -2,6 +2,11 @@
2
2
  * 是否是调试模式
3
3
  */
4
4
  declare const __debug__: boolean;
5
+ /**
6
+ * 平台标识
7
+ */
8
+ declare const __platform__: "ios" | "android";
9
+ /**
5
10
  /**
6
11
  * 应用版本
7
12
  */
@@ -195,3 +200,21 @@ declare function logw(...args: any[]): void;
195
200
  * loge("文件读取错误");
196
201
  */
197
202
  declare function loge(...args: any[]): void;
203
+
204
+ /**
205
+ * 加载 dex 文件 (仅安卓可用)
206
+ * @param path dex 文件路径
207
+ * @description 加载 dex 文件到内存中
208
+ * @example
209
+ * loadDex("test.dex");
210
+ */
211
+ declare function loadDex(path: string): void;
212
+
213
+ /**
214
+ * 加载 apk 文件 (仅安卓可用)
215
+ * @param path apk 文件路径
216
+ * @description 加载 apk 文件到内存中
217
+ * @example
218
+ * loadApk("test.apk");
219
+ */
220
+ declare function loadApk(path: string): void;
package/types/ui.d.ts CHANGED
@@ -62,6 +62,13 @@ declare namespace ms {
62
62
  */
63
63
  function getAllConfig(): Promise<Record<string, any>>;
64
64
 
65
+ /**
66
+ * 设置所有配置项
67
+ * @param config 包含所有配置项的字典
68
+ * @returns 如果设置成功返回true,否则返回false
69
+ */
70
+ function setAllConfig(config: Record<string, any>): Promise<boolean>;
71
+
65
72
  /**
66
73
  * 获取服务器设备ID
67
74
  * @returns 服务器设备ID
@@ -11,6 +11,10 @@ declare type 无返回值 = void;
11
11
  * 是否是调试模式
12
12
  */
13
13
  declare const $是否调试: 布尔值;
14
+ /**
15
+ * 平台标识
16
+ */
17
+ declare const $平台: "ios" | "android";
14
18
  /**
15
19
  * 应用版本
16
20
  */
@@ -10,6 +10,13 @@ declare namespace $配置 {
10
10
  * @example $配置.所有配置()
11
11
  */
12
12
  function 所有配置(): 字典<任意类型>;
13
+ /**
14
+ * 设置所有配置项
15
+ * @param config 包含所有配置项的字典
16
+ * @returns 如果设置成功返回true,否则返回false
17
+ * @example $配置.设置所有({"key": 100})
18
+ */
19
+ function 设置所有(config: 字典<任意类型>): 布尔值;
13
20
  /**
14
21
  * 设置配置
15
22
  * @param 配置键 配置key