hylid-bridge 4.0.24-alpha.3 → 4.0.26-alpha.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.
Files changed (89) hide show
  1. package/README.md +5 -5
  2. package/lib/bridges.d.ts +41 -57
  3. package/lib/bridges.js +23 -32
  4. package/lib/clients/mp/alipay/index.d.ts +242 -4
  5. package/lib/clients/mp/alipay/index.js +92 -4
  6. package/lib/clients/mp/alipayhk/index.d.ts +235 -2
  7. package/lib/clients/mp/alipayhk/index.js +90 -3
  8. package/lib/clients/mp/chope/index.d.ts +235 -2
  9. package/lib/clients/mp/chope/index.js +90 -3
  10. package/lib/clients/mp/dana/index.d.ts +235 -2
  11. package/lib/clients/mp/dana/index.js +90 -3
  12. package/lib/clients/mp/demo/index.d.ts +266 -8
  13. package/lib/clients/mp/demo/index.js +114 -3
  14. package/lib/clients/mp/gcash/index.d.ts +235 -2
  15. package/lib/clients/mp/gcash/index.js +90 -3
  16. package/lib/clients/mp/tmn/index.d.ts +235 -2
  17. package/lib/clients/mp/tmn/index.js +90 -3
  18. package/lib/clients/mp/tngd/index.d.ts +235 -2
  19. package/lib/clients/mp/tngd/index.js +90 -3
  20. package/lib/clients/mp/wechat/index.d.ts +0 -1
  21. package/lib/clients/mp_web/alipay/index.d.ts +244 -4
  22. package/lib/clients/mp_web/alipay/index.js +94 -4
  23. package/lib/clients/mp_web/alipayhk/index.d.ts +315 -16
  24. package/lib/clients/mp_web/alipayhk/index.js +105 -8
  25. package/lib/clients/mp_web/chope/index.d.ts +235 -2
  26. package/lib/clients/mp_web/chope/index.js +89 -2
  27. package/lib/clients/mp_web/dana/index.d.ts +314 -16
  28. package/lib/clients/mp_web/dana/index.js +104 -8
  29. package/lib/clients/mp_web/demo/index.d.ts +265 -8
  30. package/lib/clients/mp_web/demo/index.js +112 -2
  31. package/lib/clients/mp_web/gcash/index.d.ts +314 -16
  32. package/lib/clients/mp_web/gcash/index.js +104 -8
  33. package/lib/clients/mp_web/mpay/index.d.ts +315 -24
  34. package/lib/clients/mp_web/mpay/index.js +106 -12
  35. package/lib/clients/mp_web/tmn/index.d.ts +314 -16
  36. package/lib/clients/mp_web/tmn/index.js +104 -8
  37. package/lib/clients/mp_web/tngd/index.d.ts +314 -16
  38. package/lib/clients/mp_web/tngd/index.js +104 -8
  39. package/lib/clients/mp_web/toss/index.d.ts +322 -16
  40. package/lib/clients/mp_web/toss/index.js +106 -8
  41. package/lib/clients/web/alipay/index.d.ts +231 -115
  42. package/lib/clients/web/alipay/index.js +115 -74
  43. package/lib/clients/web/demo/index.d.ts +181 -60
  44. package/lib/clients/web/demo/index.js +106 -48
  45. package/lib/clients/web/h5/index.d.ts +22 -14
  46. package/lib/clients/web/h5/index.js +10 -8
  47. package/lib/clients/web/tngdh5ng/index.d.ts +29 -21
  48. package/lib/clients/web/tngdh5ng/index.js +26 -18
  49. package/lib/clients/web/worldfirst/index.d.ts +7 -0
  50. package/lib/clients/web/worldfirst/index.js +7 -0
  51. package/lib/clients/web/worldfirst/wfOpenDocument.d.ts +20 -0
  52. package/lib/clients/web/worldfirst/wfOpenDocument.js +8 -0
  53. package/lib/common/apis/custom/mp_web/mpay/getAppToken.d.ts +1 -6
  54. package/lib/common/apis/generated/mp/getAppToken.d.ts +2 -14
  55. package/lib/common/apis/generated/mp_web/getAppToken.d.ts +2 -14
  56. package/lib/common/apis/generated/web/getAppToken.d.ts +2 -14
  57. package/lib/dsl.d.ts +12 -11
  58. package/lib/dsl.js +2 -2
  59. package/lib/umd/index.js +1 -1
  60. package/lib/umd/mp_web_alipay.js +1 -1
  61. package/lib/umd/mp_web_alipayhk.js +1 -1
  62. package/lib/umd/mp_web_chope.js +1 -1
  63. package/lib/umd/mp_web_dana.js +1 -1
  64. package/lib/umd/mp_web_demo.js +1 -1
  65. package/lib/umd/mp_web_gcash.js +1 -1
  66. package/lib/umd/mp_web_mpay.js +1 -1
  67. package/lib/umd/mp_web_tmn.js +1 -1
  68. package/lib/umd/mp_web_tngd.js +1 -1
  69. package/lib/umd/mp_web_toss.js +1 -1
  70. package/lib/umd/web_alipay.js +1 -1
  71. package/lib/umd/web_demo.js +1 -1
  72. package/lib/umd/web_h5.js +1 -1
  73. package/lib/umd/web_tngdh5ng.js +1 -1
  74. package/lib/umd/web_worldfirst.js +1 -0
  75. package/lib/whichCanIUse/compatibilities.json +125123 -1659
  76. package/lib/whichCanIUse/index.d.ts +6 -21
  77. package/lib/whichCanIUse/index.js +43 -65
  78. package/package.json +9 -9
  79. package/lib/clients/web/alipay/getClientInfo.d.ts +0 -2
  80. package/lib/clients/web/alipay/getClientInfo.js +0 -3
  81. package/lib/clients/web/alipayhk/getClientInfo.d.ts +0 -2
  82. package/lib/clients/web/alipayhk/getClientInfo.js +0 -3
  83. package/lib/clients/web/alipayhk/index.d.ts +0 -24
  84. package/lib/clients/web/alipayhk/index.js +0 -9
  85. package/lib/common/apis/generated/web/getClientInfo.d.ts +0 -33
  86. package/lib/common/apis/generated/web/getClientInfo.js +0 -8
  87. package/lib/umd/web_alipayhk.js +0 -1
  88. /package/lib/clients/web/{alipayhk → demo}/getAppToken.d.ts +0 -0
  89. /package/lib/clients/web/{alipayhk → demo}/getAppToken.js +0 -0
