atomaric 0.0.61 → 0.0.62

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,290 +1,406 @@
1
- let B = () => {
1
+ let O = () => {
2
2
  throw "call configureAtomaric() before all!";
3
3
  };
4
- const J = {}, ne = (e) => {
5
- J.useSyncExternalStore = B = e.useSyncExternalStore, J.keyPathSeparator = e.keyPathSeparator;
6
- }, k = (e) => B(e.subscribe, e.get), X = (e) => e.set, se = (e) => e.setDeferred, ce = (e) => e.get, oe = (e) => e.do, ie = (e) => [k(e), X(e)], le = (e, s) => new O(e, s), Y = (e, s) => {
7
- const i = (u, p, y) => new Proxy(u, {
8
- get: (r, t, c) => {
9
- const o = y === 0 && s.get != null ? s.get(r, t, c) : r[t];
10
- return typeof o == "object" && o !== null ? i(
11
- Array.isArray(o) ? o.slice(0) : { ...o },
12
- p.concat(Array.isArray(r) ? +t : t),
13
- y + 1
14
- ) : o;
4
+ const T = {}, ye = (e) => {
5
+ T.useSyncExternalStore = O = e.useSyncExternalStore, T.keyPathSeparator = e.keyPathSeparator, T.securifyKeyLevel = e.securifyKeyLevel, T.securifyValueLevel = e.securifyValueLevel;
6
+ }, ne = (e) => O(e.subscribe, e.get), se = (e) => e.set, he = (e) => e.setDeferred, pe = (e) => e.get, we = (e) => e.do, Se = (e) => [ne(e), se(e)], Ae = (e, t) => new ue(e, t), ce = (e, t) => {
7
+ const c = (u, y, S) => new Proxy(u, {
8
+ get: (s, n, i) => {
9
+ const l = S === 0 && t.get != null ? t.get(s, n, i) : s[n];
10
+ return typeof l == "object" && l !== null ? c(
11
+ Array.isArray(l) ? l.slice(0) : { ...l },
12
+ y.concat(Array.isArray(s) ? +n : n),
13
+ S + 1
14
+ ) : l;
15
15
  },
16
- set: (r, t, c) => (s.onSet(r, p, t, c, r[t]) && (r[t] = c), !0)
16
+ set: (s, n, i) => (t.onSet(s, y, n, i, s[n]) && (s[n] = i), !0)
17
17
  });
18
- return i(e, [], 0);
19
- }, Z = (e, s, i) => {
18
+ return c(e, [], 0);
19
+ }, ie = (e, t, c) => {
20
20
  let u = null;
21
21
  if (typeof e == "number")
22
- u = V(
23
- s,
24
- (r) => ({
25
- increment: (t) => {
26
- r.set(+r.get() + (t ?? 0));
22
+ u = L(
23
+ t,
24
+ (s) => ({
25
+ increment: (n) => {
26
+ s.set(+s.get() + (n ?? 0));
27
27
  }
28
28
  })
29
29
  );
30
30
  else if (typeof e == "boolean")
31
- u = V(
32
- s,
33
- (r) => ({
31
+ u = L(
32
+ t,
33
+ (s) => ({
34
34
  toggle: () => {
35
- r.set(!r.get());
35
+ s.set(!s.get());
36
36
  }
37
37
  })
38
38
  );
39
39
  else if (Array.isArray(e))
40
- u = V(
41
- s,
42
- (r) => ({
43
- push: (...t) => {
44
- r.set(r.get().concat(t));
40
+ u = L(
41
+ t,
42
+ (s) => ({
43
+ push: (...n) => {
44
+ s.set(s.get().concat(n));
45
45
  },
46
- unshift: (...t) => {
47
- r.set(t.concat(r.get()));
46
+ unshift: (...n) => {
47
+ s.set(n.concat(s.get()));
48
48
  },
49
- update: (t) => {
50
- const c = r.get(), o = W(c, t);
51
- o !== c && r.set(o);
49
+ update: (n) => {
50
+ const i = s.get(), l = v(i, n);
51
+ l !== i && s.set(l);
52
52
  },
53
- filter: (t) => {
54
- r.set(r.get().filter(t ?? v));
53
+ filter: (n) => {
54
+ s.set(s.get().filter(n ?? oe));
55
55
  },
56
- add: (t) => {
57
- r.get().includes(t) || r.set(r.get().concat([t]));
56
+ add: (n) => {
57
+ s.get().includes(n) || s.set(s.get().concat([n]));
58
58
  },
59
- remove: (t) => {
60
- const c = r.get().indexOf(t);
61
- if (c < 0) return;
62
- const o = r.get().slice(0);
63
- o.splice(c, 1), r.set(o);
59
+ remove: (n) => {
60
+ const i = s.get().indexOf(n);
61
+ if (i < 0) return;
62
+ const l = s.get().slice(0);
63
+ l.splice(i, 1), s.set(l);
64
64
  },
65
- toggle: (t, c) => {
66
- const o = r.get().slice(), f = o.indexOf(t);
67
- f < 0 ? c ? o.unshift(t) : o.push(t) : o.splice(f, 1), r.set(o);
65
+ toggle: (n, i) => {
66
+ const l = s.get().slice(), d = l.indexOf(n);
67
+ d < 0 ? i ? l.unshift(n) : l.push(n) : l.splice(d, 1), s.set(l);
68
68
  }
69
69
  })
70
70
  );
71
71
  else if (e instanceof Set)
72
- u = V(
73
- s,
74
- (r) => ({
75
- add: (t) => {
76
- r.set(new Set(r.get()).add(t));
72
+ u = L(
73
+ t,
74
+ (s) => ({
75
+ add: (n) => {
76
+ s.set(new Set(s.get()).add(n));
77
77
  },
78
- delete: (t) => {
79
- const c = new Set(r.get());
80
- c.delete(t), r.set(c);
78
+ delete: (n) => {
79
+ const i = new Set(s.get());
80
+ i.delete(n), s.set(i);
81
81
  },
82
- toggle: (t) => {
83
- const c = new Set(r.get());
84
- c.has(t) ? c.delete(t) : c.add(t), r.set(c);
82
+ toggle: (n) => {
83
+ const i = new Set(s.get());
84
+ i.has(n) ? i.delete(n) : i.add(n), s.set(i);
85
85
  },
86
86
  clear: () => {
87
- r.set(/* @__PURE__ */ new Set());
87
+ s.set(/* @__PURE__ */ new Set());
88
88
  }
89
89
  })
90
90
  );
91
91
  else if (e instanceof Object) {
92
- const r = J.keyPathSeparator || ".";
93
- u = V(
94
- s,
95
- (t) => ({
96
- setPartial: (c) => t.set((o) => ({
97
- ...o,
98
- ...typeof c == "function" ? c(t.get()) : c
92
+ const s = T.keyPathSeparator || ".";
93
+ u = L(
94
+ t,
95
+ (n) => ({
96
+ setPartial: (i) => n.set((l) => ({
97
+ ...l,
98
+ ...typeof i == "function" ? i(n.get()) : i
99
99
  })),
100
- update: (c) => {
101
- const o = t.get(), f = W(o, c);
102
- f !== o && t.set(f);
100
+ update: (i) => {
101
+ const l = n.get(), d = v(l, i);
102
+ d !== l && n.set(d);
103
103
  },
104
- setDeepPartial: (c, o, f, S = r) => {
105
- if (!S) return;
106
- if (c.includes(S)) {
107
- let T = c.split(S);
108
- const w = T[T.length - 1];
109
- T = T.slice(0, -1);
110
- const m = { ...t.get() };
111
- let g = m, _ = f;
112
- for (const b of T) {
113
- _ = _ == null ? void 0 : _[Array.isArray(_) ? "0" : b];
114
- const D = g[q(g, b)] ?? (Array.isArray(_) ? [] : {});
115
- if (D == null || typeof D != "object") {
116
- if (f == null) throw "Incorrect path for setDeepPartial";
117
- const j = typeof o == "function" ? o(void 0) : o;
118
- t.get()[c] !== j && t.do.setPartial({ [c]: j });
104
+ setDeepPartial: (i, l, d, b = s) => {
105
+ if (!b) return;
106
+ if (i.includes(b)) {
107
+ let V = i.split(b);
108
+ const p = V[V.length - 1];
109
+ V = V.slice(0, -1);
110
+ const M = { ...n.get() };
111
+ let g = M, P = d;
112
+ for (const x of V) {
113
+ P = P == null ? void 0 : P[Array.isArray(P) ? "0" : x];
114
+ const $ = g[K(g, x)] ?? (Array.isArray(P) ? [] : {});
115
+ if ($ == null || typeof $ != "object") {
116
+ if (d == null) throw "Incorrect path for setDeepPartial";
117
+ const C = typeof l == "function" ? l(void 0) : l;
118
+ n.get()[i] !== C && n.do.setPartial({ [i]: C });
119
119
  return;
120
120
  }
121
- g = g[q(g, b)] = Array.isArray(D) ? [...D] : { ...D };
121
+ g = g[K(g, x)] = Array.isArray($) ? [...$] : { ...$ };
122
122
  }
123
- const x = g[w];
124
- g[w] = typeof o == "function" ? o(g[w]) : o, x !== g[w] && t.set(m);
123
+ const w = g[p];
124
+ g[p] = typeof l == "function" ? l(g[p]) : l, w !== g[p] && n.set(M);
125
125
  return;
126
126
  }
127
- const h = t.get()[c], A = typeof o == "function" ? o(h) : o;
128
- A !== h && t.do.setPartial({ [c]: A });
127
+ const h = n.get()[i], A = typeof l == "function" ? l(h) : l;
128
+ A !== h && n.do.setPartial({ [i]: A });
129
129
  }
130
130
  })
131
131
  );
132
132
  }
133
- const p = typeof i == "object" && i != null && "do" in i ? i.do(
134
- (r, t) => s.set(r, t),
135
- () => s.get(),
136
- s,
137
- (r, t, c) => s.setDeferred(r, t, c)
138
- ) : null, y = {};
139
- return p && Object.keys(p).forEach((r) => Object.defineProperty(y, r, { get: () => p[r] })), u && Object.keys(u).forEach(
140
- (r) => Object.defineProperty(y, r, { get: () => u[r] })
141
- ), y;
142
- }, v = (e) => e, V = (e, s, i) => s(e), W = (e, s) => {
143
- const i = Array.isArray(e) ? e.slice(0) : { ...e };
133
+ const y = typeof c == "object" && c != null && "do" in c ? c.do(
134
+ (s, n) => t.set(s, n),
135
+ () => t.get(),
136
+ t,
137
+ (s, n, i) => t.setDeferred(s, n, i)
138
+ ) : null, S = {};
139
+ return y && Object.keys(y).forEach((s) => Object.defineProperty(S, s, { get: () => y[s] })), u && Object.keys(u).forEach(
140
+ (s) => Object.defineProperty(S, s, { get: () => u[s] })
141
+ ), S;
142
+ }, oe = (e) => e, L = (e, t, c) => t(e), v = (e, t) => {
143
+ const c = Array.isArray(e) ? e.slice(0) : { ...e };
144
144
  let u = !1;
145
- const p = Y(e, {
146
- onSet: (y, r, t, c, o) => {
147
- if (c === o) return !0;
148
- let f = i;
145
+ const y = ce(e, {
146
+ onSet: (S, s, n, i, l) => {
147
+ if (i === l) return !0;
148
+ let d = c;
149
149
  u = !0;
150
- for (const S of r) {
151
- const h = f[S];
152
- f = f[S] = Array.isArray(h) ? h.slice(0) : { ...h };
150
+ for (const b of s) {
151
+ const h = d[b];
152
+ d = d[b] = Array.isArray(h) ? h.slice(0) : { ...h };
153
153
  }
154
- return f[t] = c, !0;
154
+ return d[n] = i, !0;
155
155
  }
156
156
  });
157
- return s(p), u ? i : e;
158
- }, q = (e, s) => Array.isArray(e) ? `${+s}` : s;
159
- class O {
160
- constructor(s, i) {
161
- const u = (n) => o = n, p = () => o, y = /* @__PURE__ */ new Set(), r = (n) => n(h());
162
- let t = !0, c = !1, o = s, f, S = () => {
163
- }, h = () => p(), A = null, T = () => {
164
- const n = Z(s, w, i);
165
- return T = () => n, n;
157
+ return t(y), u ? c : e;
158
+ }, K = (e, t) => Array.isArray(e) ? `${+t}` : t;
159
+ var le = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Simple = 1] = "Simple", e[e.Middle = 2] = "Middle", e[e.Strong = 3] = "Strong", e))(le || {});
160
+ class ue {
161
+ constructor(t, c) {
162
+ const u = (r) => l = r, y = () => l, S = /* @__PURE__ */ new Set(), s = (r) => r(h());
163
+ let n = !0, i = !1, l = t, d, b = () => {
164
+ }, h = () => y(), A = null, V = () => {
165
+ const r = ie(t, p, c);
166
+ return V = () => r, r;
166
167
  };
167
- const w = new Proxy(this, {
168
- get: (n, d) => d === "do" ? T() : n[d],
169
- set: K
170
- }), m = () => {
171
- t = !0, c !== !0 && S(h()), c = !1;
168
+ const p = new Proxy(this, {
169
+ get: (r, a) => a === "do" ? V() : r[a],
170
+ set: fe
171
+ }), M = () => {
172
+ n = !0, i !== !0 && b(h()), i = !1;
172
173
  try {
173
- M.postMessage({ key: a, value: p() });
174
+ H.postMessage({ key: f, value: y() });
174
175
  } catch {
175
176
  }
176
- }, g = (n, d) => {
177
- const I = typeof n == "function" ? n(h()) : n;
178
- I !== h() && (u(I), c = d, t && (t = !1, y.forEach(r), queueMicrotask(m)));
177
+ }, g = (r, a) => {
178
+ const D = typeof r == "function" ? r(h()) : r;
179
+ D !== h() && (u(D), i = a, n && (n = !1, S.forEach(s), queueMicrotask(M)));
179
180
  };
180
- this.set = (n, d) => g(n, d), this.get = () => h(), this.initialValue = s, this.isInitialValue = () => s === p(), this.subscribe = (n) => (y.add(n), () => {
181
- y.delete(n);
181
+ this.set = (r, a) => g(r, a), this.get = () => h(), this.initialValue = t, this.isInitialValue = () => t === y(), this.subscribe = (r) => (S.add(r), () => {
182
+ S.delete(r);
182
183
  }), this.reset = () => {
183
- g(s, !0);
184
+ g(t, !0);
184
185
  };
185
- const _ = (n, d) => {
186
- g(n, d), f = void 0;
186
+ const P = (r, a) => {
187
+ g(r, a), d = void 0;
187
188
  };
188
- if (this.setDeferred = (n, d = 500, I, U = !0) => {
189
- U && f === void 0 && g(n, I), clearTimeout(f), f = setTimeout(_, d, n, I);
190
- }, i == null) return w;
191
- let x = null, b = null, D = !0, j = !0, C = !1, F = -1, z = s instanceof Set ? (n) => new Set(n) : (n) => n, E = s instanceof Set ? (n) => {
192
- if (n instanceof Set) return Array.from(n);
193
- throw console.error(n), "The value is not Set instance";
194
- } : (n) => n;
195
- if (typeof i == "string")
196
- x = i;
197
- else if ("storeKey" in i)
198
- D = i.warnOnDuplicateStoreKey ?? D, j = i.listenStorageChanges ?? j, x = i.storeKey, z = i.unzipValue ?? z, E = i.zipValue ?? E, C = i.unchangable ?? C, b = i.exp ?? b;
199
- else return w;
200
- const a = `${G}${x}`, R = b === null || !(b(w, a in l) instanceof Date) ? (n) => JSON.stringify([E(n)]) : (n) => (A ?? (A = {}), A.exp = b(w, a in l).getTime(), A.exp - Date.now() < 24 * 60 * 60 * 1e3 && (clearTimeout(F), clearTimeout(Q[a]), F = setTimeout(() => this.reset(), A.exp - Date.now())), A.exp = Math.trunc(A.exp / 1e3), JSON.stringify([E(n), A])), H = (n) => {
201
- const d = JSON.parse(n);
202
- return A = d[1], z(d[0]);
189
+ if (this.setDeferred = (r, a = 500, D, W = !0) => {
190
+ W && d === void 0 && g(r, D), clearTimeout(d), d = setTimeout(P, a, r, D);
191
+ }, c == null) return p;
192
+ let w = null, x = null, $ = !0, C = !0, U = !1, R = 0, I = 0, k = -1, E = t instanceof Set ? (r) => new Set(r) : (r) => r, _ = t instanceof Set ? (r) => {
193
+ if (r instanceof Set) return Array.from(r);
194
+ throw console.error(r), "The value is not Set instance";
195
+ } : (r) => r;
196
+ if (typeof c == "string")
197
+ w = c;
198
+ else if ("storeKey" in c)
199
+ $ = c.warnOnDuplicateStoreKey ?? $, C = c.listenStorageChanges ?? C, w = c.storeKey, E = c.unzipValue ?? E, _ = c.zipValue ?? _, U = c.unchangable ?? U, R = c.securifyKeyLevel ?? T.securifyKeyLevel ?? R, I = c.securifyValueLevel ?? T.securifyValueLevel ?? I, x = c.exp ?? x;
200
+ else return p;
201
+ const F = R ? m(
202
+ w,
203
+ 3
204
+ /* Strong */
205
+ ) : w, f = `${I ? J : z}${F}`;
206
+ if (R) {
207
+ const r = `${z}${w}`;
208
+ r in o && (o[f] = o[r], delete o[r]);
209
+ } else {
210
+ const r = `${z}${m(
211
+ w,
212
+ 3
213
+ /* Strong */
214
+ )}`;
215
+ r in o && (o[f] = o[r], delete o[r]);
216
+ }
217
+ if (I) {
218
+ delete o[`${z}${F}`];
219
+ const r = _, a = E;
220
+ E = (D) => {
221
+ try {
222
+ return a(Q(D, I)[0]);
223
+ } catch {
224
+ return delete o[f], "";
225
+ }
226
+ }, _ = (D) => {
227
+ try {
228
+ return m([r(D)], I);
229
+ } catch {
230
+ return delete o[f], "";
231
+ }
232
+ };
233
+ } else delete o[`${J}${F}`];
234
+ const X = x === null || !(x(p, f in o) instanceof Date) ? (r) => m(
235
+ [_(r)],
236
+ 0
237
+ /* None */
238
+ ) : (r) => (A ?? (A = {}), A.exp = x(p, f in o).getTime(), A.exp - Date.now() < 24 * 60 * 60 * 1e3 && (clearTimeout(k), clearTimeout(ee[f]), k = setTimeout(() => this.reset(), A.exp - Date.now())), A.exp = Math.trunc(A.exp / 1e3), m(
239
+ [_(r), A],
240
+ 0
241
+ /* None */
242
+ )), Y = (r) => {
243
+ const a = Q(
244
+ r,
245
+ 0
246
+ /* None */
247
+ );
248
+ return A = a[1], E(a[0]);
203
249
  };
204
- let L = !0;
205
- if (N[a] = w, l[`atom/${x}`] && (l[a] || (l[a] = `[${l[`atom/${x}`]}]`), delete l[`atom/${x}`]), h = () => {
206
- if (h = p, L) {
207
- L = !1;
250
+ let Z = !0;
251
+ if (B[f] = p, o[`atom/${w}`] && (o[f] || (o[f] = `[${o[`atom/${w}`]}]`), delete o[`atom/${w}`]), h = () => {
252
+ if (h = y, Z) {
253
+ Z = !1;
208
254
  try {
209
- u(a in l ? H(l[a]) : s);
255
+ u(f in o ? Y(o[f]) : t);
210
256
  } catch {
211
- console.warn("Invalid json value", l[a]);
257
+ console.warn("Invalid json value", o[f]);
212
258
  }
213
259
  }
214
- return p();
215
- }, S = (n) => {
216
- if (n === s) {
260
+ return y();
261
+ }, b = (r) => {
262
+ if (r === t) {
217
263
  this.reset();
218
264
  return;
219
265
  }
220
- l[a] = R(n);
266
+ o[f] = X(r);
221
267
  }, this.reset = () => {
222
- delete l[a], g(s, !0);
223
- }, D && P[a] !== void 0 && console.warn("Duplicate Atom key", x), j)
224
- if (C) {
225
- let n = !1, d;
226
- $[a] = this, P[a] = () => {
227
- clearTimeout(d), d = setTimeout(() => n = !1, 10), !n && (n = !0, l[a] = R(p()));
268
+ delete o[f], g(t, !0);
269
+ }, $ && j[f] !== void 0 && console.warn("Duplicate Atom key", w), C)
270
+ if (U) {
271
+ let r = !1, a;
272
+ N[f] = this, j[f] = () => {
273
+ clearTimeout(a), a = setTimeout(() => r = !1, 10), !r && (r = !0, o[f] = X(y()));
228
274
  };
229
275
  } else
230
- P[a] = (n) => {
231
- if (n.newValue === null) {
276
+ j[f] = (r) => {
277
+ if (r.newValue === null) {
232
278
  this.reset();
233
279
  return;
234
280
  }
235
281
  try {
236
- g(H(n.newValue));
282
+ g(Y(r.newValue));
237
283
  } catch {
238
- console.warn("Invalid json value", n.newValue);
284
+ console.warn("Invalid json value", r.newValue);
239
285
  }
240
286
  };
241
- return w;
287
+ return p;
242
288
  }
243
289
  }
244
- let M;
290
+ let H;
245
291
  try {
246
- M = new BroadcastChannel("updateHere"), M.addEventListener("message", (e) => {
247
- var s;
248
- (s = $[e.data.key]) == null || s.set(e.data.value, !0);
292
+ H = new BroadcastChannel("updateHere"), H.addEventListener("message", (e) => {
293
+ var t;
294
+ (t = N[e.data.key]) == null || t.set(e.data.value, !0);
249
295
  });
250
296
  } catch {
251
297
  }
252
- const l = window.localStorage, P = {}, $ = {}, K = (e, s) => {
253
- throw `${s} is readonly property`;
298
+ const o = localStorage, j = {}, N = {}, fe = (e, t) => {
299
+ throw `${t} is readonly property`;
254
300
  };
255
301
  window.addEventListener("storage", (e) => {
256
- var s;
257
- e.key === null || e.newValue === e.oldValue || (s = P[e.key]) == null || s.call(P, e);
302
+ var t;
303
+ e.key === null || e.newValue === e.oldValue || (t = j[e.key]) == null || t.call(j, e);
258
304
  });
259
- const ee = l.setItem.bind(l), te = l.removeItem.bind(l);
260
- l.setItem = (e, s) => {
261
- $[e] === void 0 && ee.call(l, e, s);
305
+ const ae = o.setItem.bind(o), de = o.removeItem.bind(o);
306
+ o.setItem = (e, t) => {
307
+ N[e] === void 0 && ae.call(o, e, t);
262
308
  };
263
- l.removeItem = (e) => {
264
- $[e] === void 0 && te.call(l, e);
309
+ o.removeItem = (e) => {
310
+ N[e] === void 0 && de.call(o, e);
265
311
  };
266
- const re = /"exp":\s*(\d+)/, G = "atom\\", N = {}, Q = {};
312
+ const ge = /"exp":\s*(\d+)/, z = "atom\\", J = "atom`s\\", B = {}, ee = {}, te = /[a-z]/gi, q = 5, G = {};
313
+ for (let e = 54; e < 80; e++) {
314
+ if (e === 68 || e === 72 || e === 55) continue;
315
+ const t = String.fromCharCode(e + 43).toUpperCase(), c = String.fromCharCode(e + 43).toLowerCase();
316
+ G[t] = c, G[c] = t;
317
+ }
318
+ const re = (e) => G[e] ?? e, m = /* @__PURE__ */ (() => {
319
+ const e = {
320
+ 0: (t) => JSON.stringify(t),
321
+ 1: (t) => btoa(encodeURI(e[
322
+ 0
323
+ /* None */
324
+ ](t))),
325
+ 2: (t) => {
326
+ const c = e[
327
+ 1
328
+ /* Simple */
329
+ ](t);
330
+ return `${c.slice(0, q)}${c.slice(q).replace(te, re)}`;
331
+ },
332
+ 3: (t) => btoa(e[
333
+ 2
334
+ /* Middle */
335
+ ](t))
336
+ };
337
+ return (t, c) => {
338
+ try {
339
+ return e[c](t);
340
+ } catch (u) {
341
+ if (c === 0) throw u;
342
+ return e[
343
+ 0
344
+ /* None */
345
+ ](t);
346
+ }
347
+ };
348
+ })(), Q = /* @__PURE__ */ (() => {
349
+ const e = {
350
+ 0: (t) => JSON.parse(t),
351
+ 1: (t) => e[
352
+ 0
353
+ /* None */
354
+ ](decodeURI(atob(t))),
355
+ 2: (t) => e[
356
+ 1
357
+ /* Simple */
358
+ ](
359
+ `${t.slice(0, q)}${t.slice(q).replace(te, re)}`
360
+ ),
361
+ 3: (t) => e[
362
+ 2
363
+ /* Middle */
364
+ ](atob(t))
365
+ };
366
+ return (t, c) => {
367
+ try {
368
+ return e[c](t);
369
+ } catch (u) {
370
+ if (c === 0) throw u;
371
+ return e[
372
+ 0
373
+ /* None */
374
+ ](t);
375
+ }
376
+ };
377
+ })();
267
378
  setTimeout(() => {
268
- Object.keys(l).forEach((e) => {
379
+ Object.keys(o).forEach((e) => {
269
380
  var u;
270
- if (!e.startsWith(G) || typeof l[e] != "string") return;
271
- const s = +((u = l[e].match(re)) == null ? void 0 : u[1]);
272
- if (!s || s * 1e3 - Date.now() > 24 * 60 * 60 * 1e3) return;
273
- const i = JSON.parse(l[e]);
274
- !Array.isArray(i) || i[1] == null || !("exp" in i[1]) || i[1].exp !== s || (Q[e] = setTimeout(() => {
275
- N[e] ? N[e].reset() : delete l[e];
276
- }, s * 1e3 - Date.now()));
381
+ if (typeof o[e] != "string" || !e.startsWith(z) && !e.startsWith(J)) return;
382
+ const t = +((u = o[e].match(ge)) == null ? void 0 : u[1]);
383
+ if (!t || t * 1e3 - Date.now() > 24 * 60 * 60 * 1e3) return;
384
+ const c = Q(
385
+ o[e],
386
+ 0
387
+ /* None */
388
+ );
389
+ !Array.isArray(c) || c[1] == null || !("exp" in c[1]) || c[1].exp !== t || (ee[e] = setTimeout(() => {
390
+ B[e] ? B[e].reset() : delete o[e];
391
+ }, t * 1e3 - Date.now()));
277
392
  });
278
393
  }, 1e3);
279
394
  export {
280
- O as Atom,
281
- le as atom,
282
- ne as configureAtomaric,
283
- J as configuredOptions,
284
- ie as useAtom,
285
- oe as useAtomDo,
286
- ce as useAtomGet,
287
- X as useAtomSet,
288
- se as useAtomSetDeferred,
289
- k as useAtomValue
395
+ ue as Atom,
396
+ le as AtomSecureLevel,
397
+ Ae as atom,
398
+ ye as configureAtomaric,
399
+ T as configuredOptions,
400
+ Se as useAtom,
401
+ we as useAtomDo,
402
+ pe as useAtomGet,
403
+ se as useAtomSet,
404
+ he as useAtomSetDeferred,
405
+ ne as useAtomValue
290
406
  };
@@ -1 +1 @@
1
- (function(A,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(A=typeof globalThis<"u"?globalThis:A||self,_(A.atomaric={}))})(this,function(A){"use strict";let _=()=>{throw"call configureAtomaric() before all!"};const $={},Y=e=>{$.useSyncExternalStore=_=e.useSyncExternalStore,$.keyPathSeparator=e.keyPathSeparator},G=e=>_(e.subscribe,e.get),H=e=>e.set,Z=e=>e.setDeferred,O=e=>e.get,K=e=>e.do,ee=e=>[G(e),H(e)],te=(e,s)=>new q(e,s),ne=(e,s)=>{const i=(l,h,p)=>new Proxy(l,{get:(n,t,c)=>{const o=p===0&&s.get!=null?s.get(n,t,c):n[t];return typeof o=="object"&&o!==null?i(Array.isArray(o)?o.slice(0):{...o},h.concat(Array.isArray(n)?+t:t),p+1):o},set:(n,t,c)=>(s.onSet(n,h,t,c,n[t])&&(n[t]=c),!0)});return i(e,[],0)},re=(e,s,i)=>{let l=null;if(typeof e=="number")l=V(s,n=>({increment:t=>{n.set(+n.get()+(t??0))}}));else if(typeof e=="boolean")l=V(s,n=>({toggle:()=>{n.set(!n.get())}}));else if(Array.isArray(e))l=V(s,n=>({push:(...t)=>{n.set(n.get().concat(t))},unshift:(...t)=>{n.set(t.concat(n.get()))},update:t=>{const c=n.get(),o=L(c,t);o!==c&&n.set(o)},filter:t=>{n.set(n.get().filter(t??se))},add:t=>{n.get().includes(t)||n.set(n.get().concat([t]))},remove:t=>{const c=n.get().indexOf(t);if(c<0)return;const o=n.get().slice(0);o.splice(c,1),n.set(o)},toggle:(t,c)=>{const o=n.get().slice(),f=o.indexOf(t);f<0?c?o.unshift(t):o.push(t):o.splice(f,1),n.set(o)}}));else if(e instanceof Set)l=V(s,n=>({add:t=>{n.set(new Set(n.get()).add(t))},delete:t=>{const c=new Set(n.get());c.delete(t),n.set(c)},toggle:t=>{const c=new Set(n.get());c.has(t)?c.delete(t):c.add(t),n.set(c)},clear:()=>{n.set(new Set)}}));else if(e instanceof Object){const n=$.keyPathSeparator||".";l=V(s,t=>({setPartial:c=>t.set(o=>({...o,...typeof c=="function"?c(t.get()):c})),update:c=>{const o=t.get(),f=L(o,c);f!==o&&t.set(f)},setDeepPartial:(c,o,f,b=n)=>{if(!b)return;if(c.includes(b)){let D=c.split(b);const S=D[D.length-1];D=D.slice(0,-1);const M={...t.get()};let g=M,j=f;for(const x of D){j=j==null?void 0:j[Array.isArray(j)?"0":x];const T=g[W(g,x)]??(Array.isArray(j)?[]:{});if(T==null||typeof T!="object"){if(f==null)throw"Incorrect path for setDeepPartial";const I=typeof o=="function"?o(void 0):o;t.get()[c]!==I&&t.do.setPartial({[c]:I});return}g=g[W(g,x)]=Array.isArray(T)?[...T]:{...T}}const m=g[S];g[S]=typeof o=="function"?o(g[S]):o,m!==g[S]&&t.set(M);return}const y=t.get()[c],w=typeof o=="function"?o(y):o;w!==y&&t.do.setPartial({[c]:w})}}))}const h=typeof i=="object"&&i!=null&&"do"in i?i.do((n,t)=>s.set(n,t),()=>s.get(),s,(n,t,c)=>s.setDeferred(n,t,c)):null,p={};return h&&Object.keys(h).forEach(n=>Object.defineProperty(p,n,{get:()=>h[n]})),l&&Object.keys(l).forEach(n=>Object.defineProperty(p,n,{get:()=>l[n]})),p},se=e=>e,V=(e,s,i)=>s(e),L=(e,s)=>{const i=Array.isArray(e)?e.slice(0):{...e};let l=!1;const h=ne(e,{onSet:(p,n,t,c,o)=>{if(c===o)return!0;let f=i;l=!0;for(const b of n){const y=f[b];f=f[b]=Array.isArray(y)?y.slice(0):{...y}}return f[t]=c,!0}});return s(h),l?i:e},W=(e,s)=>Array.isArray(e)?`${+s}`:s;class q{constructor(s,i){const l=r=>o=r,h=()=>o,p=new Set,n=r=>r(y());let t=!0,c=!1,o=s,f,b=()=>{},y=()=>h(),w=null,D=()=>{const r=re(s,S,i);return D=()=>r,r};const S=new Proxy(this,{get:(r,d)=>d==="do"?D():r[d],set:ce}),M=()=>{t=!0,c!==!0&&b(y()),c=!1;try{J.postMessage({key:a,value:h()})}catch{}},g=(r,d)=>{const E=typeof r=="function"?r(y()):r;E!==y()&&(l(E),c=d,t&&(t=!1,p.forEach(n),queueMicrotask(M)))};this.set=(r,d)=>g(r,d),this.get=()=>y(),this.initialValue=s,this.isInitialValue=()=>s===h(),this.subscribe=r=>(p.add(r),()=>{p.delete(r)}),this.reset=()=>{g(s,!0)};const j=(r,d)=>{g(r,d),f=void 0};if(this.setDeferred=(r,d=500,E,le=!0)=>{le&&f===void 0&&g(r,E),clearTimeout(f),f=setTimeout(j,d,r,E)},i==null)return S;let m=null,x=null,T=!0,I=!0,F=!1,U=-1,R=s instanceof Set?r=>new Set(r):r=>r,z=s instanceof Set?r=>{if(r instanceof Set)return Array.from(r);throw console.error(r),"The value is not Set instance"}:r=>r;if(typeof i=="string")m=i;else if("storeKey"in i)T=i.warnOnDuplicateStoreKey??T,I=i.listenStorageChanges??I,m=i.storeKey,R=i.unzipValue??R,z=i.zipValue??z,F=i.unchangable??F,x=i.exp??x;else return S;const a=`${B}${m}`,k=x===null||!(x(S,a in u)instanceof Date)?r=>JSON.stringify([z(r)]):r=>(w??(w={}),w.exp=x(S,a in u).getTime(),w.exp-Date.now()<24*60*60*1e3&&(clearTimeout(U),clearTimeout(Q[a]),U=setTimeout(()=>this.reset(),w.exp-Date.now())),w.exp=Math.trunc(w.exp/1e3),JSON.stringify([z(r),w])),v=r=>{const d=JSON.parse(r);return w=d[1],R(d[0])};let X=!0;if(N[a]=S,u[`atom/${m}`]&&(u[a]||(u[a]=`[${u[`atom/${m}`]}]`),delete u[`atom/${m}`]),y=()=>{if(y=h,X){X=!1;try{l(a in u?v(u[a]):s)}catch{console.warn("Invalid json value",u[a])}}return h()},b=r=>{if(r===s){this.reset();return}u[a]=k(r)},this.reset=()=>{delete u[a],g(s,!0)},T&&P[a]!==void 0&&console.warn("Duplicate Atom key",m),I)if(F){let r=!1,d;C[a]=this,P[a]=()=>{clearTimeout(d),d=setTimeout(()=>r=!1,10),!r&&(r=!0,u[a]=k(h()))}}else P[a]=r=>{if(r.newValue===null){this.reset();return}try{g(v(r.newValue))}catch{console.warn("Invalid json value",r.newValue)}};return S}}let J;try{J=new BroadcastChannel("updateHere"),J.addEventListener("message",e=>{var s;(s=C[e.data.key])==null||s.set(e.data.value,!0)})}catch{}const u=window.localStorage,P={},C={},ce=(e,s)=>{throw`${s} is readonly property`};window.addEventListener("storage",e=>{var s;e.key===null||e.newValue===e.oldValue||(s=P[e.key])==null||s.call(P,e)});const oe=u.setItem.bind(u),ie=u.removeItem.bind(u);u.setItem=(e,s)=>{C[e]===void 0&&oe.call(u,e,s)},u.removeItem=e=>{C[e]===void 0&&ie.call(u,e)};const ue=/"exp":\s*(\d+)/,B="atom\\",N={},Q={};setTimeout(()=>{Object.keys(u).forEach(e=>{var l;if(!e.startsWith(B)||typeof u[e]!="string")return;const s=+((l=u[e].match(ue))==null?void 0:l[1]);if(!s||s*1e3-Date.now()>24*60*60*1e3)return;const i=JSON.parse(u[e]);!Array.isArray(i)||i[1]==null||!("exp"in i[1])||i[1].exp!==s||(Q[e]=setTimeout(()=>{N[e]?N[e].reset():delete u[e]},s*1e3-Date.now()))})},1e3),A.Atom=q,A.atom=te,A.configureAtomaric=Y,A.configuredOptions=$,A.useAtom=ee,A.useAtomDo=K,A.useAtomGet=O,A.useAtomSet=H,A.useAtomSetDeferred=Z,A.useAtomValue=G,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(g=typeof globalThis<"u"?globalThis:g||self,j(g.atomaric={}))})(this,function(g){"use strict";let j=()=>{throw"call configureAtomaric() before all!"};const T={},ue=e=>{T.useSyncExternalStore=j=e.useSyncExternalStore,T.keyPathSeparator=e.keyPathSeparator,T.securifyKeyLevel=e.securifyKeyLevel,T.securifyValueLevel=e.securifyValueLevel},X=e=>j(e.subscribe,e.get),Y=e=>e.set,le=e=>e.setDeferred,fe=e=>e.get,ae=e=>e.do,de=e=>[X(e),Y(e)],ge=(e,t)=>new ee(e,t),ye=(e,t)=>{const c=(l,h,A)=>new Proxy(l,{get:(s,n,i)=>{const u=A===0&&t.get!=null?t.get(s,n,i):s[n];return typeof u=="object"&&u!==null?c(Array.isArray(u)?u.slice(0):{...u},h.concat(Array.isArray(s)?+n:n),A+1):u},set:(s,n,i)=>(t.onSet(s,h,n,i,s[n])&&(s[n]=i),!0)});return c(e,[],0)},he=(e,t,c)=>{let l=null;if(typeof e=="number")l=E(t,s=>({increment:n=>{s.set(+s.get()+(n??0))}}));else if(typeof e=="boolean")l=E(t,s=>({toggle:()=>{s.set(!s.get())}}));else if(Array.isArray(e))l=E(t,s=>({push:(...n)=>{s.set(s.get().concat(n))},unshift:(...n)=>{s.set(n.concat(s.get()))},update:n=>{const i=s.get(),u=Z(i,n);u!==i&&s.set(u)},filter:n=>{s.set(s.get().filter(n??pe))},add:n=>{s.get().includes(n)||s.set(s.get().concat([n]))},remove:n=>{const i=s.get().indexOf(n);if(i<0)return;const u=s.get().slice(0);u.splice(i,1),s.set(u)},toggle:(n,i)=>{const u=s.get().slice(),d=u.indexOf(n);d<0?i?u.unshift(n):u.push(n):u.splice(d,1),s.set(u)}}));else if(e instanceof Set)l=E(t,s=>({add:n=>{s.set(new Set(s.get()).add(n))},delete:n=>{const i=new Set(s.get());i.delete(n),s.set(i)},toggle:n=>{const i=new Set(s.get());i.has(n)?i.delete(n):i.add(n),s.set(i)},clear:()=>{s.set(new Set)}}));else if(e instanceof Object){const s=T.keyPathSeparator||".";l=E(t,n=>({setPartial:i=>n.set(u=>({...u,...typeof i=="function"?i(n.get()):i})),update:i=>{const u=n.get(),d=Z(u,i);d!==u&&n.set(d)},setDeepPartial:(i,u,d,m=s)=>{if(!m)return;if(i.includes(m)){let V=i.split(m);const w=V[V.length-1];V=V.slice(0,-1);const U={...n.get()};let y=U,P=d;for(const x of V){P=P==null?void 0:P[Array.isArray(P)?"0":x];const D=y[K(y,x)]??(Array.isArray(P)?[]:{});if(D==null||typeof D!="object"){if(d==null)throw"Incorrect path for setDeepPartial";const I=typeof u=="function"?u(void 0):u;n.get()[i]!==I&&n.do.setPartial({[i]:I});return}y=y[K(y,x)]=Array.isArray(D)?[...D]:{...D}}const S=y[w];y[w]=typeof u=="function"?u(y[w]):u,S!==y[w]&&n.set(U);return}const p=n.get()[i],b=typeof u=="function"?u(p):u;b!==p&&n.do.setPartial({[i]:b})}}))}const h=typeof c=="object"&&c!=null&&"do"in c?c.do((s,n)=>t.set(s,n),()=>t.get(),t,(s,n,i)=>t.setDeferred(s,n,i)):null,A={};return h&&Object.keys(h).forEach(s=>Object.defineProperty(A,s,{get:()=>h[s]})),l&&Object.keys(l).forEach(s=>Object.defineProperty(A,s,{get:()=>l[s]})),A},pe=e=>e,E=(e,t,c)=>t(e),Z=(e,t)=>{const c=Array.isArray(e)?e.slice(0):{...e};let l=!1;const h=ye(e,{onSet:(A,s,n,i,u)=>{if(i===u)return!0;let d=c;l=!0;for(const m of s){const p=d[m];d=d[m]=Array.isArray(p)?p.slice(0):{...p}}return d[n]=i,!0}});return t(h),l?c:e},K=(e,t)=>Array.isArray(e)?`${+t}`:t;var O=(e=>(e[e.None=0]="None",e[e.Simple=1]="Simple",e[e.Middle=2]="Middle",e[e.Strong=3]="Strong",e))(O||{});class ee{constructor(t,c){const l=r=>u=r,h=()=>u,A=new Set,s=r=>r(p());let n=!0,i=!1,u=t,d,m=()=>{},p=()=>h(),b=null,V=()=>{const r=he(t,w,c);return V=()=>r,r};const w=new Proxy(this,{get:(r,a)=>a==="do"?V():r[a],set:we}),U=()=>{n=!0,i!==!0&&m(p()),i=!1;try{W.postMessage({key:f,value:h()})}catch{}},y=(r,a)=>{const $=typeof r=="function"?r(p()):r;$!==p()&&(l($),i=a,n&&(n=!1,A.forEach(s),queueMicrotask(U)))};this.set=(r,a)=>y(r,a),this.get=()=>p(),this.initialValue=t,this.isInitialValue=()=>t===h(),this.subscribe=r=>(A.add(r),()=>{A.delete(r)}),this.reset=()=>{y(t,!0)};const P=(r,a)=>{y(r,a),d=void 0};if(this.setDeferred=(r,a=500,$,v=!0)=>{v&&d===void 0&&y(r,$),clearTimeout(d),d=setTimeout(P,a,r,$)},c==null)return w;let S=null,x=null,D=!0,I=!0,Q=!1,F=0,_=0,se=-1,R=t instanceof Set?r=>new Set(r):r=>r,L=t instanceof Set?r=>{if(r instanceof Set)return Array.from(r);throw console.error(r),"The value is not Set instance"}:r=>r;if(typeof c=="string")S=c;else if("storeKey"in c)D=c.warnOnDuplicateStoreKey??D,I=c.listenStorageChanges??I,S=c.storeKey,R=c.unzipValue??R,L=c.zipValue??L,Q=c.unchangable??Q,F=c.securifyKeyLevel??T.securifyKeyLevel??F,_=c.securifyValueLevel??T.securifyValueLevel??_,x=c.exp??x;else return w;const k=F?M(S,3):S,f=`${_?G:z}${k}`;if(F){const r=`${z}${S}`;r in o&&(o[f]=o[r],delete o[r])}else{const r=`${z}${M(S,3)}`;r in o&&(o[f]=o[r],delete o[r])}if(_){delete o[`${z}${k}`];const r=L,a=R;R=$=>{try{return a(B($,_)[0])}catch{return delete o[f],""}},L=$=>{try{return M([r($)],_)}catch{return delete o[f],""}}}else delete o[`${G}${k}`];const ce=x===null||!(x(w,f in o)instanceof Date)?r=>M([L(r)],0):r=>(b??(b={}),b.exp=x(w,f in o).getTime(),b.exp-Date.now()<24*60*60*1e3&&(clearTimeout(se),clearTimeout(te[f]),se=setTimeout(()=>this.reset(),b.exp-Date.now())),b.exp=Math.trunc(b.exp/1e3),M([L(r),b],0)),ie=r=>{const a=B(r,0);return b=a[1],R(a[0])};let oe=!0;if(H[f]=w,o[`atom/${S}`]&&(o[f]||(o[f]=`[${o[`atom/${S}`]}]`),delete o[`atom/${S}`]),p=()=>{if(p=h,oe){oe=!1;try{l(f in o?ie(o[f]):t)}catch{console.warn("Invalid json value",o[f])}}return h()},m=r=>{if(r===t){this.reset();return}o[f]=ce(r)},this.reset=()=>{delete o[f],y(t,!0)},D&&C[f]!==void 0&&console.warn("Duplicate Atom key",S),I)if(Q){let r=!1,a;q[f]=this,C[f]=()=>{clearTimeout(a),a=setTimeout(()=>r=!1,10),!r&&(r=!0,o[f]=ce(h()))}}else C[f]=r=>{if(r.newValue===null){this.reset();return}try{y(ie(r.newValue))}catch{console.warn("Invalid json value",r.newValue)}};return w}}let W;try{W=new BroadcastChannel("updateHere"),W.addEventListener("message",e=>{var t;(t=q[e.data.key])==null||t.set(e.data.value,!0)})}catch{}const o=localStorage,C={},q={},we=(e,t)=>{throw`${t} is readonly property`};window.addEventListener("storage",e=>{var t;e.key===null||e.newValue===e.oldValue||(t=C[e.key])==null||t.call(C,e)});const Se=o.setItem.bind(o),Ae=o.removeItem.bind(o);o.setItem=(e,t)=>{q[e]===void 0&&Se.call(o,e,t)},o.removeItem=e=>{q[e]===void 0&&Ae.call(o,e)};const be=/"exp":\s*(\d+)/,z="atom\\",G="atom`s\\",H={},te={},re=/[a-z]/gi,N=5,J={};for(let e=54;e<80;e++){if(e===68||e===72||e===55)continue;const t=String.fromCharCode(e+43).toUpperCase(),c=String.fromCharCode(e+43).toLowerCase();J[t]=c,J[c]=t}const ne=e=>J[e]??e,M=(()=>{const e={0:t=>JSON.stringify(t),1:t=>btoa(encodeURI(e[0](t))),2:t=>{const c=e[1](t);return`${c.slice(0,N)}${c.slice(N).replace(re,ne)}`},3:t=>btoa(e[2](t))};return(t,c)=>{try{return e[c](t)}catch(l){if(c===0)throw l;return e[0](t)}}})(),B=(()=>{const e={0:t=>JSON.parse(t),1:t=>e[0](decodeURI(atob(t))),2:t=>e[1](`${t.slice(0,N)}${t.slice(N).replace(re,ne)}`),3:t=>e[2](atob(t))};return(t,c)=>{try{return e[c](t)}catch(l){if(c===0)throw l;return e[0](t)}}})();setTimeout(()=>{Object.keys(o).forEach(e=>{var l;if(typeof o[e]!="string"||!e.startsWith(z)&&!e.startsWith(G))return;const t=+((l=o[e].match(be))==null?void 0:l[1]);if(!t||t*1e3-Date.now()>24*60*60*1e3)return;const c=B(o[e],0);!Array.isArray(c)||c[1]==null||!("exp"in c[1])||c[1].exp!==t||(te[e]=setTimeout(()=>{H[e]?H[e].reset():delete o[e]},t*1e3-Date.now()))})},1e3),g.Atom=ee,g.AtomSecureLevel=O,g.atom=ge,g.configureAtomaric=ue,g.configuredOptions=T,g.useAtom=de,g.useAtomDo=ae,g.useAtomGet=fe,g.useAtomSet=Y,g.useAtomSetDeferred=le,g.useAtomValue=X,Object.defineProperty(g,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.61",
4
+ "version": "0.0.62",
5
5
  "type": "module",
6
6
  "main": "./build/atomaric.umd.cjs",
7
7
  "module": "./build/atomaric.js",
package/types/index.d.ts CHANGED
@@ -34,14 +34,16 @@ export type AtomOptions<Value, Actions extends Record<string, Function> = {}> =
34
34
  | {
35
35
  /** save in localStorage by this key */
36
36
  storeKey: AtomStoreKey;
37
+ securifyKeyLevel?: AtomSecureLevel;
38
+ securifyValueLevel?: AtomSecureLevel;
37
39
  }
38
40
  | {
39
41
  /** declare your custom actions */
40
42
  do: (
41
- set: (value: Value | ((value: Value) => Value), isPreventSave?: boolean) => void,
43
+ set: AtomSetMethod<Value>,
42
44
  get: () => Value,
43
45
  self: Atom<Value>,
44
- setDeferred: (value: Value | ((value: Value) => Value), debounceMs?: number, isPreventSave?: boolean) => void,
46
+ setDeferred: AtomSetDeferredMethod<Value>,
45
47
  ) => Actions;
46
48
  }
47
49
  );
@@ -175,4 +177,6 @@ export function atom<Value, Actions extends Record<string, Function> = {}>(
175
177
  export function configureAtomaric(options: {
176
178
  useSyncExternalStore: typeof useSyncExternalStore;
177
179
  keyPathSeparator: ObjectActionsSetDeepPartial;
180
+ securifyKeyLevel?: AtomSecureLevel;
181
+ securifyValueLevel?: AtomSecureLevel;
178
182
  }): void;