@pisell/utils 1.0.38 → 1.0.40

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.
@@ -103,4 +103,16 @@ declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2;
103
103
  * @param callback
104
104
  */
105
105
  export declare function webPrint(params: WebPrintParams, callback: (...arg: any) => void): void;
106
+ declare type DataManagerParams = {
107
+ module: "set" | "get";
108
+ key: string;
109
+ data?: any;
110
+ };
111
+ /**
112
+ * webView页面中调用APP内的数据
113
+ * 此api暂时只支持native app平台下ios手机
114
+ * @param params
115
+ * @param callback
116
+ */
117
+ export declare function dataManager(params: DataManagerParams, callback: (...arg: any) => void, onError: () => void): void;
106
118
  export {};
@@ -15,4 +15,21 @@ export function webPrint(params, _callback) {
15
15
  }
16
16
  });
17
17
  });
18
+ }
19
+ /**
20
+ * webView页面中调用APP内的数据
21
+ * 此api暂时只支持native app平台下ios手机
22
+ * @param params
23
+ * @param callback
24
+ */
25
+ export function dataManager(params, _callback2, onError) {
26
+ regDeviceApi().then(function (jsBridge) {
27
+ jsBridge.callDeviceApi({
28
+ apiName: "dataManager",
29
+ params: params,
30
+ callback: function callback() {
31
+ _callback2 && _callback2.apply(void 0, arguments);
32
+ }
33
+ });
34
+ }).catch(onError);
18
35
  }
@@ -103,4 +103,16 @@ declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2;
103
103
  * @param callback
104
104
  */
105
105
  export declare function webPrint(params: WebPrintParams, callback: (...arg: any) => void): void;
106
+ declare type DataManagerParams = {
107
+ module: "set" | "get";
108
+ key: string;
109
+ data?: any;
110
+ };
111
+ /**
112
+ * webView页面中调用APP内的数据
113
+ * 此api暂时只支持native app平台下ios手机
114
+ * @param params
115
+ * @param callback
116
+ */
117
+ export declare function dataManager(params: DataManagerParams, callback: (...arg: any) => void, onError: () => void): void;
106
118
  export {};
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/jsBridge/index.ts
30
30
  var jsBridge_exports = {};
31
31
  __export(jsBridge_exports, {
32
+ dataManager: () => dataManager,
32
33
  webPrint: () => webPrint
33
34
  });
34
35
  module.exports = __toCommonJS(jsBridge_exports);
@@ -44,7 +45,19 @@ function webPrint(params, callback) {
44
45
  });
45
46
  });
46
47
  }
48
+ function dataManager(params, callback, onError) {
49
+ (0, import_regDeviceApi.default)().then((jsBridge) => {
50
+ jsBridge.callDeviceApi({
51
+ apiName: "dataManager",
52
+ params,
53
+ callback: (...arg) => {
54
+ callback && callback(...arg);
55
+ }
56
+ });
57
+ }).catch(onError);
58
+ }
47
59
  // Annotate the CommonJS export names for ESM import in node:
48
60
  0 && (module.exports = {
61
+ dataManager,
49
62
  webPrint
50
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/utils",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",