package/README.md CHANGED
@@ -82,7 +82,6 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
82
82
  |exitApp|✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
83
83
  |getAppIdSync|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
84
84
  |getAppToken|✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
85
- |getClientInfo|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
86
85
  |getAuthCode|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
87
86
  |getBatteryInfo|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
88
87
  |getBLEDeviceCharacteristics|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
@@ -219,6 +218,7 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
219
218
  |compressImage|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
220
219
  |setTabBarItem|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
221
220
  |showTabBar|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
221
+ |wfOpenDocument|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
222
222
  ### HTML5
223
223
  | API | demo | gcash | tngd | alipay | chope | alipayhk | dana | tmn | toss | mpay |
224
224
  | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
@@ -246,7 +246,6 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
246
246
  |exitApp|✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ |
247
247
  |getAppIdSync|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
248
248
  |getAppToken|✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
249
- |getClientInfo|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
250
249
  |getAuthCode|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
251
250
  |getBatteryInfo|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
252
251
  |getBLEDeviceCharacteristics|✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
@@ -383,8 +382,9 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
383
382
  |compressImage|❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
384
383
  |setTabBarItem|❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
385
384
  |showTabBar|❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
385
+ |wfOpenDocument|❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
386
386
  ### Web
387
- | API | demo | alipay | h5 | tngdh5ng | alipayhk |
387
+ | API | demo | alipay | h5 | tngdh5ng | worldfirst |
388
388
  | --- | --- | --- | --- | --- | --- |
389
389
  |addFatigueAction|✅ | ❌ | ❌ | ❌ | ❌ |
390
390
  |addPhoneContact|✅ | ✅ | ❌ | ❌ | ❌ |
@@ -409,8 +409,7 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
409
409
  |downloadFile|✅ | ✅ | ❌ | ❌ | ❌ |
