atomaric 0.0.12 → 0.0.14

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/build/atomaric.js CHANGED
@@ -1,192 +1,129 @@
1
1
  class C {
2
- constructor(s) {
3
- this.value = s;
4
- }
5
- getValue() {
6
- return this.value;
7
- }
8
- setValue(s) {
9
- this.value = s;
10
- }
11
- }
12
- class T extends C {
13
- constructor(s, n) {
14
- super(s), this._defaultValue = s, this.subscribers = /* @__PURE__ */ new Set(), this.save = () => {
15
- }, this.invokeSubscriber = (e) => e(this.get()), this.do = {}, this.get = () => super.getValue(), this.subscribe = (e) => (this.subscribers.add(e), () => {
16
- this.subscribers.delete(e);
17
- }), this.set = (e, i) => {
18
- const l = typeof e == "function" ? e(this.get()) : e;
19
- l === this.get() || l === void 0 || typeof l == "number" && isNaN(l) || (super.setValue(l), this.subscribers.forEach(this.invokeSubscriber, this), i !== !0 && this.save(l));
20
- }, this.setDeferred = (e, i = 500, l, k = !0) => {
21
- k && this.debounceTimeout === void 0 && this.set(e, l), clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(() => {
22
- this.set(e, l), delete this.debounceTimeout;
23
- }, i);
2
+ constructor(n, o) {
3
+ let A = n, g, b = () => {
24
4
  };
25
- const c = (e, i) => i;
26
- let h = null;
27
- typeof s == "number" && (h = c(s, {
28
- increment: (e) => {
29
- this.set(+this.get() + (e ?? 0));
30
- }
31
- })), typeof s == "boolean" && (h = c(s, {
32
- toggle: () => {
33
- this.set(!this.get());
34
- }
35
- })), Array.isArray(s) && (h = c(s, {
36
- push: (e) => {
37
- this.set([...this.get(), e]);
38
- },
39
- unshift: (e) => {
40
- this.set([e, ...this.get()]);
41
- },
42
- update: (e) => {
43
- const i = [...this.get()];
44
- e(i), this.set(i);
45
- },
46
- filter: (e) => {
47
- this.set(this.get().filter(e ?? U));
48
- }
49
- })), s instanceof Set && (h = c(s, {
50
- add: (e) => {
51
- const i = new Set(this.get());
52
- i.add(e), this.set(i);
53
- },
54
- delete: (e) => {
55
- const i = new Set(this.get());
56
- i.delete(e), this.set(i);
57
- },
58
- clear: () => {
59
- this.set(/* @__PURE__ */ new Set());
60
- },
61
- update: (e) => {
62
- const i = new Set(this.get());
63
- e(i), this.set(i);
64
- }
65
- }));
66
- const E = typeof n == "object" && "do" in n ? n.do(
67
- () => this.get(),
68
- (e, i) => this.set(e, i)
69
- ) : {};
70
- if (this.do = {
71
- ...E,
72
- ...h
73
- }, this.reset = () => {
74
- this.set(s, !0), this.subscribers.forEach(this.invokeSubscriber, this);
75
- }, n == null) return;
76
- let d = null, m = !0, S = !0, b = !1, g = s instanceof Set ? (e) => new Set(JSON.parse(e)) : (e) => JSON.parse(e), f = s instanceof Set ? (e) => {
77
- if (e instanceof Set) return JSON.stringify(Array.from(e));
78
- throw console.error(e), "The value is not Set instance";
79
- } : (e) => JSON.stringify(e);
80
- if (typeof n == "string" ? d = n : "storeKey" in n && (m = n.warnOnDuplicateStoreKey ?? !0, S = n.listenStorageChanges ?? !0, d = n.storeKey, g = n.parseValue ?? g, f = n.stringifyValue ?? f, b = n.unchangable ?? b), d === null) return;
81
- const o = `atom/${d}`;
82
- let v = !0;
83
- if (this.get = () => {
84
- if (this.get = () => super.getValue(), v) {
85
- v = !1;
5
+ const _ = (t) => A = t, y = () => A;
6
+ this.get = () => y();
7
+ let p = () => {
8
+ const t = (s, i) => i;
9
+ let c = null;
10
+ typeof n == "number" && (c = t(n, {
11
+ increment: (s) => {
12
+ r(+this.get() + (s ?? 0));
13
+ }
14
+ })), typeof n == "boolean" && (c = t(n, {
15
+ toggle: () => {
16
+ r(!this.get());
17
+ }
18
+ })), Array.isArray(n) && (c = t(n, {
19
+ push: (...s) => {
20
+ r([this.get()].flat().concat(s));
21
+ },
22
+ unshift: (...s) => {
23
+ r(s.concat(this.get()));
24
+ },
25
+ update: (s) => {
26
+ const i = [...this.get()];
27
+ s(i), r(i);
28
+ },
29
+ filter: (s) => {
30
+ r(this.get().filter(s ?? I));
31
+ }
32
+ })), n instanceof Set && (c = t(n, {
33
+ add: (s) => {
34
+ const i = new Set(this.get());
35
+ i.add(s), r(i);
36
+ },
37
+ delete: (s) => {
38
+ const i = new Set(this.get());
39
+ i.delete(s), r(i);
40
+ },
41
+ clear: () => {
42
+ r(/* @__PURE__ */ new Set());
43
+ },
44
+ update: (s) => {
45
+ const i = new Set(this.get());
46
+ s(i), r(i);
47
+ }
48
+ }));
49
+ const d = {
50
+ ...typeof o == "object" && "do" in o ? o.do(
51
+ () => this.get(),
52
+ (s, i) => r(s, i)
53
+ ) : {},
54
+ ...c
55
+ };
56
+ return p = () => d, d;
57
+ };
58
+ Object.defineProperty(this, "do", { get: () => p() }), Object.defineProperty(this, "defaultValue", { get: () => n });
59
+ const S = /* @__PURE__ */ new Set(), D = (t) => t(this.get());
60
+ this.subscribe = (t) => (S.add(t), () => (S.delete(t), void 0));
61
+ const r = (t, c) => {
62
+ const l = typeof t == "function" ? t(this.get()) : t;
63
+ l === this.get() || l === void 0 || typeof l == "number" && isNaN(l) || (_(l), S.forEach(D, this), c !== !0 && b(l));
64
+ };
65
+ if (this.set = (t, c) => r(t, c), this.reset = () => {
66
+ r(n, !0), S.forEach(D, this);
67
+ }, this.setDeferred = (t, c = 500, l, d = !0) => {
68
+ d && g === void 0 && r(t, l), clearTimeout(g), g = setTimeout(() => {
69
+ r(t, l), g = void 0;
70
+ }, c);
71
+ }, o == null) return;
72
+ let u = null, N = !0, j = !0, w = n instanceof Set ? (t) => new Set(JSON.parse(t)) : (t) => JSON.parse(t), m = n instanceof Set ? (t) => {
73
+ if (t instanceof Set) return JSON.stringify(Array.from(t));
74
+ throw console.error(t), "The value is not Set instance";
75
+ } : (t) => JSON.stringify(t);
76
+ if (typeof o == "string" ? u = o : "storeKey" in o && (N = o.warnOnDuplicateStoreKey ?? !0, j = o.listenStorageChanges ?? !0, u = o.storeKey, w = o.parseValue ?? w, m = o.stringifyValue ?? m), u === null) return;
77
+ const a = `atom/${u}`;
78
+ let k = !0;
79
+ this.get = () => {
80
+ if (this.get = () => y(), k) {
81
+ k = !1;
86
82
  try {
87
- super.setValue(o in r ? g(r[o]) : s);
83
+ _(a in h ? w(h[a]) : n);
88
84
  } catch {
89
- console.warn("Invalid json value", r[o]);
85
+ console.warn("Invalid json value", h[a]);
90
86
  }
91
87
  }
92
- return super.getValue();
93
- }, this.save = (e) => {
94
- if (e === s) {
88
+ return y();
89
+ }, b = (t) => {
90
+ if (t === n) {
95
91
  this.reset();
96
92
  return;
97
93
  }
98
- r[o] = f(e), I(o);
94
+ h[a] = m(t);
99
95
  }, this.reset = () => {
100
- delete r[o], this.set(s, !0);
101
- }, m && u[o] !== void 0 && console.warn("Duplicate Atom key", d), u[o] = {}, S)
102
- if (b) {
103
- let e, i = !1;
104
- u[o].updateUnchangable = () => {
105
- try {
106
- this.set(g(r[o]), !0);
107
- } catch {
108
- }
109
- }, a[o] = () => {
110
- i || (i = !0, r[o] = f(this.get()), clearTimeout(e), e = setTimeout(() => i = !1, 100));
111
- }, N();
112
- } else
113
- u[o].updatable = (e) => {
114
- if (e.newValue === null) {
115
- this.reset();
116
- return;
117
- }
118
- try {
119
- this.set(g(e.newValue));
120
- } catch {
121
- console.warn("Invalid json value", e.newValue);
122
- }
123
- };
124
- }
125
- get defaultValue() {
126
- return this._defaultValue;
96
+ delete h[a], r(n, !0);
97
+ }, N && f[a] !== void 0 && console.warn("Duplicate Atom key", u), j && (f[a] = (t) => {
98
+ if (t.newValue === null) {
99
+ this.reset();
100
+ return;
101
+ }
102
+ try {
103
+ r(w(t.newValue));
104
+ } catch {
105
+ console.warn("Invalid json value", t.newValue);
106
+ }
107
+ });
127
108
  }
128
109
  }
129
- const r = window.localStorage, u = {}, a = {};
130
- window.addEventListener("storage", (t) => {
131
- var s, n, c;
132
- t.key === null || t.newValue === t.oldValue || ((s = a[t.key]) == null || s.call(a), (c = (n = u[t.key]) == null ? void 0 : n.updatable) == null || c.call(n, t));
133
- });
134
- const A = new BroadcastChannel("unchangableChanged");
135
- A.addEventListener("message", (t) => {
136
- var s, n;
137
- (n = (s = u[t.data]) == null ? void 0 : s.updateUnchangable) == null || n.call(s);
110
+ const h = window.localStorage, f = {}, I = (e) => e;
111
+ window.addEventListener("storage", (e) => {
112
+ var n;
113
+ e.key === null || e.newValue === e.oldValue || (n = f[e.key]) == null || n.call(f, e);
138
114
  });
139
- const I = (t) => {
140
- A.postMessage(t);
141
- }, D = r.setItem.bind(r), L = r.removeItem.bind(r), j = r.clear.bind(r);
142
- r.setItem = (t, s) => {
143
- a[t] === void 0 && D.call(r, t, s);
144
- };
145
- r.removeItem = (t) => {
146
- a[t] === void 0 && L.call(r, t);
147
- };
148
- r.clear = () => {
149
- j(), w();
150
- };
151
- let p = r.length;
152
- const w = () => {
153
- p !== r.length && (p = r.length, Object.keys(a).forEach((t) => {
154
- t in r || (I(t), a[t]());
155
- }));
156
- }, N = /* @__PURE__ */ (() => {
157
- let t = !1;
158
- return () => {
159
- if (t) return;
160
- t = !0;
161
- let s;
162
- const n = () => {
163
- clearInterval(s), s = setInterval(w, 0), w();
164
- };
165
- n(), window.addEventListener("focus", () => clearInterval(s), !0), window.addEventListener("focus", () => clearInterval(s), !1), window.addEventListener("click", () => clearInterval(s), !1), window.addEventListener("click", () => clearInterval(s), !0), window.addEventListener("blur", n, !0);
166
- };
167
- })();
168
- (() => {
169
- const t = (n) => {
170
- var c;
171
- n in r || (c = a[n]) == null || c.call(a);
172
- }, s = () => Object.keys(u).forEach(t);
173
- Object.defineProperty(window, "localStorage", {
174
- get: () => (Promise.resolve().then(s), r)
175
- });
176
- })();
177
- const U = (t) => t;
178
- let y = () => {
115
+ let E = () => {
179
116
  throw "call configureAtomaric() before all!";
180
117
  };
181
- const J = (t) => y = t.useSyncExternalStore, V = (t) => y(t.subscribe, t.get), x = (t) => t.set, B = (t) => t.setDeferred, G = (t) => t.get, M = (t) => t.do, P = (t) => [V(t), x(t)], R = (t, s) => new T(t, s);
118
+ const x = (e) => E = e.useSyncExternalStore, J = (e) => E(e.subscribe, e.get), T = (e) => e.set, v = (e) => e.setDeferred, F = (e) => e.get, G = (e) => e.do, L = (e) => [J(e), T(e)], P = (e, n) => new C(e, n);
182
119
  export {
183
- T as Atom,
184
- R as atom,
185
- J as configureAtomaric,
186
- P as useAtom,
187
- M as useAtomDo,
188
- G as useAtomGet,
189
- x as useAtomSet,
190
- B as useAtomSetDeferred,
191
- V as useAtomValue
120
+ C as Atom,
121
+ P as atom,
122
+ x as configureAtomaric,
123
+ L as useAtom,
124
+ G as useAtomDo,
125
+ F as useAtomGet,
126
+ T as useAtomSet,
127
+ v as useAtomSetDeferred,
128
+ J as useAtomValue
192
129
  };
@@ -1 +1 @@
1
- (function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.atomaric={}))})(this,function(o){"use strict";class d{constructor(s){this.value=s}getValue(){return this.value}setValue(s){this.value=s}}class v extends d{constructor(s,n){super(s),this._defaultValue=s,this.subscribers=new Set,this.save=()=>{},this.invokeSubscriber=e=>e(this.get()),this.do={},this.get=()=>super.getValue(),this.subscribe=e=>(this.subscribers.add(e),()=>{this.subscribers.delete(e)}),this.set=(e,r)=>{const l=typeof e=="function"?e(this.get()):e;l===this.get()||l===void 0||typeof l=="number"&&isNaN(l)||(super.setValue(l),this.subscribers.forEach(this.invokeSubscriber,this),r!==!0&&this.save(l))},this.setDeferred=(e,r=500,l,$=!0)=>{$&&this.debounceTimeout===void 0&&this.set(e,l),clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{this.set(e,l),delete this.debounceTimeout},r)};const u=(e,r)=>r;let f=null;typeof s=="number"&&(f=u(s,{increment:e=>{this.set(+this.get()+(e??0))}})),typeof s=="boolean"&&(f=u(s,{toggle:()=>{this.set(!this.get())}})),Array.isArray(s)&&(f=u(s,{push:e=>{this.set([...this.get(),e])},unshift:e=>{this.set([e,...this.get()])},update:e=>{const r=[...this.get()];e(r),this.set(r)},filter:e=>{this.set(this.get().filter(e??U))}})),s instanceof Set&&(f=u(s,{add:e=>{const r=new Set(this.get());r.add(e),this.set(r)},delete:e=>{const r=new Set(this.get());r.delete(e),this.set(r)},clear:()=>{this.set(new Set)},update:e=>{const r=new Set(this.get());e(r),this.set(r)}}));const W=typeof n=="object"&&"do"in n?n.do(()=>this.get(),(e,r)=>this.set(e,r)):{};if(this.do={...W,...f},this.reset=()=>{this.set(s,!0),this.subscribers.forEach(this.invokeSubscriber,this)},n==null)return;let g=null,D=!0,k=!0,w=!1,m=s instanceof Set?e=>new Set(JSON.parse(e)):e=>JSON.parse(e),b=s instanceof Set?e=>{if(e instanceof Set)return JSON.stringify(Array.from(e));throw console.error(e),"The value is not Set instance"}:e=>JSON.stringify(e);if(typeof n=="string"?g=n:"storeKey"in n&&(D=n.warnOnDuplicateStoreKey??!0,k=n.listenStorageChanges??!0,g=n.storeKey,m=n.parseValue??m,b=n.stringifyValue??b,w=n.unchangable??w),g===null)return;const a=`atom/${g}`;let C=!0;if(this.get=()=>{if(this.get=()=>super.getValue(),C){C=!1;try{super.setValue(a in i?m(i[a]):s)}catch{console.warn("Invalid json value",i[a])}}return super.getValue()},this.save=e=>{if(e===s){this.reset();return}i[a]=b(e),p(a)},this.reset=()=>{delete i[a],this.set(s,!0)},D&&h[a]!==void 0&&console.warn("Duplicate Atom key",g),h[a]={},k)if(w){let e,r=!1;h[a].updateUnchangable=()=>{try{this.set(m(i[a]),!0)}catch{}},c[a]=()=>{r||(r=!0,i[a]=b(this.get()),clearTimeout(e),e=setTimeout(()=>r=!1,100))},N()}else h[a].updatable=e=>{if(e.newValue===null){this.reset();return}try{this.set(m(e.newValue))}catch{console.warn("Invalid json value",e.newValue)}}}get defaultValue(){return this._defaultValue}}const i=window.localStorage,h={},c={};window.addEventListener("storage",t=>{var s,n,u;t.key===null||t.newValue===t.oldValue||((s=c[t.key])==null||s.call(c),(u=(n=h[t.key])==null?void 0:n.updatable)==null||u.call(n,t))});const A=new BroadcastChannel("unchangableChanged");A.addEventListener("message",t=>{var s,n;(n=(s=h[t.data])==null?void 0:s.updateUnchangable)==null||n.call(s)});const p=t=>{A.postMessage(t)},j=i.setItem.bind(i),L=i.removeItem.bind(i),V=i.clear.bind(i);i.setItem=(t,s)=>{c[t]===void 0&&j.call(i,t,s)},i.removeItem=t=>{c[t]===void 0&&L.call(i,t)},i.clear=()=>{V(),S()};let y=i.length;const S=()=>{y!==i.length&&(y=i.length,Object.keys(c).forEach(t=>{t in i||(p(t),c[t]())}))},N=(()=>{let t=!1;return()=>{if(t)return;t=!0;let s;const n=()=>{clearInterval(s),s=setInterval(S,0),S()};n(),window.addEventListener("focus",()=>clearInterval(s),!0),window.addEventListener("focus",()=>clearInterval(s),!1),window.addEventListener("click",()=>clearInterval(s),!1),window.addEventListener("click",()=>clearInterval(s),!0),window.addEventListener("blur",n,!0)}})();(()=>{const t=n=>{var u;n in i||(u=c[n])==null||u.call(c)},s=()=>Object.keys(h).forEach(t);Object.defineProperty(window,"localStorage",{get:()=>(Promise.resolve().then(s),i)})})();const U=t=>t;let I=()=>{throw"call configureAtomaric() before all!"};const J=t=>I=t.useSyncExternalStore,E=t=>I(t.subscribe,t.get),T=t=>t.set,G=t=>t.setDeferred,M=t=>t.get,P=t=>t.do,B=t=>[E(t),T(t)],R=(t,s)=>new v(t,s);o.Atom=v,o.atom=R,o.configureAtomaric=J,o.useAtom=B,o.useAtomDo=P,o.useAtomGet=M,o.useAtomSet=T,o.useAtomSetDeferred=G,o.useAtomValue=E,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(r,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(r=typeof globalThis<"u"?globalThis:r||self,f(r.atomaric={}))})(this,function(r){"use strict";class f{constructor(n,c){let T=n,S,p=()=>{};const N=e=>T=e,y=()=>T;this.get=()=>y();let k=()=>{const e=(i,s)=>s;let u=null;typeof n=="number"&&(u=e(n,{increment:i=>{o(+this.get()+(i??0))}})),typeof n=="boolean"&&(u=e(n,{toggle:()=>{o(!this.get())}})),Array.isArray(n)&&(u=e(n,{push:(...i)=>{o([this.get()].flat().concat(i))},unshift:(...i)=>{o(i.concat(this.get()))},update:i=>{const s=[...this.get()];i(s),o(s)},filter:i=>{o(this.get().filter(i??v))}})),n instanceof Set&&(u=e(n,{add:i=>{const s=new Set(this.get());s.add(i),o(s)},delete:i=>{const s=new Set(this.get());s.delete(i),o(s)},clear:()=>{o(new Set)},update:i=>{const s=new Set(this.get());i(s),o(s)}}));const A={...typeof c=="object"&&"do"in c?c.do(()=>this.get(),(i,s)=>o(i,s)):{},...u};return k=()=>A,A};Object.defineProperty(this,"do",{get:()=>k()}),Object.defineProperty(this,"defaultValue",{get:()=>n});const m=new Set,E=e=>e(this.get());this.subscribe=e=>(m.add(e),()=>(m.delete(e),void 0));const o=(e,u)=>{const l=typeof e=="function"?e(this.get()):e;l===this.get()||l===void 0||typeof l=="number"&&isNaN(l)||(N(l),m.forEach(E,this),u!==!0&&p(l))};if(this.set=(e,u)=>o(e,u),this.reset=()=>{o(n,!0),m.forEach(E,this)},this.setDeferred=(e,u=500,l,A=!0)=>{A&&S===void 0&&o(e,l),clearTimeout(S),S=setTimeout(()=>{o(e,l),S=void 0},u)},c==null)return;let d=null,C=!0,I=!0,w=n instanceof Set?e=>new Set(JSON.parse(e)):e=>JSON.parse(e),b=n instanceof Set?e=>{if(e instanceof Set)return JSON.stringify(Array.from(e));throw console.error(e),"The value is not Set instance"}:e=>JSON.stringify(e);if(typeof c=="string"?d=c:"storeKey"in c&&(C=c.warnOnDuplicateStoreKey??!0,I=c.listenStorageChanges??!0,d=c.storeKey,w=c.parseValue??w,b=c.stringifyValue??b),d===null)return;const a=`atom/${d}`;let J=!0;this.get=()=>{if(this.get=()=>y(),J){J=!1;try{N(a in h?w(h[a]):n)}catch{console.warn("Invalid json value",h[a])}}return y()},p=e=>{if(e===n){this.reset();return}h[a]=b(e)},this.reset=()=>{delete h[a],o(n,!0)},C&&g[a]!==void 0&&console.warn("Duplicate Atom key",d),I&&(g[a]=e=>{if(e.newValue===null){this.reset();return}try{o(w(e.newValue))}catch{console.warn("Invalid json value",e.newValue)}})}}const h=window.localStorage,g={},v=t=>t;window.addEventListener("storage",t=>{var n;t.key===null||t.newValue===t.oldValue||(n=g[t.key])==null||n.call(g,t)});let _=()=>{throw"call configureAtomaric() before all!"};const G=t=>_=t.useSyncExternalStore,D=t=>_(t.subscribe,t.get),j=t=>t.set,P=t=>t.setDeferred,F=t=>t.get,L=t=>t.do,M=t=>[D(t),j(t)],$=(t,n)=>new f(t,n);r.Atom=f,r.atom=$,r.configureAtomaric=G,r.useAtom=M,r.useAtomDo=L,r.useAtomGet=F,r.useAtomSet=j,r.useAtomSetDeferred=P,r.useAtomValue=D,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "atomaric",
3
3
  "description": "Manage your project state",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
5
5
  "type": "module",
6
6
  "main": "./build/atomaric.umd.cjs",
7
7
  "module": "./build/atomaric.js",
package/types/model.d.ts CHANGED
@@ -13,10 +13,6 @@ export type AtomOptions<Value, Actions extends Record<string, Function> = {}> =
13
13
  parseValue?: (stringifiedValue: string) => Value;
14
14
  /** map Value to localStorage string value */
15
15
  stringifyValue?: (value: Value) => string;
16
- /** can not to change localStorage value in dev tools
17
- * **default: false**
18
- */
19
- unchangable?: boolean;
20
16
  } & (
21
17
  | {
22
18
  /** save in localStorage by this key */
@@ -56,8 +52,8 @@ export type SetActions<Value> = UpdateAction<Value> & {
56
52
  };
57
53
 
58
54
  export type ArrayActions<Value> = UpdateAction<Value[]> & {
59
- push: (value: Value) => void;
60
- unshift: (value: Value) => void;
55
+ push: (...values: Value[]) => void;
56
+ unshift: (...values: Value[]) => void;
61
57
  filter: (filter?: (value: Value, index: number, array: Value[]) => any) => void;
62
58
  };
63
59