@pisell/utils 1.0.20 → 1.0.22

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/image.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export declare const image: {
2
+ ali: (url: string, w: number) => string;
3
+ getImageSize: (url: string) => {
4
+ width: number;
5
+ height: number;
6
+ ratio: number;
7
+ success: boolean;
8
+ widthRatio: number;
9
+ originRatio: number;
10
+ };
11
+ };
package/lib/image.js ADDED
@@ -0,0 +1,78 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/image.ts
20
+ var image_exports = {};
21
+ __export(image_exports, {
22
+ image: () => image
23
+ });
24
+ module.exports = __toCommonJS(image_exports);
25
+ var ali = (url, w) => {
26
+ if (!url || /^\s+$/.test(url)) {
27
+ return "";
28
+ }
29
+ if (/x-oss-process=/.test(url)) {
30
+ return url;
31
+ }
32
+ let dpr = 2;
33
+ w = w || 750;
34
+ if (url.indexOf("?") > -1) {
35
+ url += "&";
36
+ } else {
37
+ url += "?";
38
+ }
39
+ url += "x-oss-process=image/resize,w_" + parseInt(w * dpr + "") + ",image/format,webp/interlace,1,image/quality,Q_60/sharpen,90";
40
+ return url;
41
+ };
42
+ var getImageSize = (url) => {
43
+ let size = {
44
+ width: 375,
45
+ height: 375,
46
+ ratio: 1,
47
+ widthRatio: 1,
48
+ success: false,
49
+ originRatio: 1
50
+ };
51
+ if (typeof url !== "string")
52
+ return size;
53
+ try {
54
+ let arr = url.split("__");
55
+ if (arr[1]) {
56
+ let sizeArr = arr[1].split("_");
57
+ let _width = Number(sizeArr[0]) || 375;
58
+ let _height = Number(sizeArr[1]) || 375;
59
+ size.width = _width;
60
+ size.height = _height;
61
+ size.success = true;
62
+ size.ratio = Number(_height / _width);
63
+ size.widthRatio = Number((_width / _height).toFixed(2));
64
+ size.originRatio = Number(_height / _width);
65
+ }
66
+ return size;
67
+ } catch (err) {
68
+ return size;
69
+ }
70
+ };
71
+ var image = {
72
+ ali,
73
+ getImageSize
74
+ };
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ image
78
+ });
package/lib/index.d.ts CHANGED
@@ -6,3 +6,7 @@ export * from "./platform";
6
6
  export * from "./log";
7
7
  export * from "./format";
8
8
  export * from "./escPosPrinter";
9
+ export * from './miniRedux';
10
+ export * from "./jsBridge";
11
+ export * from "./image";
12
+ export * from "./locales";
package/lib/index.js CHANGED
@@ -24,6 +24,10 @@ __reExport(src_exports, require("./platform"), module.exports);
24
24
  __reExport(src_exports, require("./log"), module.exports);
25
25
  __reExport(src_exports, require("./format"), module.exports);
26
26
  __reExport(src_exports, require("./escPosPrinter"), module.exports);
27
+ __reExport(src_exports, require("./miniRedux"), module.exports);
28
+ __reExport(src_exports, require("./jsBridge"), module.exports);
29
+ __reExport(src_exports, require("./image"), module.exports);
30
+ __reExport(src_exports, require("./locales"), module.exports);
27
31
  // Annotate the CommonJS export names for ESM import in node:
28
32
  0 && (module.exports = {
29
33
  ...require("./otherUtils"),
@@ -33,5 +37,9 @@ __reExport(src_exports, require("./escPosPrinter"), module.exports);
33
37
  ...require("./platform"),
34
38
  ...require("./log"),
35
39
  ...require("./format"),
36
- ...require("./escPosPrinter")
40
+ ...require("./escPosPrinter"),
41
+ ...require("./miniRedux"),
42
+ ...require("./jsBridge"),
43
+ ...require("./image"),
44
+ ...require("./locales")
37
45
  });