410
410
  |exitApp|✅ | ✅ | ✅ | ✅ | ❌ |
411
411
  |getAppIdSync|❌ | ❌ | ❌ | ❌ | ❌ |
412
- |getAppToken|❌ | ✅ | ❌ | ❌ | |
413
- |getClientInfo|❌ | ✅ | ❌ | ❌ | ✅ |
412
+ |getAppToken|✅ | ✅ | ❌ | ❌ | |
414
413
  |getAuthCode|✅ | ✅ | ❌ | ❌ | ❌ |
415
414
  |getBatteryInfo|✅ | ✅ | ❌ | ❌ | ❌ |
416
415
  |getBLEDeviceCharacteristics|❌ | ❌ | ❌ | ❌ | ❌ |
@@ -547,6 +546,7 @@ The following table lists the latest JSAPIs that are supported in JS bridge, and
547
546
  |compressImage|❌ | ✅ | ❌ | ❌ | ❌ |
548
547
  |setTabBarItem|❌ | ✅ | ❌ | ❌ | ❌ |
549
548
  |showTabBar|❌ | ✅ | ❌ | ❌ | ❌ |
549
+ |wfOpenDocument|❌ | ❌ | ❌ | ❌ | ✅ |
550
550
 
551
551
  ## License
552
552
 
package/lib/bridges.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="miniprogram" />
1
2
  import { PickMPAttr } from '@hylid/types';
2
3
  /**
3
4
  * @support
@@ -418,7 +419,7 @@ export declare const getAppIdSync: PickMPAttr<'getAppIdSync'>;
418
419
  * | ------------- | -------- |
419
420
  * | mp | demo |
420
421
  * | mp_web | demo,alipayhk,dana,gcash,mpay,tmn,tngd,toss |
421
- * | web | alipay,alipayhk |
422
+ * | web | demo,alipay |
422
423
  */
423
424
  export declare const getAppToken: PickMPAttr<'getAppToken'>;
424
425
  /**
@@ -427,54 +428,9 @@ export declare const getAppToken: PickMPAttr<'getAppToken'>;
427
428
  * | ------------- | -------- |
428
429
  * | mp | demo |
429
430
  * | mp_web | demo,alipayhk,dana,gcash,mpay,tmn,tngd,toss |
430
- * | web | alipay,alipayhk |
431
- */
432
- export declare const getAppTokenAsync: (args?: ({
433
- appName: string;
434
- appKey: string;
435
- } & import("@hylid/types").AsyncCallback<{
436
- appToken: string;
437
- }>) | undefined) => Promise<{
438
- appToken: string;
439
- }>;
440
- /**
441
- * @support
442
- * | Platform | Apps |
443
- * | ------------- | -------- |
444
- * | mp | |
445
- * | mp_web | |
446
- * | web | alipay,alipayhk |
431
+ * | web | demo,alipay |
447
432
  */
448
- export declare const getClientInfo: PickMPAttr<'getClientInfo'>;
449
- /**
450
- * @support
451
- * | Platform | Apps |
452
- * | ------------- | -------- |
453
- * | mp | |
454
- * | mp_web | |
455
- * | web | alipay,alipayhk |
456
- */
457
- export declare const getClientInfoAsync: (args?: import("@hylid/types").AsyncCallback<{
458
- "client.version": string;
459
- umidToken?: string | undefined;
460
- "os.name": string;
461
- verion: string;
462
- "os.version": string;
463
- "device.id": string;
464
- channelId?: string | undefined;
465
- model: string;
466
- device: string;
467
- }> | undefined) => Promise<{
468
- "client.version": string;
469
- umidToken?: string | undefined;
470
- "os.name": string;
471
- verion: string;
472
- "os.version": string;
473
- "device.id": string;
474
- channelId?: string | undefined;
475
- model: string;
476
- device: string;
477
- }>;
433
+ export declare const getAppTokenAsync: (args?: any) => Promise<unknown>;
478
434
  /**
479
435
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_OpenAPI_getAuthCode
480
436
  * @support
@@ -1652,15 +1608,7 @@ export declare const openDocument: PickMPAttr<'openDocument'>;
1652
1608
  * | web | demo,alipay |
1653
1609
  */
