hylid-bridge 4.0.0-alpha.16 → 4.0.0-alpha.18

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 (37) hide show
  1. package/lib/bridges.d.ts +10 -3
  2. package/lib/clients/mp/alipay/index.d.ts +1 -1
  3. package/lib/clients/mp/alipayhk/index.d.ts +1 -1
  4. package/lib/clients/mp/chope/index.d.ts +1 -1
  5. package/lib/clients/mp/dana/index.d.ts +1 -1
  6. package/lib/clients/mp/demo/index.d.ts +1 -1
  7. package/lib/clients/mp/gcash/index.d.ts +1 -1
  8. package/lib/clients/mp/tngd/index.d.ts +1 -1
  9. package/lib/clients/mp/truemoney/index.d.ts +1 -1
  10. package/lib/clients/mp_web/alipay/index.d.ts +1 -1
  11. package/lib/clients/mp_web/alipayhk/index.d.ts +1 -1
  12. package/lib/clients/mp_web/chope/index.d.ts +1 -1
  13. package/lib/clients/mp_web/dana/index.d.ts +1 -1
  14. package/lib/clients/mp_web/demo/index.d.ts +1 -1
  15. package/lib/clients/mp_web/gcash/index.d.ts +1 -1
  16. package/lib/clients/mp_web/tngd/index.d.ts +1 -1
  17. package/lib/clients/mp_web/truemoney/index.d.ts +1 -1
  18. package/lib/clients/web/alipay/index.d.ts +2 -2
  19. package/lib/common/apis/custom/web/h5/clearStorage.js +2 -9
  20. package/lib/common/apis/custom/web/h5/clearStorageSync.d.ts +1 -1
  21. package/lib/common/apis/custom/web/h5/clearStorageSync.js +3 -3
  22. package/lib/common/apis/custom/web/h5/getStorage.js +2 -5
  23. package/lib/common/apis/custom/web/h5/getStorageSync.js +2 -5
  24. package/lib/common/apis/custom/web/h5/setStorage.js +3 -2
  25. package/lib/common/apis/custom/web/h5/setStorageSync.js +3 -2
  26. package/lib/common/apis/custom/web/setNavigationBar.js +2 -66
  27. package/lib/common/apis/generated/mp/setCanPullDown.d.ts +4 -2
  28. package/lib/common/apis/generated/mp_web/setCanPullDown.d.ts +4 -2
  29. package/lib/common/apis/generated/web/postNotification.d.ts +5 -2
  30. package/lib/dsl.d.ts +3 -1
  31. package/lib/internal/apis/custom/web/removeNotifyListener.d.ts +1 -1
  32. package/lib/umd/index.js +1 -1
  33. package/lib/umd/web_alipay.js +1 -1
  34. package/lib/umd/web_demo.js +1 -1
  35. package/lib/umd/web_h5.js +1 -1
  36. package/lib/umd/web_tngdh5ng.js +1 -1
  37. package/package.json +6 -6
package/lib/bridges.d.ts CHANGED
@@ -2049,7 +2049,9 @@ export declare const setCanPullDown: PickMPAttr<'setCanPullDown'>;
2049
2049
  * | web | |
2050
2050
  * | mp_web | demo,gcash,tngd,alipay,chope,alipayhk,dana,truemoney |
2051
2051
  */
