@pisell/utils 1.0.38 → 1.0.39
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/es/jsBridge/index.d.ts +12 -0
- package/es/jsBridge/index.js +17 -0
- package/lib/jsBridge/index.d.ts +12 -0
- package/lib/jsBridge/index.js +13 -0
- package/package.json +1 -1
package/es/jsBridge/index.d.ts
CHANGED
|
@@ -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): void;
|
|
106
118
|
export {};
|
package/es/jsBridge/index.js
CHANGED
|
@@ -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) {
|
|
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
|
+
});
|
|
18
35
|
}
|
package/lib/jsBridge/index.d.ts
CHANGED
|
@@ -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): void;
|
|
106
118
|
export {};
|
package/lib/jsBridge/index.js
CHANGED
|
@@ -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) {
|
|
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
|
+
});
|
|
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
|
});
|