1654
1610
  export declare const openDocumentAsync: (args?: ({
1655
- filePath: string; /**
1656
- * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_Device_Battery_getBatteryInfo
1657
- * @support
1658
- * | Platform | Apps |
1659
- * | ------------- | -------- |
1660
- * | mp | demo,gcash,tngd,alipay,chope,alipayhk,dana,tmn |
1661
- * | mp_web | demo,gcash,tngd,alipay,chope,alipayhk,dana,tmn,toss,mpay |
1662
- * | web | demo,alipay |
1663
- */
1611
+ filePath: string;
1664
1612
  fileType: string;
1665
1613
  } & AsyncCallback<any>) | undefined) => Promise<any>;
1666
1614
  /**
@@ -3008,3 +2956,39 @@ export declare const showTabBar: PickMPAttr<'showTabBar'>;
3008
2956
  export declare const showTabBarAsync: (args?: ({
3009
2957
  animation?: boolean | undefined;
3010
2958
  } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
2959
+ /**
2960
+ * @support
2961
+ * | Platform | Apps |
2962
+ * | ------------- | -------- |
2963
+ * | mp | |
2964
+ * | mp_web | |
2965
+ * | web | worldfirst |
2966
+ */
2967
+ export interface WfOpenDocumentWorldfirstWebPayload {
2968
+ /**
2969
+ * The path of the file to be opened
2970
+ */
2971
+ filePath: string;
2972
+ /**
2973
+ * The type of the file to be opened. Currently only supports pdf and image
2974
+ */
2975
+ fileType: string;
2976
+ /**
2977
+ * The name of the file to be opened. Used to display on the titlebar.
2978
+ */
2979
+ fileName: string;
2980
+ }
2981
+ export interface WfOpenDocumentWorldfirstWebResult {
2982
+ }
2983
+ declare type WfOpenDocumentWorldfirstWebAsyncType = WfOpenDocumentWorldfirstWebPayload & AsyncCallback<WfOpenDocumentWorldfirstWebResult>;
2984
+ export declare const wfOpenDocument: (args: WfOpenDocumentWorldfirstWebAsyncType) => void;
2985
+ /**
2986
+ * @support
2987
+ * | Platform | Apps |
2988
+ * | ------------- | -------- |
2989
+ * | mp | |
2990
+ * | mp_web | |
2991
+ * | web | worldfirst |
2992
+ */
2993
+ export declare const wfOpenDocumentAsync: (args?: WfOpenDocumentWorldfirstWebAsyncType | undefined) => Promise<WfOpenDocumentWorldfirstWebResult>;
2994
+ export {};
package/lib/bridges.js CHANGED
@@ -347,7 +347,6 @@ import webAlipayDatePicker from './clients/web/alipay/datePicker';
347
347
  import webAlipayDownloadFile from './clients/web/alipay/downloadFile';
348
348
  import webExitApp from './common/apis/generated/web/exitApp';
349
349
  import webGetAppToken from './common/apis/generated/web/getAppToken';
350
- import webGetClientInfo from './common/apis/generated/web/getClientInfo';
351
350
  import webAlipayGetAuthCode from './clients/web/alipay/getAuthCode';
352
351
  import webGetBatteryInfo from './common/apis/generated/web/getBatteryInfo';
353
352
  import webGetClipboard from './common/apis/generated/web/getClipboard';
@@ -502,6 +501,7 @@ import webTngdh5ngGetNetworkType from './clients/web/tngdh5ng/getNetworkType';
502
501
  import webTngdh5ngNavigateBack from './clients/web/tngdh5ng/navigateBack';
503
502
  import webTngdh5ngNavigateTo from './clients/web/tngdh5ng/navigateTo';
504
503
  import webTngdh5ngShowToast from './clients/web/tngdh5ng/showToast';
504
+ import webWorldfirstWfOpenDocument from './clients/web/worldfirst/wfOpenDocument';
505
505
  /**
506
506
  * @support
507
507
  * | Platform | Apps |
@@ -1379,7 +1379,7 @@ export var getAppIdSync = function getAppIdSync() {
1379
1379
  * | ------------- | -------- |
1380
1380
  * | mp | demo |
1381
1381
  * | mp_web | demo,alipayhk,dana,gcash,mpay,tmn,tngd,toss |
1382
- * | web | alipay,alipayhk |
1382
+ * | web | demo,alipay |
1383
1383
  */
