ms-types 0.4.9 → 0.4.11

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.9",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/global.d.ts CHANGED
@@ -201,6 +201,16 @@ declare function logw(...args: any[]): void;
201
201
  */
202
202
  declare function loge(...args: any[]): void;
203
203
 
204
+ /**
205
+ * 导入类 (仅安卓可用)
206
+ * @param className 类名
207
+ * @returns 类对象
208
+ * @description 导入类对象
209
+ * @example
210
+ * const clazz = importClass("com.example.TestClass");
211
+ */
212
+ declare function importClass(className: string): any;
213
+
204
214
  /**
205
215
  * 加载 dex 文件 (仅安卓可用)
206
216
  * @param path dex 文件路径 支持apk文件
@@ -214,5 +224,7 @@ declare function loadDex(path: string): void;
214
224
  * 获取当前上下文 (仅安卓可用)
215
225
  * @returns 当前上下文
216
226
  * @description 获取当前上下文
227
+ * @example
228
+ * const context = getContext();
217
229
  */
218
230
  declare function getContext(): any;
@@ -184,3 +184,37 @@ declare function $打印警告日志(...日志内容: 数组<任意类型>): 无
184
184
  * $打印错误日志("文件读取错误");
185
185
  */
186
186
  declare function $打印错误日志(...日志内容: 数组<任意类型>): 无返回值;
187
+
188
+ /**
189
+ * 导入类
190
+ * @param 类名
191
+ * @returns 类对象
192
+ * @description 导入类对象
193
+ * @example
194
+ * const clazz = $导入类("com.example.TestClass");
195
+ */
196
+ declare function $导入类(类名: 字符串): 任意类型;
197
+
198
+ /**
199
+ * 加载Dex文件 (仅安卓可用)
200
+ * @param Dex文件路径 支持apk文件
201
+ * @returns 是否加载成功
202
+ * @description 加载Dex文件到内存中
203
+ * @example
204
+ * const 是否加载成功 = $加载Dex("/sdcard/script.dex");
205
+ * if (是否加载成功) {
206
+ * $打印信息日志("Dex 文件加载成功");
207
+ * } else {
208
+ * $打印错误日志("Dex 文件加载失败");
209
+ * }
210
+ */
211
+ declare function $加载Dex(Dex文件路径: 字符串): 布尔值;
212
+
213
+ /**
214
+ * 获取安卓上下文 (仅安卓可用)
215
+ * @returns 上下文对象
216
+ * @description 获取当前安卓上下文对象
217
+ * @example
218
+ * const 上下文 = $获取上下文();
219
+ */
220
+ declare function $获取上下文(): 任意类型;