qsh-webview-sdk 2.3.2 → 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 +16 -52
- package/dist/qsh-webview-sdk.es.js +1744 -2143
- 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
|
@@ -228,10 +228,7 @@ declare namespace UniWebView {
|
|
|
228
228
|
type: "weixin" | "plus" | "nvue" | "uvue" | "UniApp" | "webview" | "h5" | "offline";
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
/**
|
|
232
|
-
type ShareUniversalKind = "web" | "text" | "image" | "miniProgram";
|
|
233
|
-
|
|
234
|
-
/** 高阶 toShare:去向 */
|
|
231
|
+
/** 定向分享:去向 */
|
|
235
232
|
type ShareUniversalScene = "chat" | "timeline";
|
|
236
233
|
|
|
237
234
|
/** 各 kind 对应的 payload(按需传字段) */
|
|
@@ -254,46 +251,10 @@ declare namespace UniWebView {
|
|
|
254
251
|
imageUrl: string;
|
|
255
252
|
}
|
|
256
253
|
|
|
257
|
-
interface ShareUniversalPayloadMiniProgram {
|
|
258
|
-
title: string;
|
|
259
|
-
summary: string;
|
|
260
|
-
imageUrl: string;
|
|
261
|
-
miniProgram: {
|
|
262
|
-
/** 小程序原始 ID(gh_ 开头),uni.share type=5 要求 */
|
|
263
|
-
id: string;
|
|
264
|
-
path: string;
|
|
265
|
-
webUrl: string;
|
|
266
|
-
type?: 0 | 1 | 2;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
|
|
270
254
|
type ShareUniversalPayload =
|
|
271
255
|
| ShareUniversalPayloadWeb
|
|
272
256
|
| ShareUniversalPayloadText
|
|
273
|
-
| ShareUniversalPayloadImage
|
|
274
|
-
| ShareUniversalPayloadMiniProgram;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* 微信分享选项(toShare 仅支持高阶入参)
|
|
278
|
-
*/
|
|
279
|
-
interface ShareOptions {
|
|
280
|
-
kind: ShareUniversalKind;
|
|
281
|
-
/** 各 kind 对应字段见 ShareUniversalPayload */
|
|
282
|
-
payload?: ShareUniversalPayload;
|
|
283
|
-
/** 为 true 时不打印 hint 日志 */
|
|
284
|
-
silent?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* 为 true 且当前为微信 JS-SDK 环境时,走宿主 WebView 桥 toShareData(兼容原 toShareCallBack)
|
|
287
|
-
*/
|
|
288
|
-
viaWebViewBridge?: boolean;
|
|
289
|
-
/** @deprecated 等同于 viaWebViewBridge */
|
|
290
|
-
isCallBack?: boolean;
|
|
291
|
-
/** 分享去向:0 / chat 聊天,1 / timeline 朋友圈 */
|
|
292
|
-
scene?: 0 | 1 | ShareUniversalScene;
|
|
293
|
-
success?: (res: ShareResult) => void;
|
|
294
|
-
fail?: (error: any) => void;
|
|
295
|
-
complete?: () => void;
|
|
296
|
-
}
|
|
257
|
+
| ShareUniversalPayloadImage;
|
|
297
258
|
|
|
298
259
|
interface ShareResult {
|
|
299
260
|
errMsg?: string;
|
|
@@ -308,6 +269,16 @@ declare namespace UniWebView {
|
|
|
308
269
|
[key: string]: any;
|
|
309
270
|
}
|
|
310
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
|
+
|
|
311
282
|
interface BluetoothOptions {
|
|
312
283
|
success?: (res: any) => void;
|
|
313
284
|
fail?: (error: any) => void;
|
|
@@ -465,19 +436,12 @@ declare namespace UniWebView {
|
|
|
465
436
|
/** 图片大小类型枚举 */
|
|
466
437
|
ImageSizeTypes: ImageSizeTypesEnum;
|
|
467
438
|
|
|
468
|
-
/**
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
options: Omit<
|
|
439
|
+
/** 定向分享模块:仅 H5 -> 宿主 WebView */
|
|
440
|
+
shareDirected(options: ShareDirectedOptions): Promise<ShareResult> | void;
|
|
441
|
+
shareDirectedAsync(
|
|
442
|
+
options: Omit<ShareDirectedOptions, "success" | "fail" | "complete">,
|
|
472
443
|
): Promise<ShareResult>;
|
|
473
444
|
|
|
474
|
-
/** toShare 参数说明(结构化,可 JSON 展示) */
|
|
475
|
-
readonly TO_SHARE_PARAM_HELP: Readonly<Record<string, unknown>>;
|
|
476
|
-
/** 返回 toShare 参数说明对象 */
|
|
477
|
-
getToShareParamHelp(): Readonly<Record<string, unknown>>;
|
|
478
|
-
/** 在控制台打印 toShare 参数说明,并返回文本 */
|
|
479
|
-
printToShareParamHelp(): string;
|
|
480
|
-
|
|
481
445
|
/** 蓝牙 API */
|
|
482
446
|
openBluetoothAdapter(options?: BluetoothOptions): Promise<any> | void;
|
|
483
447
|
openBluetoothAdapterAsync(options?: BluetoothOptions): Promise<any>;
|