2052
- export declare const setCanPullDownAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
2052
+ export declare const setCanPullDownAsync: (args?: ({
2053
+ canPullDown: boolean;
2054
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
2053
2055
  /**
2054
2056
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_Device_Clipboard_setClipboard
2055
2057
  * @support
@@ -2998,7 +3000,10 @@ export declare const postNotification: PickMPAttr<'postNotification'>;
2998
3000
  * | mp_web | |
2999
3001
  * | web | alipay |
3000
3002
  */
3001
- export declare const postNotificationAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
3003
+ export declare const postNotificationAsync: (args?: ({
3004
+ name: string;
3005
+ data: object;
3006
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
3002
3007
  /**
3003
3008
  * @support
3004
3009
  * | Platform | Apps |
@@ -3038,7 +3043,9 @@ export declare const removeNotifyListener: PickMPAttr<'removeNotifyListener'>;
3038
3043
  * | mp_web | |
3039
3044
  * | web | alipay |
3040
3045
  */
3041
- export declare const removeNotifyListenerAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
3046
+ export declare const removeNotifyListenerAsync: (args?: ({
3047
+ name: string;
3048
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
3042
3049
  /**
3043
3050
  * @support
3044
3051
  * | Platform | Apps |
@@ -346,7 +346,7 @@ declare const _default: {
346
346
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
347
347
  setCanPullDown: (args: {
348
348
  canPullDown: boolean;
349
- }) => void;
349
+ } & import("@hylid/types").AsyncCallback<void>) => void;
350
350
  setClipboard: (args: SetClipboardArgs) => void;
351
351
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
352
352
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -387,7 +387,7 @@ declare const _default: {
387
387
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
388
388
  setCanPullDown: (args: {
389
389
  canPullDown: boolean;
390
- }) => void;
390
+ } & import("@hylid/types").AsyncCallback<void>) => void;
391
391
  setClipboard: (args: SetClipboardArgs) => void;
392
392
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
393
393
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -338,7 +338,7 @@ declare const _default: {
338
338
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
339
339
  setCanPullDown: (args: {
340
340
  canPullDown: boolean;
341
- }) => void;
341
+ } & import("@hylid/types").AsyncCallback<void>) => void;
342
342
  setClipboard: (args: SetClipboardArgs) => void;
343
343
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
344
344
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -326,7 +326,7 @@ declare const _default: {
326
326
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
327
327
  setCanPullDown: (args: {
328
328
  canPullDown: boolean;
329
- }) => void;
329
+ } & import("@hylid/types").AsyncCallback<void>) => void;
330
330
  setClipboard: (args: SetClipboardArgs) => void;
331
331
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
332
332
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -331,7 +331,7 @@ declare const _default: {
331
331
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
332
332
  setCanPullDown: (args: {
333
333
  canPullDown: boolean;
334
- }) => void;
334
+ } & import("@hylid/types").AsyncCallback<void>) => void;
335
335
  setClipboard: (args: SetClipboardArgs) => void;
336
336
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
337
337
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -317,7 +317,7 @@ declare const _default: {
317
317
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
318
318
  setCanPullDown: (args: {
319
319
  canPullDown: boolean;
320
- }) => void;
320
+ } & import("@hylid/types").AsyncCallback<void>) => void;
321
321
  setClipboard: (args: SetClipboardArgs) => void;
322
322
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
323
323
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -331,7 +331,7 @@ declare const _default: {
331
331
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
332
332
  setCanPullDown: (args: {
333
333
  canPullDown: boolean;
334
- }) => void;
334
+ } & import("@hylid/types").AsyncCallback<void>) => void;
335
335
  setClipboard: (args: SetClipboardArgs) => void;
336
336
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
337
337
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -364,7 +364,7 @@ declare const _default: {
364
364
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
365
365
  setCanPullDown: (args: {
366
366
  canPullDown: boolean;
367
- }) => void;
367
+ } & import("@hylid/types").AsyncCallback<void>) => void;
368
368
  setClipboard: (args: SetClipboardArgs) => void;
369
369
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
370
370
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -331,7 +331,7 @@ declare const _default: {
331
331
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
332
332
  setCanPullDown: (args: {
333
333
  canPullDown: boolean;
334
- }) => void;
334
+ } & import("@hylid/types").AsyncCallback<void>) => void;
335
335
  setClipboard: (args: SetClipboardArgs) => void;
336
336
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
337
337
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -331,7 +331,7 @@ declare const _default: {
331
331
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
332
332
  setCanPullDown: (args: {
333
333
  canPullDown: boolean;
334
- }) => void;
334
+ } & import("@hylid/types").AsyncCallback<void>) => void;
335
335
  setClipboard: (args: SetClipboardArgs) => void;
336
336
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
337
337
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -331,7 +331,7 @@ declare const _default: {
331
331
  setBackgroundColor: (args: SetBackgroundColorArgs) => void;
332
332
  setCanPullDown: (args: {
333
333
  canPullDown: boolean;
334
- }) => void;
334
+ } & import("@hylid/types").AsyncCallback<void>) => void;
335
335
  setClipboard: (args: SetClipboardArgs) => void;
336
336
  setKeepScreenOn: (args: SetKeepScreenOnArgs) => void;
337
337
  setNavigationBar: (args: SetNavigationBarArgs) => void;
@@ -177,7 +177,7 @@ declare const _default: {
177
177
  postNotification: (args: {
178
178
  name: string;
179
179
  data: object;
180
- }) => void;
180
+ } & import("@hylid/types").AsyncCallback<void>) => void;
181
181
  getMainSelectedCity: (args: import("@hylid/types").AsyncCallback<{
182
182
  fullName: string;
183
183
  enName: string;
@@ -311,7 +311,7 @@ declare const _default: {
311
311
  } & import("@hylid/types").AsyncCallback<any>) => void;
312
312
  removeNotifyListener: (args: {
313
313
  name: string;
314
- }) => void;
314
+ } & import("@hylid/types").AsyncCallback<void>) => void;
315
315
  popWindow: () => void;
316
316
  };
317
317
  export default _default;
@@ -1,11 +1,4 @@
1
- import StorageImpl from "../../../../utils/storage";
1
+ import { clearStorage as baseClearStorage } from 'miniapp-web-jsapi/lib/web/jsapi/storage';
2
2
  export default function clearStorage(options) {
3
- var _a, _b, _c;
4
- try {
5
- StorageImpl.clearStorage();
6
- (_a = options === null || options === void 0 ? void 0 : options.success) === null || _a === void 0 ? void 0 : _a.call(options, null);
7
- } catch (e) {
8
- (_b = options === null || options === void 0 ? void 0 : options.fail) === null || _b === void 0 ? void 0 : _b.call(options, e);
9
- }
10
- (_c = options === null || options === void 0 ? void 0 : options.complete) === null || _c === void 0 ? void 0 : _c.call(options);
3
+ return baseClearStorage(options);
11
4
  }
@@ -1 +1 @@
1
- export default function clearStorage(): void;
1
+ export default function clearStorageSync(): void;
@@ -1,4 +1,4 @@
1
- import StorageImpl from "../../../../utils/storage";
2
- export default function clearStorage() {
3
- StorageImpl.clearStorage();
1
+ import { clearStorageSync as baseClearStorageSync } from 'miniapp-web-jsapi/lib/web/jsapi/storage';
2
+ export default function clearStorageSync() {
3
+ return baseClearStorageSync();
4
4
  }
@@ -1,14 +1,11 @@
1
- import StorageImpl from "../../../../utils/storage";
2
1
  export default (function (opt) {
3
2
  var key = opt.key,
4
3
  success = opt.success,
5
4
  fail = opt.fail,
6
5
  complete = opt.complete;
7
6
  try {
8
- var value = StorageImpl.getStorage(key);
9
- success === null || success === void 0 ? void 0 : success({
10
- data: value
11
- });
7
+ var value = localStorage.getItem(key);
8
+ success === null || success === void 0 ? void 0 : success(value ? JSON.parse(value) : value);
12
9
  } catch (e) {
13
10
  fail === null || fail === void 0 ? void 0 : fail(e);
14
11
  }
@@ -1,8 +1,5 @@
1
- import StorageImpl from "../../../../utils/storage";
2
1
  export default (function (opt) {
3
2
  var key = opt.key;
4
- var value = StorageImpl.getStorage(key);
5
- return {
6
- data: value
7
- };
3
+ var value = localStorage.getItem(key);
4
+ return value ? JSON.parse(value) : value;
8
5
  });
@@ -1,4 +1,3 @@
1
- import StorageImpl from "../../../../utils/storage";
2
1
  export default (function (opt) {
3
2
  var key = opt.key,
4
3
  data = opt.data,
@@ -6,7 +5,9 @@ export default (function (opt) {
6
5
  fail = opt.fail,
7
6
  complete = opt.complete;
8
7
  try {
9
- StorageImpl.setStorage(key, data);
8
+ localStorage.setItem(key, JSON.stringify({
9
+ data: data
10
+ }));
10
11
  success === null || success === void 0 ? void 0 : success();
11
12
  } catch (e) {
12
13
  fail === null || fail === void 0 ? void 0 : fail(e);
@@ -1,6 +1,7 @@
1
- import StorageImpl from "../../../../utils/storage";
2
1
  export default (function (opt) {
3
2
  var key = opt.key,
4
3
  data = opt.data;
5
- StorageImpl.setStorage(key, data);
4
+ localStorage.setItem(key, JSON.stringify({
5
+ data: data
6
+ }));
6
7
  });
@@ -1,67 +1,3 @@
1
- var __assign = this && this.__assign || function () {
2
- __assign = Object.assign || function (t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6
- }
7
- return t;
8
- };
9
- return __assign.apply(this, arguments);
10
- };
11
- import { webCall as call } from '@hylid/call';
12
- import { isNaN } from '../../../utils';
13
- var setNavigationBar = function setNavigationBar(options) {
14
- var title = options.title,
15
- image = options.image,
16
- backgroundColor = options.backgroundColor,
17
- borderBottomColor = options.borderBottomColor,
18
- reset = options.reset,
19
- success = options.success,
20
- complete = options.complete,
21
- _fail = options.fail;
22
- if (title || image) call('setTitle', {
23
- title: title,
24
- image: image
25
- });
26
- var bottomColorValue = Number.parseInt((borderBottomColor === null || borderBottomColor === void 0 ? void 0 : borderBottomColor.slice(1)) || 'ffffff', 16);
27
- var colorValue = backgroundColor ? Number.parseInt(backgroundColor.slice(1), 16) : '';
28
- call('setBarBottomLineColor', {
29
- color: bottomColorValue,
30
- fail: function fail(res) {
31
- if (_fail) {
32
- if (isNaN(bottomColorValue)) {
33
- res.error = 2;
34
- res.errorMessage = 'The color value is illegal.';
35
- }
36
- _fail(res);
37
- }
38
- }
39
- });
40
- var setTitleColorParams = {
41
- success: success,
42
- complete: complete,
43
- fail: _fail
44
- };
45
- if (colorValue) {
46
- Object.assign(setTitleColorParams, {
47
- color: colorValue || 'ffffff'
48
- });
49
- }
50
- if (reset) {
51
- Object.assign(setTitleColorParams, {
52
- reset: reset
53
- });
54
- }
55
- call('setTitleColor', __assign(__assign({}, setTitleColorParams), {
56
- fail: function fail(res) {
57
- if (_fail) {
58
- if (!reset || isNaN(colorValue)) {
59
- res.error = 2;
60
- res.errorMessage = 'The color value is illegal.';
61
- }
62
- _fail(res);
63
- }
64
- }
65
- }));
66
- };
1
+ import { setNavigationBar as _setNavigationBar } from '@alipay/stdlib/jsapi/smallfish/my';
2
+ var setNavigationBar = _setNavigationBar;
67
3
  export default setNavigationBar;
@@ -3,9 +3,11 @@
3
3
  */
4
4
  export declare const setCanPullDown: (args: {
5
5
  canPullDown: boolean;
6
- }) => void;
6
+ } & import("@hylid/types").AsyncCallback<void>) => void;
7
7
  export default setCanPullDown;
8
8
  /**
9
9
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_UI_Set-Pulldown_setCanPullDown
10
10
  */
11
- export declare const setCanPullDownAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
11
+ export declare const setCanPullDownAsync: (args?: ({
12
+ canPullDown: boolean;
13
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
@@ -3,9 +3,11 @@
3
3
  */
4
4
  export declare const setCanPullDown: (args: {
5
5
  canPullDown: boolean;
6
- }) => void;
6
+ } & import("@hylid/types").AsyncCallback<void>) => void;
7
7
  export default setCanPullDown;
8
8
  /**
9
9
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_UI_Set-Pulldown_setCanPullDown
10
10
  */
11
- export declare const setCanPullDownAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
11
+ export declare const setCanPullDownAsync: (args?: ({
12
+ canPullDown: boolean;
13
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
@@ -1,6 +1,9 @@
1
1
  export declare const postNotification: (args: {
2
2
  name: string;
3
3
  data: object;
4
- }) => void;
4
+ } & import("@hylid/types").AsyncCallback<void>) => void;
5
5
  export default postNotification;
6
- export declare const postNotificationAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
6
+ export declare const postNotificationAsync: (args?: ({
7
+ name: string;
8
+ data: object;
9
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
package/lib/dsl.d.ts CHANGED
@@ -2049,7 +2049,9 @@ export declare const setCanPullDown: PickMPAttr<'setCanPullDown'>;
2049
2049
  * | web | |
2050
2050
  * | mp_web | demo,gcash,tngd,alipay,chope,alipayhk,dana,truemoney |
2051
2051
  */
2052
- export declare const setCanPullDownAsync: (args?: import("@hylid/call/lib/promisify").Options | undefined) => Promise<any>;
2052
+ export declare const setCanPullDownAsync: (args?: ({
2053
+ canPullDown: boolean;
2054
+ } & import("@hylid/types").AsyncCallback<void>) | undefined) => Promise<void>;
2053
2055
  /**
2054
2056
  * @doc https://miniprogram.alipay.com/docs/miniprogram/mpdev/API_Device_Clipboard_setClipboard
2055
2057
  * @support
@@ -1,4 +1,4 @@
1
1
  declare const _default: (args: {
2
2
  name: string;
3
- }) => void;
3
+ } & import("@hylid/types").AsyncCallback<void>) => void;
4
4
  export default _default;