qsh-webview-sdk 2.3.6 → 2.3.8

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 CHANGED
@@ -228,36 +228,49 @@ declare namespace UniWebView {
228
228
  type: "weixin" | "plus" | "nvue" | "uvue" | "UniApp" | "webview" | "h5" | "offline";
229
229
  }
230
230
 
231
- /** 定向分享:去向 */
231
+ /** 定向分享:去向。chat=聊天框,timeline=朋友圈 */
232
232
  type ShareUniversalScene = "chat" | "timeline";
233
233
 
234
- /** 各 kind 对应的 payload(按需传字段) */
234
+ /**
235
+ * 图文分享参数。
236
+ * - 微信小程序环境:target 必须是 /pages/... 页面路径
237
+ * - App 环境:优先使用 target;若 target 不合法,再使用 webTarget 兜底
238
+ */
235
239
  interface ShareUniversalPayloadWeb {
236
240
  title: string;
237
241
  description: string;
238
242
  imageUrl: string;
239
- /** 分享点击后进入的最终业务页面路径 */
240
- targetPath: string;
241
- /** App 微信图文卡片点击使用的公网链接 */
242
- shareLink: string;
243
+ /** 当前环境下的主目标:小程序传 /pages/...;App 传 https://... */
244
+ target: string;
245
+ /** App 环境使用:当 target 不存在或不合法时,使用该公网链接兜底 */
246
+ webTarget?: string;
243
247
  }
244
248
 
249
+ /**
250
+ * 文字分享参数。
251
+ * - App 环境下会自动降级为图文分享
252
+ * - target / webTarget 的校验规则与图文分享一致
253
+ */
245
254
  interface ShareUniversalPayloadText {
246
255
  title?: string;
247
256
  description: string;
248
257
  imageUrl?: string;
249
- /** 分享点击后进入的最终业务页面路径 */
250
- targetPath: string;
251
- /** App 微信图文卡片点击使用的公网链接 */
252
- shareLink: string;
258
+ /** 当前环境下的主目标:小程序传 /pages/...;App 传 https://... */
259
+ target: string;
260
+ /** App 环境使用:当 target 不存在或不合法时,使用该公网链接兜底 */
261
+ webTarget?: string;
253
262
  }
254
263
 
264
+ /**
265
+ * 图片分享参数。
266
+ * - target / webTarget 的校验规则与图文分享一致
267
+ */
255
268
  interface ShareUniversalPayloadImage {
256
269
  imageUrl: string;
257
- /** 分享点击后进入的最终业务页面路径 */
258
- targetPath: string;
259
- /** App 微信图文卡片点击使用的公网链接 */
260
- shareLink: string;
270
+ /** 当前环境下的主目标:小程序传 /pages/...;App 传 https://... */
271
+ target: string;
272
+ /** App 环境使用:当 target 不存在或不合法时,使用该公网链接兜底 */
273
+ webTarget?: string;
261
274
  title?: string;
262
275
  }
263
276
 
@@ -279,7 +292,11 @@ declare namespace UniWebView {
279
292
  [key: string]: any;
280
293
  }
281
294
 
282
- /** 定向分享模块参数(仅 H5 嵌入宿主 WebView 场景) */
295
+ /**
296
+ * 定向分享模块参数(仅 H5 嵌入宿主 WebView 场景)。
297
+ * - 微信小程序环境:只校验 payload.target,且必须是 /pages/...
298
+ * - App 环境:优先校验 payload.target 是否为公网链接;若不合法,再校验 payload.webTarget
299
+ */
283
300
  interface ShareDirectedOptions {
284
301
  kind: "web" | "text" | "image";
285
302
  scene?: 0 | 1 | ShareUniversalScene;
@@ -289,6 +306,11 @@ declare namespace UniWebView {
289
306
  complete?: () => void;
290
307
  }
291
308
 
309
+ /**
310
+ * 小程序卡片分享参数。
311
+ * - targetPath 始终表示小程序落地页路径
312
+ * - webUrl 只在 App 环境下参与校验和配参,小程序环境不会使用该字段决定落地页
313
+ */
292
314
  interface ShareMiniProgramCardPayload {
293
315
  title: string;
294
316
  imageUrl: string;
@@ -298,12 +320,10 @@ declare namespace UniWebView {
298
320
  appid: string;
299
321
  /** 小程序环境版本 */
300
322
  envVersion?: "release" | "trial" | "develop";
301
- /** 兜底网页链接,供 App 微信通道必要时使用 */
302
- fallbackWebUrl?: string;
323
+ /** App 环境分享时使用的网页兜底链接,必须是公网 https/http 链接 */
324
+ webUrl?: string;
303
325
  /** 小程序卡片描述 */
304
326
  description?: string;
305
- /** 预留:若宿主 App 通道需要,也可传 shareLink */
306
- shareLink?: string;
307
327
  }
308
328
 
309
329
  interface ShareMiniProgramCardOptions {
@@ -377,8 +397,7 @@ declare namespace UniWebView {
377
397
  }
378
398
 
379
399
  /**
380
- * 人脸识别选项(仅支持微信小程序环境)
381
- * 只发送请求,不返回任何结果给调用者
400
+ * 人脸识别选项
382
401
  */
383
402
  interface FaceVerifyOptions {
384
403
  /** 姓名(必填) */
@@ -391,18 +410,20 @@ declare namespace UniWebView {
391
410
  * 人脸识别功能能力信息
392
411
  */
393
412
  interface FaceCapabilities {
394
- /** 是否支持人脸识别(仅微信小程序环境返回 true) */
413
+ /** 是否支持人脸识别 */
395
414
  supported: boolean;
396
415
  /** 当前环境类型 */
397
416
  environment: string;
398
- /** 底层实现类型,固定为 'weixin' */
399
- implementation: "weixin";
417
+ /** 底层实现类型 */
418
+ implementation: "weixin" | "uniapp";
400
419
  /** 功能特性 */
401
420
  features: {
402
421
  /** 支持 Promise */
403
422
  asyncSupport: boolean;
404
423
  /** 通过宿主页跳转实现 */
405
424
  hostPageNavigation?: boolean;
425
+ /** 通过宿主桥接实现 */
426
+ hostBridge?: boolean;
406
427
  };
407
428
  }
408
429
 
@@ -501,8 +522,8 @@ declare namespace UniWebView {
501
522
  getPrintCapabilities(): PrintPdfCapabilities;
502
523
 
503
524
  /**
504
- * 人脸识别(仅支持微信小程序环境)
505
- * 通过 wx.miniProgram.navigateTo 跳转宿主 /pages/face/index,不返回任何结果给调用者
525
+ * 人脸识别(仅支持微信小程序和 UniApp 环境)
526
+ * 微信环境通过 wx.miniProgram.navigateTo 跳转宿主 /pages/face/index,UniApp 环境通过桥接调用宿主实现
506
527
  */
507
528
  faceVerify(options: FaceVerifyOptions): void;
508
529
  /** 获取人脸识别功能能力信息 */
@@ -520,21 +541,5 @@ declare namespace UniWebView {
520
541
  * 全局 qsh/uni 对象(默认导出为模块默认值)
521
542
  */
522
543
  declare const qsh: UniWebView.Uni;
523
- declare const uni: UniWebView.Uni;
524
-
525
- /**
526
- * 模块导出
527
- */
528
544
  export default qsh;
529
-
530
- /**
531
- * 全局声明
532
- */
533
- declare global {
534
- interface Window {
535
- qsh: UniWebView.Uni;
536
- UniAppJSBridge?: boolean;
537
- }
538
- }
539
-
540
545
  export as namespace qsh;