qsh-webview-sdk 2.3.1 → 2.3.3
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/dist/index.d.ts +45 -52
- package/dist/qsh-webview-sdk.es.js +1355 -1602
- package/dist/qsh-webview-sdk.es.js.map +1 -1
- package/dist/qsh-webview-sdk.umd.js +1 -35
- package/dist/qsh-webview-sdk.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,27 @@ declare namespace UniWebView {
|
|
|
27
27
|
data?: any;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
interface MiniProgramNavigateResult {
|
|
31
|
+
/** errMsg */
|
|
32
|
+
errMsg?: string;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface MiniProgramNavigateOptions {
|
|
37
|
+
/** target mini program id */
|
|
38
|
+
appid: string;
|
|
39
|
+
/** target mini program page path */
|
|
40
|
+
path?: string;
|
|
41
|
+
/** target mini program env */
|
|
42
|
+
env?: "release" | "trial" | "develop";
|
|
43
|
+
/** success callback */
|
|
44
|
+
success?: (res: MiniProgramNavigateResult) => void;
|
|
45
|
+
/** fail callback */
|
|
46
|
+
fail?: (error: any) => void;
|
|
47
|
+
/** complete callback */
|
|
48
|
+
complete?: () => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
30
51
|
/**
|
|
31
52
|
* 环境信息
|
|
32
53
|
*/
|
|
@@ -207,10 +228,7 @@ declare namespace UniWebView {
|
|
|
207
228
|
type: "weixin" | "plus" | "nvue" | "uvue" | "UniApp" | "webview" | "h5" | "offline";
|
|
208
229
|
}
|
|
209
230
|
|
|
210
|
-
/**
|
|
211
|
-
type ShareUniversalKind = "web" | "text" | "image" | "miniProgram";
|
|
212
|
-
|
|
213
|
-
/** 高阶 toShare:去向 */
|
|
231
|
+
/** 定向分享:去向 */
|
|
214
232
|
type ShareUniversalScene = "chat" | "timeline";
|
|
215
233
|
|
|
216
234
|
/** 各 kind 对应的 payload(按需传字段) */
|
|
@@ -233,46 +251,10 @@ declare namespace UniWebView {
|
|
|
233
251
|
imageUrl: string;
|
|
234
252
|
}
|
|
235
253
|
|
|
236
|
-
interface ShareUniversalPayloadMiniProgram {
|
|
237
|
-
title: string;
|
|
238
|
-
summary: string;
|
|
239
|
-
imageUrl: string;
|
|
240
|
-
miniProgram: {
|
|
241
|
-
/** 小程序原始 ID(gh_ 开头),uni.share type=5 要求 */
|
|
242
|
-
id: string;
|
|
243
|
-
path: string;
|
|
244
|
-
webUrl: string;
|
|
245
|
-
type?: 0 | 1 | 2;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
254
|
type ShareUniversalPayload =
|
|
250
255
|
| ShareUniversalPayloadWeb
|
|
251
256
|
| ShareUniversalPayloadText
|
|
252
|
-
| ShareUniversalPayloadImage
|
|
253
|
-
| ShareUniversalPayloadMiniProgram;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* 微信分享选项(toShare 仅支持高阶入参)
|
|
257
|
-
*/
|
|
258
|
-
interface ShareOptions {
|
|
259
|
-
kind: ShareUniversalKind;
|
|
260
|
-
/** 各 kind 对应字段见 ShareUniversalPayload */
|
|
261
|
-
payload?: ShareUniversalPayload;
|
|
262
|
-
/** 为 true 时不打印 hint 日志 */
|
|
263
|
-
silent?: boolean;
|
|
264
|
-
/**
|
|
265
|
-
* 为 true 且当前为微信 JS-SDK 环境时,走宿主 WebView 桥 toShareData(兼容原 toShareCallBack)
|
|
266
|
-
*/
|
|
267
|
-
viaWebViewBridge?: boolean;
|
|
268
|
-
/** @deprecated 等同于 viaWebViewBridge */
|
|
269
|
-
isCallBack?: boolean;
|
|
270
|
-
/** 分享去向:0 / chat 聊天,1 / timeline 朋友圈 */
|
|
271
|
-
scene?: 0 | 1 | ShareUniversalScene;
|
|
272
|
-
success?: (res: ShareResult) => void;
|
|
273
|
-
fail?: (error: any) => void;
|
|
274
|
-
complete?: () => void;
|
|
275
|
-
}
|
|
257
|
+
| ShareUniversalPayloadImage;
|
|
276
258
|
|
|
277
259
|
interface ShareResult {
|
|
278
260
|
errMsg?: string;
|
|
@@ -287,6 +269,16 @@ declare namespace UniWebView {
|
|
|
287
269
|
[key: string]: any;
|
|
288
270
|
}
|
|
289
271
|
|
|
272
|
+
/** 定向分享模块参数(仅 H5 嵌入宿主 WebView 场景) */
|
|
273
|
+
interface ShareDirectedOptions {
|
|
274
|
+
kind: "web" | "text" | "image";
|
|
275
|
+
scene?: 0 | 1 | ShareUniversalScene;
|
|
276
|
+
payload: ShareUniversalPayload;
|
|
277
|
+
success?: (res: ShareResult) => void;
|
|
278
|
+
fail?: (error: any) => void;
|
|
279
|
+
complete?: () => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
290
282
|
interface BluetoothOptions {
|
|
291
283
|
success?: (res: any) => void;
|
|
292
284
|
fail?: (error: any) => void;
|
|
@@ -397,6 +389,7 @@ declare namespace UniWebView {
|
|
|
397
389
|
switchTab(options: NavigateOptions): void;
|
|
398
390
|
reLaunch(options: NavigateOptions): void;
|
|
399
391
|
redirectTo(options: NavigateOptions): void;
|
|
392
|
+
navigateToMiniProgram(options: MiniProgramNavigateOptions): void;
|
|
400
393
|
postMessage(options?: PostMessageOptions): void;
|
|
401
394
|
getEnv(callback: (info: EnvironmentInfo) => void): void;
|
|
402
395
|
chooseImage(options?: ChooseImageOptions): void;
|
|
@@ -415,6 +408,13 @@ declare namespace UniWebView {
|
|
|
415
408
|
/** WebView 对象(兼容旧版本) */
|
|
416
409
|
webView: WebView | null;
|
|
417
410
|
|
|
411
|
+
navigateToMiniProgram(
|
|
412
|
+
options: MiniProgramNavigateOptions,
|
|
413
|
+
): Promise<MiniProgramNavigateResult> | void;
|
|
414
|
+
navigateToMiniProgramAsync(
|
|
415
|
+
options: Omit<MiniProgramNavigateOptions, "success" | "fail" | "complete">,
|
|
416
|
+
): Promise<MiniProgramNavigateResult>;
|
|
417
|
+
|
|
418
418
|
weixin: WeixinNamespace;
|
|
419
419
|
|
|
420
420
|
/** 图片选择(Promise版本) */
|
|
@@ -436,19 +436,12 @@ declare namespace UniWebView {
|
|
|
436
436
|
/** 图片大小类型枚举 */
|
|
437
437
|
ImageSizeTypes: ImageSizeTypesEnum;
|
|
438
438
|
|
|
439
|
-
/**
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
options: Omit<
|
|
439
|
+
/** 定向分享模块:仅 H5 -> 宿主 WebView */
|
|
440
|
+
shareDirected(options: ShareDirectedOptions): Promise<ShareResult> | void;
|
|
441
|
+
shareDirectedAsync(
|
|
442
|
+
options: Omit<ShareDirectedOptions, "success" | "fail" | "complete">,
|
|
443
443
|
): Promise<ShareResult>;
|
|
444
444
|
|
|
445
|
-
/** toShare 参数说明(结构化,可 JSON 展示) */
|
|
446
|
-
readonly TO_SHARE_PARAM_HELP: Readonly<Record<string, unknown>>;
|
|
447
|
-
/** 返回 toShare 参数说明对象 */
|
|
448
|
-
getToShareParamHelp(): Readonly<Record<string, unknown>>;
|
|
449
|
-
/** 在控制台打印 toShare 参数说明,并返回文本 */
|
|
450
|
-
printToShareParamHelp(): string;
|
|
451
|
-
|
|
452
445
|
/** 蓝牙 API */
|
|
453
446
|
openBluetoothAdapter(options?: BluetoothOptions): Promise<any> | void;
|
|
454
447
|
openBluetoothAdapterAsync(options?: BluetoothOptions): Promise<any>;
|