1384
1384
  export var getAppToken = function getAppToken() {
1385
1385
  var rest = [];
@@ -1396,7 +1396,7 @@ export var getAppToken = function getAppToken() {
1396
1396
  if (appEnv.isMpWebMpay) return mpWebMpayGetAppToken.apply(void 0, rest);
1397
1397
  if (appEnv.isMpWebToss) return mpWebGetAppToken.apply(void 0, rest);
1398
1398
  if (appEnv.isWebAlipay) return webGetAppToken.apply(void 0, rest);
1399
- if (appEnv.isWebAlipayhk) return webGetAppToken.apply(void 0, rest);
1399
+ if (appEnv.isWebDemo) return webGetAppToken.apply(void 0, rest);
1400
1400
  return notFound.apply(void 0, __spreadArray(['getAppToken'], rest, false));
1401
1401
  };
1402
1402
  /**
@@ -1405,37 +1405,10 @@ export var getAppToken = function getAppToken() {
1405
1405
  * | ------------- | -------- |
1406
1406
  * | mp | demo |
1407
1407
  * | mp_web | demo,alipayhk,dana,gcash,mpay,tmn,tngd,toss |
1408
- * | web | alipay,alipayhk |
1408
+ * | web | demo,alipay |
1409
1409
  */
1410
1410
  // @ts-ignore
1411
1411
  export var getAppTokenAsync = /*#__PURE__*/promisify(getAppToken);
1412
- /**
1413
- * @support
1414
- * | Platform | Apps |
1415
- * | ------------- | -------- |
1416
- * | mp | |
1417
- * | mp_web | |
1418
- * | web | alipay,alipayhk |
1419
- */
1420
- export var getClientInfo = function getClientInfo() {
1421
- var rest = [];
1422
- for (var _i = 0; _i < arguments.length; _i++) {
1423
- rest[_i] = arguments[_i];
1424
- }
1425
- if (appEnv.isWebAlipay) return webGetClientInfo.apply(void 0, rest);
1426
- if (appEnv.isWebAlipayhk) return webGetClientInfo.apply(void 0, rest);
1427
- return notFound.apply(void 0, __spreadArray(['getClientInfo'], rest, false));
1428
- };
1429
- /**
1430
- * @support
1431
- * | Platform | Apps |
1432
- * | ------------- | -------- |
1433
- * | mp | |
1434
- * | mp_web | |
1435
- * | web | alipay,alipayhk |
1436
- */
1437
- // @ts-ignore
1438
- export var getClientInfoAsync = /*#__PURE__*/promisify(getClientInfo);
1439
1412
  /**
1440
1413
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_OpenAPI_getAuthCode
1441
1414
  * @support
@@ -6805,4 +6778,22 @@ export var showTabBar = function showTabBar() {
6805
6778
  * | web | alipay |
6806
6779
  */
6807
6780
  // @ts-ignore
6808
- export var showTabBarAsync = /*#__PURE__*/promisify(showTabBar);
6781
+ export var showTabBarAsync = /*#__PURE__*/promisify(showTabBar);
6782
+ export var wfOpenDocument = function wfOpenDocument() {
6783
+ var rest = [];
6784
+ for (var _i = 0; _i < arguments.length; _i++) {
6785
+ rest[_i] = arguments[_i];
6786
+ }
6787
+ if (appEnv.isWebWorldfirst) return webWorldfirstWfOpenDocument.apply(void 0, rest);
6788
+ return notFound.apply(void 0, __spreadArray(['wfOpenDocument'], rest, false));
6789
+ };
6790
+ /**
6791
+ * @support
6792
+ * | Platform | Apps |
6793
+ * | ------------- | -------- |
6794
+ * | mp | |
6795
+ * | mp_web | |
6796
+ * | web | worldfirst |
6797
+ */
6798
+ // @ts-ignore
6799
+ export var wfOpenDocumentAsync = /*#__PURE__*/promisify(wfOpenDocument);