@@ -0,0 +1,106 @@
1
+ declare type LanguageNumber = {
2
+ en: number;
3
+ zh_CN: number;
4
+ zh_HK: number;
5
+ };
6
+ declare type LanguageString = {
7
+ en: string;
8
+ zh_CN: string;
9
+ zh_HK: string;
10
+ } | string;
11
+ /**
12
+ * 打印小票
13
+ */
14
+ declare type WebPrint0 = {
15
+ /**
16
+ * 打印类型
17
+ * 0: 小票
18
+ * 1:ITS备货单/划菜单
19
+ * 2:手环
20
+ */
21
+ type: "0";
22
+ data: {
23
+ /** 订单ID */
24
+ order_id: string;
25
+ };
26
+ /** 打印语言对应的数量 */
27
+ language: LanguageNumber;
28
+ };
29
+ /**
30
+ * 打印ITS备货单/划菜单
31
+ */
32
+ declare type WebPrint1 = {
33
+ /**
34
+ * 打印类型
35
+ * 0: 小票
36
+ * 1:ITS备货单/划菜单
37
+ * 2:手环
38
+ */
39
+ type: "1";
40
+ data: {
41
+ /** 0:备货 1:划单 */
42
+ mode: "0" | "1";
43
+ resource: LanguageString;
44
+ /** 订单备注 */
45
+ order_note: string;
46
+ /** 订单时间或商品下单时间 */
47
+ time: string;
48
+ /** 订单编号 */
49
+ order_number?: string;
50
+ /** 商品 */
51
+ products: {
52
+ /** 商品名称 */
53
+ product_title: LanguageString;
54
+ /** 商品规格 */
55
+ product_option_string: LanguageString;
56
+ /** 商品备注 */
57
+ product_note: string;
58
+ /** 商品数量 */
59
+ product_quantity: number;
60
+ /** 加菜标识 待定 */
61
+ is_append?: boolean;
62
+ /** 退菜标识 待定 */
63
+ is_removed?: boolean;
64
+ }[];
65
+ };
66
+ /** 打印语言对应的数量 */
67
+ language: LanguageNumber;
68
+ };
69
+ declare type WebPrint2 = {
70
+ /**
71
+ * 打印类型
72
+ * 0: 小票
73
+ * 1:ITS备货单/划菜单
74
+ * 2:手环
75
+ */
76
+ type: "2";
77
+ data: {
78
+ /** 0: 普通票 1:成人票 2:免费成人票 */
79
+ type: "0" | "1" | "2";
80
+ /** 发行编码 */
81
+ encoded: string;
82
+ /** 编码 */
83
+ code: string;
84
+ /** 到期时间 */
85
+ expire_date: string;
86
+ areas: {
87
+ /** 区域名字 */
88
+ area_name: string;
89
+ /** 区域代码 */
90
+ area_code: string;
91
+ /** 可用次数 */
92
+ limit_num: number;
93
+ /** 已用次数 */
94
+ used_num: number;
95
+ }[];
96
+ };
97
+ };
98
+ declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2;
99
+ /**
100
+ * webView页面中调用打印机打印
101
+ * 此api暂时只支持native app平台下ios手机
102
+ * @param params
103
+ * @param callback
104
+ */
105
+ export declare function webPrint(params: WebPrintParams, callback: (...arg: any) => void): void;
106
+ export {};
@@ -0,0 +1,50 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/jsBridge/index.ts
30
+ var jsBridge_exports = {};
31
+ __export(jsBridge_exports, {
32
+ webPrint: () => webPrint
33
+ });
34
+ module.exports = __toCommonJS(jsBridge_exports);
35
+ var import_regDeviceApi = __toESM(require("./regDeviceApi"));
36
+ function webPrint(params, callback) {
37
+ (0, import_regDeviceApi.default)().then((jsBridge) => {
38
+ jsBridge.callDeviceApi({
39
+ apiName: "webPrint",
40
+ params,
41
+ callback: (...arg) => {
42
+ callback && callback(...arg);
43
+ }
44
+ });
45
+ });
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ webPrint
50
+ });
@@ -0,0 +1,15 @@
1
+ type ComposedJSBridge = {
2
+ // eslint-disable-next-line camelcase
3
+ callDeviceApi: (a: {
4
+ apiName: string;
5
+ callback: Functon;
6
+ onError?: (e: any) => void;
7
+ params?: any;
8
+ key_events?: string[];
9
+ }) => void;
10
+ calledByDevice: (a: { apiName: string; callback: Functon }) => void;
11
+ };
12
+
13
+ const regDeviceApi: () => Promise<ComposedJSBridge>;
14
+
15
+ export default regDeviceApi;
@@ -0,0 +1,149 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/jsBridge/regDeviceApi.js
20
+ var regDeviceApi_exports = {};
21
+ __export(regDeviceApi_exports, {
22
+ default: () => regDeviceApi
23
+ });
24
+ module.exports = __toCommonJS(regDeviceApi_exports);
25
+ var import_platform = require("../platform");
26
+ var androidRegStatus = false;
27
+ var iosRegStatus = false;
28
+ var androidBridge;
29
+ var iosBridge;
30
+ var composedBridge;
31
+ function regIosJsBridge(callback) {
32
+ if (window.WebViewJavascriptBridge) {
33
+ callback(window.WebViewJavascriptBridge);
34
+ return;
35
+ }
36
+ if (window.WVJBCallbacks) {
37
+ window.WVJBCallbacks.push(callback);
38
+ return;
39
+ }
40
+ window.WVJBCallbacks = [callback];
41
+ const WVJBIframe = document.createElement("iframe");
42
+ WVJBIframe.style.display = "none";
43
+ WVJBIframe.src = "https://__bridge_loaded__";
44
+ document.documentElement && document.documentElement.appendChild(WVJBIframe);
45
+ setTimeout(() => {
46
+ try {
47
+ document.documentElement && document.documentElement.removeChild(WVJBIframe);
48
+ } catch (e) {
49
+ console.log(e);
50
+ }
51
+ }, 0);
52
+ }
53
+ function regAndroidJsBridge(extraInit) {
54
+ if (window._jsBridge) {
55
+ extraInit(window._jsBridge);
56
+ return;
57
+ }
58
+ document.addEventListener(
59
+ "WebViewJavascriptBridgeReady",
60
+ (event) => {
61
+ const { bridge } = event;
62
+ window._jsBridge = bridge;
63
+ if (!bridge)
64
+ return;
65
+ bridge.init((message, responseCallback) => {
66
+ if (responseCallback) {
67
+ responseCallback("init responseCallback");
68
+ }
69
+ });
70
+ extraInit(bridge);
71
+ },
72
+ false
73
+ );
74
+ }
75
+ function getComposedBridge(deviceType) {
76
+ if (composedBridge) {
77
+ return composedBridge;
78
+ }
79
+ composedBridge = {
80
+ // 主动调用设备的方法
81
+ callDeviceApi: ({ apiName, callback: inCb, params = {}, onError }) => {
82
+ const callback = (res, ...args) => {
83
+ let result = res;
84
+ try {
85
+ result = JSON.parse(res);
86
+ } catch (error) {
87
+ console.log(`error ${apiName}`, error);
88
+ }
89
+ if (result.code || result.code === 0) {
90
+ result.code = `${result.code}`;
91
+ }
92
+ inCb(result, ...args);
93
+ };
94
+ if (deviceType === "iphone") {
95
+ iosBridge.callHandler(apiName, params, callback, (e) => {
96
+ console.log(e, "--- \u8C03\u7528ios api\u62A5\u9519\uFF1A", apiName);
97
+ if (onError) {
98
+ onError(e);
99
+ }
100
+ });
101
+ } else if (deviceType === "android") {
102
+ androidBridge.callHandler(apiName, params, callback, (e) => {
103
+ console.log(e, "--- \u8C03\u7528android api\u62A5\u9519\uFF1A", apiName);
104
+ if (onError) {
105
+ onError(e);
106
+ }
107
+ });
108
+ } else {
109
+ console.log("--- \u6CA1\u83B7\u53D6\u5230js bridge ---");
110
+ }
111
+ },
112
+ // 被设备调用的方法
113
+ calledByDevice: ({ apiName, callback }) => {
114
+ if (deviceType === "iphone") {
115
+ iosBridge.registerHandler(apiName, callback);
116
+ } else if (deviceType === "android") {
117
+ androidBridge.registerHandler(apiName, callback);
118
+ }
119
+ }
120
+ };
121
+ return composedBridge;
122
+ }
123
+ function regDeviceApi() {
124
+ return new Promise((resolve, reject) => {
125
+ if ((0, import_platform.isIos)() && !iosRegStatus) {
126
+ regIosJsBridge((bridge) => {
127
+ iosRegStatus = true;
128
+ iosBridge = bridge;
129
+ const realBridge = getComposedBridge("iphone");
130
+ resolve(realBridge);
131
+ });
132
+ } else if ((0, import_platform.isIos)() && iosRegStatus) {
133
+ const realBridge = getComposedBridge("iphone");
134
+ resolve(realBridge);
135
+ } else if ((0, import_platform.isAndroid)() && !androidRegStatus) {
136
+ regAndroidJsBridge((bridge) => {
137
+ androidBridge = bridge;
138
+ androidRegStatus = true;
139
+ const realBridge = getComposedBridge("android");
140
+ resolve(realBridge);
141
+ });
142
+ } else if ((0, import_platform.isAndroid)() && androidRegStatus) {
143
+ const realBridge = getComposedBridge("android");
144
+ resolve(realBridge);
145
+ } else {
146
+ reject();
147
+ }
148
+ });
149
+ }
@@ -0,0 +1,13 @@
1
+ declare const locales: {
2
+ init: (_localeMaps: any, _locale: string) => void;
3
+ getText: (id: string) => any;
4
+ locale: string;
5
+ localeMap: any;
6
+ localeMaps: {
7
+ en: {};
8
+ 'zh-CN': {};
9
+ 'zh-HK': {};
10
+ };
11
+ formatLocale: (_locale: string) => string;
12
+ };
13
+ export default locales;
package/lib/locales.js ADDED
@@ -0,0 +1,65 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/locales.ts
20
+ var locales_exports = {};
21
+ __export(locales_exports, {
22
+ default: () => locales_default
23
+ });
24
+ module.exports = __toCommonJS(locales_exports);
25
+ var localeMaps = {
26
+ en: {},
27
+ "zh-CN": {},
28
+ "zh-HK": {}
29
+ };
30
+ var locale = "en";
31
+ var localeMap = {};
32
+ var formatLocale = (_locale) => {
33
+ let obj = {
34
+ "en": "en",
35
+ "zh-CN": "zh-CN",
36
+ "zh-HK": "zh-HK",
37
+ "zh-TW": "zh-HK",
38
+ "en-US": "en"
39
+ };
40
+ return obj[_locale] || "en";
41
+ };
42
+ var init = (_localeMaps, _locale) => {
43
+ locale = formatLocale(_locale);
44
+ let allLocales = {};
45
+ for (let key in localeMaps) {
46
+ allLocales[key] = {
47
+ ...localeMaps[key],
48
+ ..._localeMaps[key]
49
+ };
50
+ }
51
+ localeMaps = allLocales;
52
+ localeMap = localeMaps[locale];
53
+ };
54
+ var getText = (id) => {
55
+ return localeMap[id] || id;
56
+ };
57
+ var locales = {
58
+ init,
59
+ getText,
60
+ locale,
61
+ localeMap,
62
+ localeMaps,
63
+ formatLocale
64
+ };
65
+ var locales_default = locales;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ interface MiniReduxProps<State, Namespace> {
3
+ namespace?: Namespace;
4
+ state?: State;
5
+ reducers?: any;
6
+ effects?: any;
7
+ }
8
+ export declare const miniRedux: <State extends Record<string, any>, Namespace extends string>({ namespace, state, reducers, effects, }: MiniReduxProps<State, Namespace>) => {
9
+ Context: React.Context<{ [K in Namespace]: State; } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
15
+ Provider: (ComponentUi: any) => (props: any) => JSX.Element;
16
+ };
17
+ export {};
@@ -0,0 +1,90 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/miniRedux.tsx
30
+ var miniRedux_exports = {};
31
+ __export(miniRedux_exports, {
32
+ miniRedux: () => miniRedux
33
+ });
34
+ module.exports = __toCommonJS(miniRedux_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var miniRedux = ({
37
+ namespace = "state",
38
+ state,
39
+ reducers = {},
40
+ effects = {}
41
+ }) => {
42
+ const Context = (0, import_react.createContext)({});
43
+ const Provider = (ComponentUi) => {
44
+ const Components = (props) => {
45
+ const [providerState, dispatch] = (0, import_react.useReducer)(
46
+ (state2, { type, payload }) => {
47
+ if (reducers[type]) {
48
+ return reducers[type](state2, payload) || state2;
49
+ } else {
50
+ return state2;
51
+ }
52
+ },
53
+ state
54
+ );
55
+ const _dispatch = (0, import_react.useCallback)(({ type, payload }) => {
56
+ if (effects[type]) {
57
+ effects[type].call(null, payload, dispatch);
58
+ } else if (reducers[type]) {
59
+ dispatch({ type, payload });
60
+ }
61
+ }, []);
62
+ let _props = {
63
+ ...props,
64
+ [namespace]: providerState,
65
+ dispatch: _dispatch
66
+ };
67
+ let _ref = null;
68
+ if (_props.forwardedRef) {
69
+ _ref = _props.forwardedRef;
70
+ delete _props.forwardedRef;
71
+ }
72
+ return /* @__PURE__ */ import_react.default.createElement(
73
+ Context.Provider,
74
+ {
75
+ value: { [namespace]: providerState, dispatch: _dispatch }
76
+ },
77
+ /* @__PURE__ */ import_react.default.createElement(ComponentUi, { ..._props, ref: _ref })
78
+ );
79
+ };
80
+ return Components;
81
+ };
82
+ return {
83
+ Context,
84
+ Provider
85
+ };
86
+ };
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ miniRedux
90
+ });
@@ -6,3 +6,25 @@
6
6
  * @return {*}
7
7
  */
8
8
  export declare const getUniqueId: (prefix?: string, maxLength?: number) => string;
9
+ /**
10
+ * @title: 对数组进行增|删
11
+ * @description: 用于多选选中和取消选中的处理
12
+ * @param {any} list
13
+ * @param {any} item
14
+ * @param {string} key
15
+ * @return {*}
16
+ * @Author: zhiwei.Wang
17
+ * @Date: 2023-12-19 16:44
18
+ */
19
+ export declare const changeArray: <T>(list: T[] | undefined, item: T, key?: string) => T[];
20
+ /**
21
+ * @title: 判断某个字段是否在列表内
22
+ * @description:
23
+ * @param {*} T
24
+ * @param {boolean} param2
25
+ * @return {*}
26
+ * @Author: zhiwei.Wang
27
+ * @Date: 2023-12-19 16:54
28
+ */
29
+ export declare const getItemByArray: <T>(list: T[] | undefined, item: T, key?: string) => boolean;
30
+ export declare const createArray: (length: number, returnItem: any) => any;