solid-js 1.8.22 → 1.9.0
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/dist/dev.cjs +7 -6
- package/dist/dev.js +567 -325
- package/dist/server.cjs +1 -1
- package/dist/server.js +169 -75
- package/dist/solid.cjs +7 -6
- package/dist/solid.js +494 -283
- package/h/dist/h.js +40 -9
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +13 -10
- package/h/jsx-runtime/types/jsx.d.ts +22 -1
- package/h/types/hyperscript.d.ts +11 -11
- package/h/types/index.d.ts +1 -1
- package/html/dist/html.cjs +4 -2
- package/html/dist/html.js +222 -95
- package/html/types/index.d.ts +1 -1
- package/html/types/lit.d.ts +52 -33
- package/package.json +1 -5
- package/store/dist/dev.cjs +1 -1
- package/store/dist/dev.js +123 -43
- package/store/dist/server.cjs +4 -0
- package/store/dist/server.js +23 -8
- package/store/dist/store.cjs +1 -1
- package/store/dist/store.js +114 -40
- package/store/package.json +0 -4
- package/store/types/index.d.ts +21 -7
- package/store/types/modifiers.d.ts +6 -3
- package/store/types/mutable.d.ts +5 -2
- package/store/types/server.d.ts +26 -5
- package/store/types/store.d.ts +219 -62
- package/types/index.d.ts +75 -10
- package/types/jsx.d.ts +35 -8
- package/types/reactive/array.d.ts +12 -4
- package/types/reactive/observable.d.ts +25 -17
- package/types/reactive/scheduler.d.ts +9 -6
- package/types/reactive/signal.d.ts +236 -143
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +64 -33
- package/types/render/flow.d.ts +43 -31
- package/types/render/hydration.d.ts +15 -15
- package/types/server/index.d.ts +57 -2
- package/types/server/reactive.d.ts +73 -42
- package/types/server/rendering.d.ts +169 -98
- package/universal/dist/dev.js +28 -12
- package/universal/dist/universal.js +28 -12
- package/universal/types/index.d.ts +3 -1
- package/universal/types/universal.d.ts +0 -1
- package/web/dist/dev.cjs +57 -24
- package/web/dist/dev.js +679 -101
- package/web/dist/server.cjs +96 -15
- package/web/dist/server.js +676 -105
- package/web/dist/web.cjs +53 -23
- package/web/dist/web.js +664 -99
- package/web/package.json +0 -4
- package/web/storage/dist/storage.js +3 -3
- package/web/types/client.d.ts +5 -3
- package/web/types/core.d.ts +10 -1
- package/web/types/index.d.ts +27 -10
- package/web/types/server-mock.d.ts +47 -32
- package/web/types/server.d.ts +88 -0
package/store/dist/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $PROXY, $TRACK, getListener, batch, createSignal } from
|
|
1
|
+
import { $PROXY, $TRACK, getListener, batch, createSignal } from "solid-js";
|
|
2
2
|
|
|
3
3
|
const $RAW = Symbol("store-raw"),
|
|
4
4
|
$NODE = Symbol("store-node"),
|
|
@@ -8,7 +8,7 @@ function wrap$1(value) {
|
|
|
8
8
|
let p = value[$PROXY];
|
|
9
9
|
if (!p) {
|
|
10
10
|
Object.defineProperty(value, $PROXY, {
|
|
11
|
-
value: p = new Proxy(value, proxyTraps$1)
|
|
11
|
+
value: (p = new Proxy(value, proxyTraps$1))
|
|
12
12
|
});
|
|
13
13
|
if (!Array.isArray(value)) {
|
|
14
14
|
const keys = Object.keys(value),
|
|
@@ -28,20 +28,29 @@ function wrap$1(value) {
|
|
|
28
28
|
}
|
|
29
29
|
function isWrappable(obj) {
|
|
30
30
|
let proto;
|
|
31
|
-
return
|
|
31
|
+
return (
|
|
32
|
+
obj != null &&
|
|
33
|
+
typeof obj === "object" &&
|
|
34
|
+
(obj[$PROXY] ||
|
|
35
|
+
!(proto = Object.getPrototypeOf(obj)) ||
|
|
36
|
+
proto === Object.prototype ||
|
|
37
|
+
Array.isArray(obj))
|
|
38
|
+
);
|
|
32
39
|
}
|
|
33
40
|
function unwrap(item, set = new Set()) {
|
|
34
41
|
let result, unwrapped, v, prop;
|
|
35
|
-
if (result = item != null && item[$RAW]) return result;
|
|
42
|
+
if ((result = item != null && item[$RAW])) return result;
|
|
36
43
|
if (!isWrappable(item) || set.has(item)) return item;
|
|
37
44
|
if (Array.isArray(item)) {
|
|
38
|
-
if (Object.isFrozen(item)) item = item.slice(0);
|
|
45
|
+
if (Object.isFrozen(item)) item = item.slice(0);
|
|
46
|
+
else set.add(item);
|
|
39
47
|
for (let i = 0, l = item.length; i < l; i++) {
|
|
40
48
|
v = item[i];
|
|
41
49
|
if ((unwrapped = unwrap(v, set)) !== v) item[i] = unwrapped;
|
|
42
50
|
}
|
|
43
51
|
} else {
|
|
44
|
-
if (Object.isFrozen(item)) item = Object.assign({}, item);
|
|
52
|
+
if (Object.isFrozen(item)) item = Object.assign({}, item);
|
|
53
|
+
else set.add(item);
|
|
45
54
|
const keys = Object.keys(item),
|
|
46
55
|
desc = Object.getOwnPropertyDescriptors(item);
|
|
47
56
|
for (let i = 0, l = keys.length; i < l; i++) {
|
|
@@ -55,9 +64,10 @@ function unwrap(item, set = new Set()) {
|
|
|
55
64
|
}
|
|
56
65
|
function getNodes(target, symbol) {
|
|
57
66
|
let nodes = target[symbol];
|
|
58
|
-
if (!nodes)
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
if (!nodes)
|
|
68
|
+
Object.defineProperty(target, symbol, {
|
|
69
|
+
value: (nodes = Object.create(null))
|
|
70
|
+
});
|
|
61
71
|
return nodes;
|
|
62
72
|
}
|
|
63
73
|
function getNode(nodes, property, value) {
|
|
@@ -67,11 +77,12 @@ function getNode(nodes, property, value) {
|
|
|
67
77
|
internal: true
|
|
68
78
|
});
|
|
69
79
|
s.$ = set;
|
|
70
|
-
return nodes[property] = s;
|
|
80
|
+
return (nodes[property] = s);
|
|
71
81
|
}
|
|
72
82
|
function proxyDescriptor$1(target, property) {
|
|
73
83
|
const desc = Reflect.getOwnPropertyDescriptor(target, property);
|
|
74
|
-
if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE)
|
|
84
|
+
if (!desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE)
|
|
85
|
+
return desc;
|
|
75
86
|
delete desc.value;
|
|
76
87
|
delete desc.writable;
|
|
77
88
|
desc.get = () => target[$PROXY][property];
|
|
@@ -98,12 +109,25 @@ const proxyTraps$1 = {
|
|
|
98
109
|
if (property === $NODE || property === $HAS || property === "__proto__") return value;
|
|
99
110
|
if (!tracked) {
|
|
100
111
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
101
|
-
if (
|
|
112
|
+
if (
|
|
113
|
+
getListener() &&
|
|
114
|
+
(typeof value !== "function" || target.hasOwnProperty(property)) &&
|
|
115
|
+
!(desc && desc.get)
|
|
116
|
+
)
|
|
117
|
+
value = getNode(nodes, property, value)();
|
|
102
118
|
}
|
|
103
119
|
return isWrappable(value) ? wrap$1(value) : value;
|
|
104
120
|
},
|
|
105
121
|
has(target, property) {
|
|
106
|
-
if (
|
|
122
|
+
if (
|
|
123
|
+
property === $RAW ||
|
|
124
|
+
property === $PROXY ||
|
|
125
|
+
property === $TRACK ||
|
|
126
|
+
property === $NODE ||
|
|
127
|
+
property === $HAS ||
|
|
128
|
+
property === "__proto__"
|
|
129
|
+
)
|
|
130
|
+
return true;
|
|
107
131
|
getListener() && getNode(getNodes(target, $HAS), property)();
|
|
108
132
|
return property in target;
|
|
109
133
|
},
|
|
@@ -129,7 +153,7 @@ function setProperty(state, property, value, deleting = false) {
|
|
|
129
153
|
}
|
|
130
154
|
let nodes = getNodes(state, $NODE),
|
|
131
155
|
node;
|
|
132
|
-
if (node = getNode(nodes, property, prev)) node.$(() => value);
|
|
156
|
+
if ((node = getNode(nodes, property, prev))) node.$(() => value);
|
|
133
157
|
if (Array.isArray(state) && state.length !== len) {
|
|
134
158
|
for (let i = state.length; i < len; i++) (node = nodes[i]) && node.$();
|
|
135
159
|
(node = getNode(nodes, "length", len)) && node.$(state.length);
|
|
@@ -175,11 +199,7 @@ function updatePath(current, path, traversed = []) {
|
|
|
175
199
|
}
|
|
176
200
|
return;
|
|
177
201
|
} else if (isArray && partType === "object") {
|
|
178
|
-
const {
|
|
179
|
-
from = 0,
|
|
180
|
-
to = current.length - 1,
|
|
181
|
-
by = 1
|
|
182
|
-
} = part;
|
|
202
|
+
const { from = 0, to = current.length - 1, by = 1 } = part;
|
|
183
203
|
for (let i = from; i <= to; i += by) {
|
|
184
204
|
updatePath(current, [i].concat(path), traversed);
|
|
185
205
|
}
|
|
@@ -198,7 +218,7 @@ function updatePath(current, path, traversed = []) {
|
|
|
198
218
|
}
|
|
199
219
|
if (part === undefined && value == undefined) return;
|
|
200
220
|
value = unwrap(value);
|
|
201
|
-
if (part === undefined || isWrappable(prev) && isWrappable(value) && !Array.isArray(value)) {
|
|
221
|
+
if (part === undefined || (isWrappable(prev) && isWrappable(value) && !Array.isArray(value))) {
|
|
202
222
|
mergeStoreNode(prev, value);
|
|
203
223
|
} else setProperty(current, part, value);
|
|
204
224
|
}
|
|
@@ -208,7 +228,9 @@ function createStore(...[store, options]) {
|
|
|
208
228
|
const wrappedStore = wrap$1(unwrappedStore);
|
|
209
229
|
function setStore(...args) {
|
|
210
230
|
batch(() => {
|
|
211
|
-
isArray && args.length === 1
|
|
231
|
+
isArray && args.length === 1
|
|
232
|
+
? updateArray(unwrappedStore, args[0])
|
|
233
|
+
: updatePath(unwrappedStore, args);
|
|
212
234
|
});
|
|
213
235
|
}
|
|
214
236
|
return [wrappedStore, setStore];
|
|
@@ -216,11 +238,19 @@ function createStore(...[store, options]) {
|
|
|
216
238
|
|
|
217
239
|
function proxyDescriptor(target, property) {
|
|
218
240
|
const desc = Reflect.getOwnPropertyDescriptor(target, property);
|
|
219
|
-
if (
|
|
241
|
+
if (
|
|
242
|
+
!desc ||
|
|
243
|
+
desc.get ||
|
|
244
|
+
desc.set ||
|
|
245
|
+
!desc.configurable ||
|
|
246
|
+
property === $PROXY ||
|
|
247
|
+
property === $NODE
|
|
248
|
+
)
|
|
249
|
+
return desc;
|
|
220
250
|
delete desc.value;
|
|
221
251
|
delete desc.writable;
|
|
222
252
|
desc.get = () => target[$PROXY][property];
|
|
223
|
-
desc.set = v => target[$PROXY][property] = v;
|
|
253
|
+
desc.set = v => (target[$PROXY][property] = v);
|
|
224
254
|
return desc;
|
|
225
255
|
}
|
|
226
256
|
const proxyTraps = {
|
|
@@ -238,14 +268,24 @@ const proxyTraps = {
|
|
|
238
268
|
if (!tracked) {
|
|
239
269
|
const desc = Object.getOwnPropertyDescriptor(target, property);
|
|
240
270
|
const isFunction = typeof value === "function";
|
|
241
|
-
if (getListener() && (!isFunction || target.hasOwnProperty(property)) && !(desc && desc.get))
|
|
271
|
+
if (getListener() && (!isFunction || target.hasOwnProperty(property)) && !(desc && desc.get))
|
|
272
|
+
value = getNode(nodes, property, value)();
|
|
273
|
+
else if (value != null && isFunction && value === Array.prototype[property]) {
|
|
242
274
|
return (...args) => batch(() => Array.prototype[property].apply(receiver, args));
|
|
243
275
|
}
|
|
244
276
|
}
|
|
245
277
|
return isWrappable(value) ? wrap(value) : value;
|
|
246
278
|
},
|
|
247
279
|
has(target, property) {
|
|
248
|
-
if (
|
|
280
|
+
if (
|
|
281
|
+
property === $RAW ||
|
|
282
|
+
property === $PROXY ||
|
|
283
|
+
property === $TRACK ||
|
|
284
|
+
property === $NODE ||
|
|
285
|
+
property === $HAS ||
|
|
286
|
+
property === "__proto__"
|
|
287
|
+
)
|
|
288
|
+
return true;
|
|
249
289
|
getListener() && getNode(getNodes(target, $HAS), property)();
|
|
250
290
|
return property in target;
|
|
251
291
|
},
|
|
@@ -264,12 +304,17 @@ function wrap(value) {
|
|
|
264
304
|
let p = value[$PROXY];
|
|
265
305
|
if (!p) {
|
|
266
306
|
Object.defineProperty(value, $PROXY, {
|
|
267
|
-
value: p = new Proxy(value, proxyTraps)
|
|
307
|
+
value: (p = new Proxy(value, proxyTraps))
|
|
268
308
|
});
|
|
269
309
|
const keys = Object.keys(value),
|
|
270
310
|
desc = Object.getOwnPropertyDescriptors(value);
|
|
271
311
|
const proto = Object.getPrototypeOf(value);
|
|
272
|
-
const isClass =
|
|
312
|
+
const isClass =
|
|
313
|
+
proto !== null &&
|
|
314
|
+
value !== null &&
|
|
315
|
+
typeof value === "object" &&
|
|
316
|
+
!Array.isArray(value) &&
|
|
317
|
+
proto !== Object.prototype;
|
|
273
318
|
if (isClass) {
|
|
274
319
|
const descriptors = Object.getOwnPropertyDescriptors(proto);
|
|
275
320
|
keys.push(...Object.keys(descriptors));
|
|
@@ -311,19 +356,42 @@ function applyState(target, parent, property, merge, key) {
|
|
|
311
356
|
const previous = parent[property];
|
|
312
357
|
if (target === previous) return;
|
|
313
358
|
const isArray = Array.isArray(target);
|
|
314
|
-
if (
|
|
359
|
+
if (
|
|
360
|
+
property !== $ROOT &&
|
|
361
|
+
(!isWrappable(target) ||
|
|
362
|
+
!isWrappable(previous) ||
|
|
363
|
+
isArray !== Array.isArray(previous) ||
|
|
364
|
+
(key && target[key] !== previous[key]))
|
|
365
|
+
) {
|
|
315
366
|
setProperty(parent, property, target);
|
|
316
367
|
return;
|
|
317
368
|
}
|
|
318
369
|
if (isArray) {
|
|
319
|
-
if (
|
|
370
|
+
if (
|
|
371
|
+
target.length &&
|
|
372
|
+
previous.length &&
|
|
373
|
+
(!merge || (key && target[0] && target[0][key] != null))
|
|
374
|
+
) {
|
|
320
375
|
let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
|
|
321
|
-
for (
|
|
376
|
+
for (
|
|
377
|
+
start = 0, end = Math.min(previous.length, target.length);
|
|
378
|
+
start < end &&
|
|
379
|
+
(previous[start] === target[start] ||
|
|
380
|
+
(key && previous[start] && target[start] && previous[start][key] === target[start][key]));
|
|
381
|
+
start++
|
|
382
|
+
) {
|
|
322
383
|
applyState(target[start], previous, start, merge, key);
|
|
323
384
|
}
|
|
324
385
|
const temp = new Array(target.length),
|
|
325
386
|
newIndices = new Map();
|
|
326
|
-
for (
|
|
387
|
+
for (
|
|
388
|
+
end = previous.length - 1, newEnd = target.length - 1;
|
|
389
|
+
end >= start &&
|
|
390
|
+
newEnd >= start &&
|
|
391
|
+
(previous[end] === target[newEnd] ||
|
|
392
|
+
(key && previous[start] && target[start] && previous[end][key] === target[newEnd][key]));
|
|
393
|
+
end--, newEnd--
|
|
394
|
+
) {
|
|
327
395
|
temp[newEnd] = previous[end];
|
|
328
396
|
}
|
|
329
397
|
if (start > newEnd || start > end) {
|
|
@@ -377,16 +445,19 @@ function applyState(target, parent, property, merge, key) {
|
|
|
377
445
|
}
|
|
378
446
|
}
|
|
379
447
|
function reconcile(value, options = {}) {
|
|
380
|
-
const {
|
|
381
|
-
merge,
|
|
382
|
-
key = "id"
|
|
383
|
-
} = options,
|
|
448
|
+
const { merge, key = "id" } = options,
|
|
384
449
|
v = unwrap(value);
|
|
385
450
|
return state => {
|
|
386
451
|
if (!isWrappable(state) || !isWrappable(v)) return v;
|
|
387
|
-
const res = applyState(
|
|
388
|
-
|
|
389
|
-
|
|
452
|
+
const res = applyState(
|
|
453
|
+
v,
|
|
454
|
+
{
|
|
455
|
+
[$ROOT]: state
|
|
456
|
+
},
|
|
457
|
+
$ROOT,
|
|
458
|
+
merge,
|
|
459
|
+
key
|
|
460
|
+
);
|
|
390
461
|
return res === undefined ? state : res;
|
|
391
462
|
};
|
|
392
463
|
}
|
|
@@ -396,7 +467,10 @@ const setterTraps = {
|
|
|
396
467
|
if (property === $RAW) return target;
|
|
397
468
|
const value = target[property];
|
|
398
469
|
let proxy;
|
|
399
|
-
return isWrappable(value)
|
|
470
|
+
return isWrappable(value)
|
|
471
|
+
? producers.get(value) ||
|
|
472
|
+
(producers.set(value, (proxy = new Proxy(value, setterTraps))), proxy)
|
|
473
|
+
: value;
|
|
400
474
|
},
|
|
401
475
|
set(target, property, value) {
|
|
402
476
|
setProperty(target, property, unwrap(value));
|
|
@@ -412,7 +486,7 @@ function produce(fn) {
|
|
|
412
486
|
if (isWrappable(state)) {
|
|
413
487
|
let proxy;
|
|
414
488
|
if (!(proxy = producers.get(state))) {
|
|
415
|
-
producers.set(state, proxy = new Proxy(state, setterTraps));
|
|
489
|
+
producers.set(state, (proxy = new Proxy(state, setterTraps)));
|
|
416
490
|
}
|
|
417
491
|
fn(proxy);
|
|
418
492
|
}
|
package/store/package.json
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
"name": "solid-js/store",
|
|
3
3
|
"main": "./dist/server.cjs",
|
|
4
4
|
"module": "./dist/server.js",
|
|
5
|
-
"browser": {
|
|
6
|
-
"./dist/server.cjs": "./dist/store.cjs",
|
|
7
|
-
"./dist/server.js": "./dist/store.js"
|
|
8
|
-
},
|
|
9
5
|
"unpkg": "./dist/store.cjs",
|
|
10
6
|
"types": "./types/index.d.ts",
|
|
11
7
|
"type": "module",
|
package/store/types/index.d.ts
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
export { $RAW, createStore, unwrap } from "./store.js";
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
ArrayFilterFn,
|
|
4
|
+
DeepMutable,
|
|
5
|
+
DeepReadonly,
|
|
6
|
+
NotWrappable,
|
|
7
|
+
Part,
|
|
8
|
+
SetStoreFunction,
|
|
9
|
+
SolidStore,
|
|
10
|
+
Store,
|
|
11
|
+
StoreNode,
|
|
12
|
+
StorePathRange,
|
|
13
|
+
StoreSetter
|
|
14
|
+
} from "./store.js";
|
|
3
15
|
export * from "./mutable.js";
|
|
4
16
|
export * from "./modifiers.js";
|
|
5
17
|
import { $NODE, isWrappable } from "./store.js";
|
|
6
|
-
export declare const DEV:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
export declare const DEV:
|
|
19
|
+
| {
|
|
20
|
+
readonly $NODE: typeof $NODE;
|
|
21
|
+
readonly isWrappable: typeof isWrappable;
|
|
22
|
+
readonly hooks: {
|
|
10
23
|
onStoreNodeUpdate: import("./store.js").OnStoreNodeUpdate | null;
|
|
11
|
-
|
|
12
|
-
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
| undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type ReconcileOptions = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
key?: string | null;
|
|
3
|
+
merge?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function reconcile<T extends U, U>(
|
|
5
|
+
export declare function reconcile<T extends U, U>(
|
|
6
|
+
value: T,
|
|
7
|
+
options?: ReconcileOptions
|
|
8
|
+
): (state: U) => T;
|
|
6
9
|
export declare function produce<T>(fn: (state: T) => void): (state: T) => T;
|
package/store/types/mutable.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { StoreNode } from "./store.js";
|
|
2
|
-
export declare function createMutable<T extends StoreNode>(
|
|
2
|
+
export declare function createMutable<T extends StoreNode>(
|
|
3
|
+
state: T,
|
|
4
|
+
options?: {
|
|
3
5
|
name?: string;
|
|
4
|
-
}
|
|
6
|
+
}
|
|
7
|
+
): T;
|
|
5
8
|
export declare function modifyMutable<T>(state: T, modifier: (state: T) => T): void;
|
package/store/types/server.d.ts
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import type { SetStoreFunction, Store } from "./store.js";
|
|
2
|
+
export type {
|
|
3
|
+
ArrayFilterFn,
|
|
4
|
+
DeepMutable,
|
|
5
|
+
DeepReadonly,
|
|
6
|
+
NotWrappable,
|
|
7
|
+
Part,
|
|
8
|
+
SetStoreFunction,
|
|
9
|
+
SolidStore,
|
|
10
|
+
Store,
|
|
11
|
+
StoreNode,
|
|
12
|
+
StorePathRange,
|
|
13
|
+
StoreSetter
|
|
14
|
+
} from "./store.js";
|
|
2
15
|
export declare const $RAW: unique symbol;
|
|
3
16
|
export declare function isWrappable(obj: any): boolean;
|
|
4
17
|
export declare function unwrap<T>(item: T): T;
|
|
5
|
-
export declare function setProperty(
|
|
18
|
+
export declare function setProperty(
|
|
19
|
+
state: any,
|
|
20
|
+
property: PropertyKey,
|
|
21
|
+
value: any,
|
|
22
|
+
force?: boolean
|
|
23
|
+
): void;
|
|
6
24
|
export declare function updatePath(current: any, path: any[], traversed?: PropertyKey[]): void;
|
|
7
25
|
export declare function createStore<T>(state: T | Store<T>): [Store<T>, SetStoreFunction<T>];
|
|
8
26
|
export declare function createMutable<T>(state: T | Store<T>): T;
|
|
27
|
+
export declare function modifyMutable<T>(state: T, modifier: (state: T) => T): void;
|
|
9
28
|
type ReconcileOptions = {
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
key?: string | null;
|
|
30
|
+
merge?: boolean;
|
|
12
31
|
};
|
|
13
|
-
export declare function reconcile<T extends U, U extends object>(
|
|
32
|
+
export declare function reconcile<T extends U, U extends object>(
|
|
33
|
+
value: T,
|
|
34
|
+
options?: ReconcileOptions
|
|
35
|
+
): (state: U) => T;
|
|
14
36
|
export declare function produce<T>(fn: (state: T) => void): (state: T) => T;
|
|
15
37
|
export declare const DEV: undefined;
|
|
16
|
-
export {};
|