mobile-web-bridge 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,37 @@
1
+ import type { GenericAsyncResult } from "./types";
2
+ declare const descriptorBrand: unique symbol;
3
+ type AsyncMethods<T> = {
4
+ [K in keyof T]: (params: never) => Promise<GenericAsyncResult<unknown>>;
5
+ };
6
+ type ReservedMethod = "on" | "then" | "catch" | "finally" | "toJSON" | "inspect" | "constructor" | "prototype" | "__proto__";
7
+ type SafeMethods<T> = Extract<keyof T, ReservedMethod> extends never ? unknown : {
8
+ readonly __reservedMethod: never;
9
+ };
10
+ /** 描述只含插件名和超时配置;方法与事件泛型不生成额外运行时清单。 */
11
+ export interface MWBNativePlugin<Name extends string = string, Methods = unknown, Events = unknown> {
12
+ readonly name: Name;
13
+ readonly timeoutMs: number;
14
+ readonly [descriptorBrand]: true;
15
+ readonly __types?: {
16
+ methods: Methods;
17
+ events: Events;
18
+ };
19
+ }
20
+ export type NativePluginAPI<Methods, Events> = Methods & {
21
+ on<K extends keyof Events & string>(name: K, handler: (data: Events[K]) => void): () => void;
22
+ };
23
+ export type NativePluginNamespaces<Plugins extends readonly MWBNativePlugin[]> = {
24
+ readonly [P in Plugins[number] as P["name"]]: P extends MWBNativePlugin<string, infer Methods, infer Events> ? NativePluginAPI<Methods, Events> : never;
25
+ };
26
+ /** 先指定业务类型,再让插件配置保留名字面量。 */
27
+ export declare function defineNativePlugin<Methods extends AsyncMethods<Methods>, Events = Record<never, never>>(): <const Name extends string>(options: {
28
+ name: Name;
29
+ timeoutMs?: number;
30
+ } & SafeMethods<Methods>) => MWBNativePlugin<Name, Methods, Events>;
31
+ /** 只查询原生注册,不把本地 JS 描述误报成已安装能力。 */
32
+ export declare function hasNativePlugin(name: string): Promise<boolean>;
33
+ /** 内置首屏通知复用插件身份与有界等待,不通过普通 basic 通道跨文档投递。 */
34
+ export declare function notifyPageReady(): Promise<GenericAsyncResult<void>>;
35
+ /** 在根对象只挂载插件命名空间,禁止覆盖 basic 或任何既有根方法。 */
36
+ export declare function attachNativePlugins(target: object, plugins: readonly MWBNativePlugin[]): void;
37
+ export {};
@@ -0,0 +1,37 @@
1
+ /** 官方 basic 包含现有原生方法;JS 句柄与事件由 assembleMWB 统一挂载。 */
2
+ export declare const basicPlugin: {
3
+ readonly name: "basic";
4
+ readonly methods: {
5
+ readonly setStorageSync: (key: string, data: any, groupName: string | undefined, validSecond: number | undefined) => void;
6
+ readonly getStorageSync: <T>(key: string, groupName?: string) => T | undefined;
7
+ readonly removeStorageSync: (key: string, groupName: string | undefined) => void;
8
+ readonly clearStorageSync: (groupName: string | undefined) => void;
9
+ readonly compressImage: (param: import("..").ParamCompressImage) => Promise<import("..").GenericAsyncResult<import("..").ReturnCompressImageResult>>;
10
+ readonly scanCode: (param: import("..").ParamScanCode) => Promise<import("..").GenericAsyncResult<import("..").ReturnScanCode>>;
11
+ readonly saveImageToPhotosAlbum: (param: import("..").ParamImageToPhotosAlbum) => Promise<import("..").GenericAsyncResult<undefined>>;
12
+ readonly chooseImage: (param: import("..").ParamChooseImage) => Promise<import("..").GenericAsyncResult<import("..").ReturnChooseImageResult>>;
13
+ readonly openFile: (param: import("..").ParamOpenFileInfo | undefined) => Promise<import("..").GenericAsyncResult<undefined>>;
14
+ readonly checkRequestCameraPermissions: (param: import("..").ParamCheckRequestCameraPermissions | undefined) => Promise<import("..").GenericAsyncResult<import("..").ReturnPermissionResult>>;
15
+ readonly convertImagePathToBase64: (param: import("..").ParamConvertImagePathToBase64 | undefined) => Promise<import("..").GenericAsyncResult<import("..").ReturnConvertImagePathToBase64Result>>;
16
+ readonly openAppAuthorizeSetting: () => Promise<import("..").GenericAsyncResult<undefined>>;
17
+ readonly getAppInfoSync: () => import("..").ReturnAppInfo;
18
+ readonly setBadgeCount: (param: import("..").ParamBadgeCount) => Promise<import("..").GenericAsyncResult<undefined>>;
19
+ readonly getDeviceInfoSync: () => import("..").ReturnDeviceInfo;
20
+ readonly getClipboardDataSync: () => import("..").ClipboardData;
21
+ readonly setClipboardData: (param: import("..").ClipboardData) => Promise<import("..").GenericAsyncResult<undefined>>;
22
+ readonly makePhoneCall: (param: import("..").ParamPhoneCall) => Promise<import("..").GenericAsyncResult<undefined>>;
23
+ readonly getNetworkTypeSync: () => import("..").ReturnNetworkType;
24
+ readonly getNotificationSwitchStatus: () => Promise<import("..").GenericAsyncResult<import("..").ReturnNotiSwitchStatus>>;
25
+ readonly notifyPageReady: typeof import("../nativePlugins").notifyPageReady;
26
+ readonly setEnableDebug: (enabled: boolean) => void;
27
+ readonly toast: (param: import("..").ParamToast) => Promise<import("..").GenericAsyncResult<undefined>>;
28
+ readonly navigateTo: (param: import("..").ParamNavigateTo) => Promise<import("..").GenericAsyncResult<undefined>>;
29
+ readonly navigateBack: (callbackInfo: Record<string, any> | undefined) => Promise<import("..").GenericAsyncResult<undefined>>;
30
+ readonly navigateBackToRoot: () => Promise<import("..").GenericAsyncResult<undefined>>;
31
+ readonly openExternalBrowser: (param: import("..").ParamExternalBrowse) => Promise<import("..").GenericAsyncResult<undefined>>;
32
+ readonly setNavigationBarTheme: (param: import("..").ParamNavigationBarTheme) => Promise<import("..").GenericAsyncResult<undefined>>;
33
+ readonly cleanWebviewCache: () => Promise<import("..").GenericAsyncResult<undefined>>;
34
+ readonly exitApp: () => Promise<import("..").GenericAsyncResult<undefined>>;
35
+ readonly openNativePage: (param: import("..").ParamOpenAppPage) => Promise<import("..").GenericAsyncResult<undefined>>;
36
+ };
37
+ };
@@ -0,0 +1,18 @@
1
+ import { notifyPageReady } from "../nativePlugins";
2
+ /** Web 容器和页面导航能力。 */
3
+ export declare const containerPlugin: {
4
+ readonly name: "container";
5
+ readonly methods: {
6
+ notifyPageReady: typeof notifyPageReady;
7
+ setEnableDebug(enabled: boolean): void;
8
+ toast(param: import("..").ParamToast): Promise<import("..").GenericAsyncResult<undefined>>;
9
+ navigateTo(param: import("..").ParamNavigateTo): Promise<import("..").GenericAsyncResult<undefined>>;
10
+ navigateBack(callbackInfo: Record<string, any> | undefined): Promise<import("..").GenericAsyncResult<undefined>>;
11
+ navigateBackToRoot(): Promise<import("..").GenericAsyncResult<undefined>>;
12
+ openExternalBrowser(param: import("..").ParamExternalBrowse): Promise<import("..").GenericAsyncResult<undefined>>;
13
+ setNavigationBarTheme(param: import("..").ParamNavigationBarTheme): Promise<import("..").GenericAsyncResult<undefined>>;
14
+ cleanWebviewCache(): Promise<import("..").GenericAsyncResult<undefined>>;
15
+ exitApp(): Promise<import("..").GenericAsyncResult<undefined>>;
16
+ openNativePage(param: import("..").ParamOpenAppPage): Promise<import("..").GenericAsyncResult<undefined>>;
17
+ };
18
+ };
@@ -0,0 +1,15 @@
1
+ /** 应用、设备及系统设置能力。 */
2
+ export declare const devicePlugin: {
3
+ readonly name: "device";
4
+ readonly methods: {
5
+ openAppAuthorizeSetting(): Promise<import("..").GenericAsyncResult<undefined>>;
6
+ getAppInfoSync(): import("..").ReturnAppInfo;
7
+ setBadgeCount(param: import("..").ParamBadgeCount): Promise<import("..").GenericAsyncResult<undefined>>;
8
+ getDeviceInfoSync(): import("..").ReturnDeviceInfo;
9
+ getClipboardDataSync(): import("..").ClipboardData;
10
+ setClipboardData(param: import("..").ClipboardData): Promise<import("..").GenericAsyncResult<undefined>>;
11
+ makePhoneCall(param: import("..").ParamPhoneCall): Promise<import("..").GenericAsyncResult<undefined>>;
12
+ getNetworkTypeSync(): import("..").ReturnNetworkType;
13
+ getNotificationSwitchStatus(): Promise<import("..").GenericAsyncResult<import("..").ReturnNotiSwitchStatus>>;
14
+ };
15
+ };
@@ -0,0 +1,13 @@
1
+ /** 图片、扫码、权限及文件能力。 */
2
+ export declare const mediaPlugin: {
3
+ readonly name: "media";
4
+ readonly methods: {
5
+ compressImage(param: import("..").ParamCompressImage): Promise<import("..").GenericAsyncResult<import("..").ReturnCompressImageResult>>;
6
+ scanCode(param: import("..").ParamScanCode): Promise<import("..").GenericAsyncResult<import("..").ReturnScanCode>>;
7
+ saveImageToPhotosAlbum(param: import("..").ParamImageToPhotosAlbum): Promise<import("..").GenericAsyncResult<undefined>>;
8
+ chooseImage(param: import("..").ParamChooseImage): Promise<import("..").GenericAsyncResult<import("..").ReturnChooseImageResult>>;
9
+ openFile(param: import("..").ParamOpenFileInfo | undefined): Promise<import("..").GenericAsyncResult<undefined>>;
10
+ checkRequestCameraPermissions(param: import("..").ParamCheckRequestCameraPermissions | undefined): Promise<import("..").GenericAsyncResult<import("..").ReturnPermissionResult>>;
11
+ convertImagePathToBase64(param: import("..").ParamConvertImagePathToBase64 | undefined): Promise<import("..").GenericAsyncResult<import("..").ReturnConvertImagePathToBase64Result>>;
12
+ };
13
+ };
@@ -0,0 +1,10 @@
1
+ /** 按可选分组名隔离的同步存储能力。 */
2
+ export declare const storagePlugin: {
3
+ readonly name: "storage";
4
+ readonly methods: {
5
+ setStorageSync(key: string, data: any, groupName: string | undefined, validSecond: number | undefined): void;
6
+ getStorageSync<T>(key: string, groupName?: string): T | undefined;
7
+ removeStorageSync(key: string, groupName: string | undefined): void;
8
+ clearStorageSync(groupName: string | undefined): void;
9
+ };
10
+ };
@@ -0,0 +1,550 @@
1
+ export declare const version = "0.1.1";
2
+ type TYPE_VERSION = typeof version;
3
+ export type GenericAsyncResult<T = any> = {
4
+ errCode: number;
5
+ errorMsg?: string;
6
+ result?: T;
7
+ };
8
+ export type ScanType = "qrCode" | "barCode";
9
+ export type NetworkStatus = "wifi" | "2g" | "3g" | "4g" | "5g" | "ethernet" | "none" | "unknown";
10
+ export type ParamToast = {
11
+ msg: string;
12
+ };
13
+ export type ClipboardData = {
14
+ data: string;
15
+ };
16
+ export type ParamBadgeCount = {
17
+ count: number;
18
+ };
19
+ export type ParamStorage = {
20
+ groupName?: string;
21
+ key: string;
22
+ data: any;
23
+ };
24
+ export type ParamRemoveStorage = {
25
+ groupName?: string;
26
+ key: string;
27
+ };
28
+ export type ReturnStorageResult = {
29
+ data: any;
30
+ };
31
+ export type ParamStorageClear = {
32
+ groupName?: string;
33
+ };
34
+ export type ParamNavigateTo = {
35
+ /**
36
+ * 跳转地址
37
+ **/
38
+ url: string;
39
+ /**
40
+ * 是否隐藏导航栏,默认 true
41
+ **/
42
+ hidden?: boolean;
43
+ /**
44
+ * 导航栏标题
45
+ **/
46
+ title?: string;
47
+ /**
48
+ * 标题文字颜色,如 eeeeee
49
+ **/
50
+ titleColor?: string;
51
+ /**
52
+ * 导航栏颜色 如 eeeeee
53
+ **/
54
+ color?: string;
55
+ /**
56
+ * 是否是亮色主题 控制状态栏
57
+ **/
58
+ isBright?: boolean;
59
+ /**
60
+ * 是否显示返回按钮
61
+ **/
62
+ showBackButton?: boolean;
63
+ /**
64
+ * 是否显示关闭按钮
65
+ **/
66
+ showCloseButton?: boolean;
67
+ /**
68
+ * 右上角文字按钮
69
+ **/
70
+ actionTxt?: string;
71
+ /**
72
+ * 右上角 icon base64
73
+ **/
74
+ actionIcon?: string;
75
+ /**
76
+ * 右上角 传参 点击的时候会回传给H5
77
+ **/
78
+ actionExt?: string;
79
+ /**
80
+ * 状态栏是否沉浸
81
+ **/
82
+ translucentStatusBars?: boolean;
83
+ /**
84
+ * 打开新页面样式是否弹出
85
+ **/
86
+ isPopUp?: boolean;
87
+ /**
88
+ * 打开的新页面回调给当前页面的回调函数
89
+ **/
90
+ callbackFunction?: GenericCallbackFunc | string;
91
+ };
92
+ export type ParamExternalBrowse = {
93
+ url: string;
94
+ };
95
+ export type ParamNavigationBarTheme = {
96
+ /**
97
+ * 是否隐藏导航栏
98
+ **/
99
+ hidden?: boolean;
100
+ /**
101
+ * 导航栏标题
102
+ **/
103
+ title?: string;
104
+ /**
105
+ * 标题文字颜色,如 eeeeee
106
+ **/
107
+ titleColor?: string;
108
+ /**
109
+ * 导航栏颜色 如 eeeeee
110
+ **/
111
+ color?: string;
112
+ /**
113
+ * 是否是亮色主题 控制状态栏
114
+ **/
115
+ isBright?: boolean;
116
+ /**
117
+ * 是否显示返回按钮
118
+ **/
119
+ showBackButton?: boolean;
120
+ /**
121
+ * 是否显示关闭按钮
122
+ **/
123
+ showCloseButton?: boolean;
124
+ /**
125
+ * 右上角文字按钮
126
+ **/
127
+ actionTxt?: string;
128
+ /**
129
+ * 右上角 icon base64
130
+ **/
131
+ actionIcon?: string;
132
+ /**
133
+ * 右上角 传参 点击的时候会回传给H5
134
+ **/
135
+ actionExt?: string;
136
+ /** 当前页面右上角文字按钮被点击时执行;函数只由 JS SDK 保存。 */
137
+ onActionClick?: (data: {
138
+ actionExt?: string;
139
+ }) => void;
140
+ /**
141
+ * 状态栏是否沉浸
142
+ **/
143
+ translucentStatusBars?: boolean;
144
+ };
145
+ export type ParamPhoneCall = {
146
+ phoneNumber: string;
147
+ };
148
+ export type ParamScanCode = {
149
+ /**
150
+ * 扫码类型 qrCode:二维码 barCode:条形码
151
+ **/
152
+ scanType?: ScanType[];
153
+ /**
154
+ * 是否隐藏相册按钮 如果不隐藏,则可以通过选择相册里的二维码识别
155
+ **/
156
+ hideAlbum?: boolean;
157
+ /**
158
+ * 权限提示 标题 用于Android 提示
159
+ **/
160
+ permissionPromptTitle?: string;
161
+ /**
162
+ * 权限提示内容 用于Android 提示
163
+ **/
164
+ permissionPromptMessage?: string;
165
+ };
166
+ export type ParamImageToPhotosAlbum = {
167
+ /**
168
+ * 图片 base64
169
+ **/
170
+ base64Image: string;
171
+ /**
172
+ * 权限提示 标题 用于Android 提示
173
+ **/
174
+ permissionPromptTitle?: string;
175
+ /**
176
+ * 权限提示内容 用于Android 提示
177
+ **/
178
+ permissionPromptMessage?: string;
179
+ };
180
+ interface ExtendInfo {
181
+ }
182
+ export type ReturnAppInfo = {
183
+ /**
184
+ * 应用 appid
185
+ **/
186
+ appId: string;
187
+ /**
188
+ * 版本信息
189
+ **/
190
+ appVersionName: string;
191
+ /**
192
+ * 内部版本号
193
+ **/
194
+ appVersionCode: number;
195
+ /**
196
+ * 环境 0:测试环境 1:预生产环境 2:生产环境
197
+ **/
198
+ environment: number;
199
+ /**
200
+ * 扩展信息字段
201
+ **/
202
+ extendInfo?: ExtendInfo;
203
+ };
204
+ export type ReturnDeviceInfo = {
205
+ /**
206
+ * 1:Android 2:iOS
207
+ **/
208
+ osType: number;
209
+ /**
210
+ * 设备系统版本
211
+ **/
212
+ osVersion: string;
213
+ /**
214
+ * 设备型号
215
+ **/
216
+ model: string;
217
+ /**
218
+ * 设备品牌
219
+ **/
220
+ brand: string;
221
+ /**
222
+ * 设备id
223
+ **/
224
+ deviceId: string;
225
+ /**
226
+ * 状态栏高度
227
+ **/
228
+ statusBarHeight: number;
229
+ /**
230
+ * 底部安全区域高度
231
+ **/
232
+ bottomSafeAreaHeight: number;
233
+ };
234
+ export type ReturnNetworkType = {
235
+ networkType: NetworkStatus;
236
+ };
237
+ export type ReturnScanCode = {
238
+ scanType: ScanType;
239
+ code: string;
240
+ };
241
+ export type ReturnNotiSwitchStatus = {
242
+ status: boolean;
243
+ };
244
+ export type GenericCallbackFunc<T = any> = (data: T) => void;
245
+ export type CallbackNetworkStatusChange = {
246
+ networkType: NetworkStatus;
247
+ };
248
+ export type ParamCompressImage = {
249
+ /**
250
+ * 图片base64
251
+ **/
252
+ base64Image: string;
253
+ /**
254
+ * 压缩之后最大文件大小 (字节)
255
+ **/
256
+ maxLength?: number;
257
+ };
258
+ export type ReturnCompressImageResult = {
259
+ /**
260
+ * 图片base64
261
+ **/
262
+ base64Image: string;
263
+ /**
264
+ * 图片宽度
265
+ **/
266
+ imageWidth?: number;
267
+ /**
268
+ * 图片高度
269
+ **/
270
+ imageHeight?: number;
271
+ };
272
+ export type ChooseImageSizeType = "original" | "compressed";
273
+ export type ChooseImageSourceType = "album" | "camera" | "all";
274
+ export type ParamChooseImage = {
275
+ /**
276
+ * 图片来源 album:相册 camera:相机 all:弹出选择框 来选择相册还是相机
277
+ **/
278
+ sourceType: ChooseImageSourceType;
279
+ /**
280
+ * 图片尺寸类型 original:原始尺寸 compressed:压缩尺寸
281
+ **/
282
+ sizeType?: ChooseImageSizeType[];
283
+ /**
284
+ * 图片数量
285
+ **/
286
+ count?: number;
287
+ /**
288
+ * 权限提示 标题 用于Android 提示
289
+ **/
290
+ permissionPromptTitle?: string;
291
+ /**
292
+ * 权限提示内容 用于Android 提示
293
+ **/
294
+ permissionPromptMessage?: string;
295
+ };
296
+ export type ReturnImageDataResult = {
297
+ /**
298
+ * 原始图片 路径
299
+ **/
300
+ original: string;
301
+ /**
302
+ * 压缩图片 路径
303
+ **/
304
+ compressed: string;
305
+ };
306
+ export type ReturnChooseImageResult = {
307
+ data: ReturnImageDataResult[];
308
+ };
309
+ export type ParamOpenFileInfo = {
310
+ url: string;
311
+ fileName?: string;
312
+ };
313
+ export type ParamConvertImagePathToBase64 = {
314
+ /**
315
+ * 图片路径
316
+ **/
317
+ path: string;
318
+ };
319
+ export type ReturnConvertImagePathToBase64Result = {
320
+ /**
321
+ * 图片 base64
322
+ **/
323
+ base64Image?: string;
324
+ };
325
+ export type ParamOpenAppPage = {
326
+ pageName: string;
327
+ extInfo?: any;
328
+ };
329
+ export type ReturnPermissionResult = {
330
+ grant: boolean;
331
+ };
332
+ export type ParamCheckRequestCameraPermissions = {
333
+ /**
334
+ * 权限提示 标题 用于Android 提示
335
+ **/
336
+ permissionPromptTitle?: string;
337
+ /**
338
+ * 权限提示内容 用于Android 提示
339
+ **/
340
+ permissionPromptMessage?: string;
341
+ };
342
+ export interface MWBJSSDK {
343
+ /** 当前主文档首屏已准备好;重复调用幂等,不代表宿主展示动画已完成。 */
344
+ notifyPageReady(): Promise<GenericAsyncResult<void>>;
345
+ version: TYPE_VERSION;
346
+ setEnableDebug(enableDebug: boolean): void;
347
+ /**
348
+ * 跳转当前App的系统授权管理⻚
349
+ **/
350
+ openAppAuthorizeSetting(): Promise<GenericAsyncResult<undefined>>;
351
+ /**
352
+ * Toast
353
+ **/
354
+ toast(param: ParamToast): Promise<GenericAsyncResult<undefined>>;
355
+ /**
356
+ * 获取当前App相关信息
357
+ **/
358
+ getAppInfoSync(): ReturnAppInfo;
359
+ /**
360
+ * 在App应用图标上显示数字⻆标
361
+ **/
362
+ setBadgeCount(param: ParamBadgeCount): Promise<GenericAsyncResult<undefined>>;
363
+ /**
364
+ * 打开新页面
365
+ **/
366
+ navigateTo(param: ParamNavigateTo): Promise<GenericAsyncResult<undefined>>;
367
+ /**
368
+ * 返回上一级
369
+ *
370
+ **/
371
+ navigateBack(callbackInfo?: Record<string, any>): Promise<GenericAsyncResult<undefined>>;
372
+ /**
373
+ * 返回到首页
374
+ *
375
+ **/
376
+ navigateBackToRoot(): Promise<GenericAsyncResult<undefined>>;
377
+ /**
378
+ * 用外部浏览器打开⻚面
379
+ **/
380
+ openExternalBrowser(param: ParamExternalBrowse): Promise<GenericAsyncResult<undefined>>;
381
+ /**
382
+ * 设置WebView容器⻚面的导航栏主题
383
+ **/
384
+ setNavigationBarTheme(param: ParamNavigationBarTheme): Promise<GenericAsyncResult<undefined>>;
385
+ /**
386
+ * 获取设备相关信息
387
+ **/
388
+ getDeviceInfoSync(): ReturnDeviceInfo;
389
+ /**
390
+ * 获取系统剪贴板的内容
391
+ **/
392
+ getClipboardDataSync(): ClipboardData;
393
+ /**
394
+ * 设置系统剪贴板的内容
395
+ **/
396
+ setClipboardData(param: ClipboardData): Promise<GenericAsyncResult<undefined>>;
397
+ /**
398
+ * 拨打电话
399
+ **/
400
+ makePhoneCall(param: ParamPhoneCall): Promise<GenericAsyncResult<undefined>>;
401
+ /**
402
+ * 获取设备网络状态
403
+ **/
404
+ getNetworkTypeSync(): ReturnNetworkType;
405
+ /**
406
+ * 获取推送权限开关状态
407
+ **/
408
+ getNotificationSwitchStatus(): Promise<GenericAsyncResult<ReturnNotiSwitchStatus>>;
409
+ /**
410
+ * 清理webview缓存
411
+ **/
412
+ cleanWebviewCache(): Promise<GenericAsyncResult<undefined>>;
413
+ /**
414
+ * 压缩图片
415
+ **/
416
+ compressImage(param: ParamCompressImage): Promise<GenericAsyncResult<ReturnCompressImageResult>>;
417
+ /**
418
+ * 扫码
419
+ **/
420
+ scanCode(param: ParamScanCode): Promise<GenericAsyncResult<ReturnScanCode>>;
421
+ /**
422
+ * 保存图片到相册
423
+ **/
424
+ saveImageToPhotosAlbum(param: ParamImageToPhotosAlbum): Promise<GenericAsyncResult<undefined>>;
425
+ /**
426
+ * 选择照片
427
+ **/
428
+ chooseImage(param: ParamChooseImage): Promise<GenericAsyncResult<ReturnChooseImageResult>>;
429
+ /**
430
+ * 同步存储
431
+ **/
432
+ setStorageSync(key: string, data: any, groupName?: string, validSecond?: number): void;
433
+ /**
434
+ * 异步存储
435
+ **/
436
+ /**
437
+ * 同步获取存储
438
+ **/
439
+ getStorageSync<T>(key: string, groupName?: string): T | undefined;
440
+ /**
441
+ * 异步获取存储
442
+ **/
443
+ /**
444
+ * 同步移除存储
445
+ **/
446
+ removeStorageSync(key: string, groupName?: string): void;
447
+ /**
448
+ * 移除存储
449
+ **/
450
+ /**
451
+ * 同步清除存储
452
+ **/
453
+ clearStorageSync(groupName?: string): void;
454
+ /**
455
+ * 清除存储
456
+ **/
457
+ /**
458
+ * 打开PDF文件
459
+ **/
460
+ openFile(param?: ParamOpenFileInfo): Promise<GenericAsyncResult<undefined>>;
461
+ /**
462
+ * 退出APP
463
+ **/
464
+ exitApp(): Promise<GenericAsyncResult<undefined>>;
465
+ /**
466
+ * 检查是否有相机权限
467
+ **/
468
+ checkRequestCameraPermissions(param?: ParamCheckRequestCameraPermissions): Promise<GenericAsyncResult<ReturnPermissionResult>>;
469
+ /**
470
+ * 本地图片path 转 base64
471
+ **/
472
+ convertImagePathToBase64(param?: ParamConvertImagePathToBase64): Promise<GenericAsyncResult<ReturnConvertImagePathToBase64Result>>;
473
+ /**
474
+ * 跳转App原生界面
475
+ **/
476
+ openNativePage(param: ParamOpenAppPage): Promise<GenericAsyncResult<undefined>>;
477
+ /**
478
+ * H5 注册一个句柄,提供给Native调用
479
+ **/
480
+ registerHandler(handlerName: string, handler: GenericCallbackFunc): void;
481
+ /**
482
+ * 解绑某个handleName下的所有句柄
483
+ **/
484
+ unRegisterHandlers(handlerName: string): void;
485
+ /**
486
+ * 解绑句柄
487
+ **/
488
+ unRegisterHandler(handlerName: string, handler: GenericCallbackFunc): void;
489
+ /**
490
+ * 检查 H5 是否已经注册句柄。native内部会调用
491
+ **/
492
+ checkHandlerExist(handlerName: string): boolean;
493
+ /**
494
+ * 监听网络状态变化
495
+ **/
496
+ onNetworkStatusChange(handler: GenericCallbackFunc<CallbackNetworkStatusChange>): void;
497
+ /**
498
+ * 移除监听网络状态变化
499
+ **/
500
+ offNetworkStatusChange(handler: GenericCallbackFunc<CallbackNetworkStatusChange>): void;
501
+ /**
502
+ * 监听App切前台事件
503
+ **/
504
+ onAppShow(handler: GenericCallbackFunc<void>): void;
505
+ /**
506
+ * 移除监听App切前台事件
507
+ **/
508
+ offAppShow(handler: GenericCallbackFunc<void>): void;
509
+ /**
510
+ * 监听App切后台台事件
511
+ **/
512
+ onAppHide(handler: GenericCallbackFunc<void>): void;
513
+ /**
514
+ * 移除监听App切后台事件
515
+ **/
516
+ offAppHide(handler: GenericCallbackFunc<void>): void;
517
+ /**
518
+ * 监听App Push Notification事件
519
+ **/
520
+ onRemoteNotificationReceive(handler: GenericCallbackFunc<void>): void;
521
+ /**
522
+ * 移除App Push Notification事件
523
+ **/
524
+ offRemoteNotificationReceive(handler: GenericCallbackFunc<void>): void;
525
+ /**
526
+ * 监听Page显示事件
527
+ **/
528
+ onPageShow(handler: GenericCallbackFunc<void>): void;
529
+ /**
530
+ * 移除监听Page显示事件
531
+ **/
532
+ offPageShow(handler: GenericCallbackFunc<void>): void;
533
+ /**
534
+ * 监听Page消失事件
535
+ **/
536
+ onPageHide(handler: GenericCallbackFunc<void>): void;
537
+ /**
538
+ * 移除监听Page消失事件
539
+ **/
540
+ offPageHide(handler: GenericCallbackFunc<void>): void;
541
+ /**
542
+ * 监听物理返回按钮点击事件
543
+ **/
544
+ onBackBtnPressed(handler: () => boolean): void;
545
+ /**
546
+ * 取消监听物理返回按钮点击事件
547
+ **/
548
+ offBackBtnPressed(): void;
549
+ }
550
+ export {};