hylid-bridge 4.0.0-alpha.17 → 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.
package/lib/bridges.d.ts CHANGED
@@ -3000,7 +3000,10 @@ export declare const postNotification: PickMPAttr<'postNotification'>;
3000
3000
  * | mp_web | |
3001
3001
  * | web | alipay |
3002
3002
  */
3003
- 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>;
3004
3007
  /**
3005
3008
  * @support
3006
3009
  * | Platform | Apps |
@@ -3040,7 +3043,9 @@ export declare const removeNotifyListener: PickMPAttr<'removeNotifyListener'>;
3040
3043
  * | mp_web | |
3041
3044
  * | web | alipay |
3042
3045
  */
3043
- 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>;
3044
3049
  /**
3045
3050
  * @support
3046
3051
  * | Platform | Apps |
@@ -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,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>;
@@ -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;