solid-js 1.7.9 → 1.7.11
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 +36 -20
- package/dist/dev.js +326 -548
- package/dist/server.cjs +38 -23
- package/dist/server.js +108 -192
- package/dist/solid.cjs +36 -20
- package/dist/solid.js +284 -475
- package/h/dist/h.js +8 -34
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +31 -45
- package/package.json +1 -1
- package/store/dist/dev.cjs +4 -3
- package/store/dist/dev.js +46 -117
- package/store/dist/server.js +8 -19
- package/store/dist/store.cjs +4 -3
- package/store/dist/store.js +43 -108
- package/store/types/index.d.ts +7 -21
- package/store/types/modifiers.d.ts +3 -6
- package/store/types/mutable.d.ts +2 -5
- package/store/types/server.d.ts +4 -12
- package/store/types/store.d.ts +61 -215
- package/types/index.d.ts +9 -69
- package/types/reactive/array.d.ts +4 -12
- package/types/reactive/observable.d.ts +17 -25
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +150 -236
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +31 -62
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +12 -12
- package/types/server/index.d.ts +2 -55
- package/types/server/reactive.d.ts +44 -72
- package/types/server/rendering.d.ts +95 -171
- package/universal/dist/dev.js +12 -28
- package/universal/dist/universal.js +12 -28
- package/universal/types/index.d.ts +1 -3
- package/universal/types/universal.d.ts +1 -0
- package/web/dist/dev.js +79 -610
- package/web/dist/server.cjs +5 -1
- package/web/dist/server.js +82 -177
- package/web/dist/web.js +79 -610
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +10 -27
- package/web/types/server-mock.d.ts +32 -47
- package/web/types/server.d.ts +1 -1
package/store/types/store.d.ts
CHANGED
|
@@ -1,35 +1,22 @@
|
|
|
1
|
-
export declare const $RAW: unique symbol, $NODE: unique symbol, $HAS: unique symbol;
|
|
1
|
+
export declare const $RAW: unique symbol, $NODE: unique symbol, $HAS: unique symbol, $SELF: unique symbol;
|
|
2
2
|
export declare const DevHooks: {
|
|
3
|
-
|
|
3
|
+
onStoreNodeUpdate: OnStoreNodeUpdate | null;
|
|
4
4
|
};
|
|
5
5
|
type DataNode = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
(): any;
|
|
7
|
+
$(value?: any): void;
|
|
8
8
|
};
|
|
9
9
|
type DataNodes = Record<PropertyKey, DataNode | undefined>;
|
|
10
|
-
export type OnStoreNodeUpdate = (
|
|
11
|
-
state: StoreNode,
|
|
12
|
-
property: PropertyKey,
|
|
13
|
-
value: StoreNode | NotWrappable,
|
|
14
|
-
prev: StoreNode | NotWrappable
|
|
15
|
-
) => void;
|
|
10
|
+
export type OnStoreNodeUpdate = (state: StoreNode, property: PropertyKey, value: StoreNode | NotWrappable, prev: StoreNode | NotWrappable) => void;
|
|
16
11
|
export interface StoreNode {
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
[$NODE]?: DataNodes;
|
|
13
|
+
[key: PropertyKey]: any;
|
|
19
14
|
}
|
|
20
15
|
export declare namespace SolidStore {
|
|
21
|
-
|
|
16
|
+
interface Unwrappable {
|
|
17
|
+
}
|
|
22
18
|
}
|
|
23
|
-
export type NotWrappable =
|
|
24
|
-
| string
|
|
25
|
-
| number
|
|
26
|
-
| bigint
|
|
27
|
-
| symbol
|
|
28
|
-
| boolean
|
|
29
|
-
| Function
|
|
30
|
-
| null
|
|
31
|
-
| undefined
|
|
32
|
-
| SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
|
|
19
|
+
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
|
|
33
20
|
export type Store<T> = T;
|
|
34
21
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
35
22
|
/**
|
|
@@ -46,215 +33,74 @@ export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
|
46
33
|
export declare function unwrap<T>(item: T, set?: Set<unknown>): T;
|
|
47
34
|
export declare function getNodes(target: StoreNode, symbol: typeof $NODE | typeof $HAS): DataNodes;
|
|
48
35
|
export declare function getNode(nodes: DataNodes, property: PropertyKey, value?: any): DataNode;
|
|
49
|
-
export declare function proxyDescriptor(
|
|
50
|
-
target: StoreNode,
|
|
51
|
-
property: PropertyKey
|
|
52
|
-
): TypedPropertyDescriptor<any> | undefined;
|
|
36
|
+
export declare function proxyDescriptor(target: StoreNode, property: PropertyKey): TypedPropertyDescriptor<any> | undefined;
|
|
53
37
|
export declare function trackSelf(target: StoreNode): void;
|
|
54
38
|
export declare function ownKeys(target: StoreNode): (string | symbol)[];
|
|
55
|
-
export declare function setProperty(
|
|
56
|
-
|
|
57
|
-
property: PropertyKey,
|
|
58
|
-
value: any,
|
|
59
|
-
deleting?: boolean
|
|
60
|
-
): void;
|
|
61
|
-
export declare function updatePath(
|
|
62
|
-
current: StoreNode,
|
|
63
|
-
path: any[],
|
|
64
|
-
traversed?: PropertyKey[]
|
|
65
|
-
): void;
|
|
39
|
+
export declare function setProperty(state: StoreNode, property: PropertyKey, value: any, deleting?: boolean): void;
|
|
40
|
+
export declare function updatePath(current: StoreNode, path: any[], traversed?: PropertyKey[]): void;
|
|
66
41
|
/** @deprecated */
|
|
67
|
-
export type DeepReadonly<T> = 0 extends 1 & T
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
? T
|
|
71
|
-
: {
|
|
72
|
-
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
73
|
-
};
|
|
42
|
+
export type DeepReadonly<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
|
|
43
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
44
|
+
};
|
|
74
45
|
/** @deprecated */
|
|
75
|
-
export type DeepMutable<T> = 0 extends 1 & T
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
? "0" extends keyof T
|
|
84
|
-
? {
|
|
85
|
-
[K in Extract<keyof T, `${number}`>]?: T[K];
|
|
86
|
-
}
|
|
87
|
-
: {
|
|
88
|
-
[x: number]: T[number];
|
|
89
|
-
}
|
|
90
|
-
: Partial<T>;
|
|
46
|
+
export type DeepMutable<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
|
|
47
|
+
-readonly [K in keyof T]: DeepMutable<T[K]>;
|
|
48
|
+
};
|
|
49
|
+
export type CustomPartial<T> = T extends readonly unknown[] ? "0" extends keyof T ? {
|
|
50
|
+
[K in Extract<keyof T, `${number}`>]?: T[K];
|
|
51
|
+
} : {
|
|
52
|
+
[x: number]: T[number];
|
|
53
|
+
} : Partial<T>;
|
|
91
54
|
export type PickMutable<T> = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
: 2
|
|
97
|
-
-readonly [V in K]: T[V];
|
|
98
|
-
}
|
|
99
|
-
? 1
|
|
100
|
-
: 2
|
|
101
|
-
? K
|
|
102
|
-
: never]: T[K];
|
|
55
|
+
[K in keyof T as (<U>() => U extends {
|
|
56
|
+
[V in K]: T[V];
|
|
57
|
+
} ? 1 : 2) extends <U>() => U extends {
|
|
58
|
+
-readonly [V in K]: T[V];
|
|
59
|
+
} ? 1 : 2 ? K : never]: T[K];
|
|
103
60
|
};
|
|
104
61
|
export type StorePathRange = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
62
|
+
from?: number;
|
|
63
|
+
to?: number;
|
|
64
|
+
by?: number;
|
|
108
65
|
};
|
|
109
66
|
export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
|
|
110
|
-
export type StoreSetter<T, U extends PropertyKey[] = []> =
|
|
111
|
-
|
|
112
|
-
| CustomPartial<T>
|
|
113
|
-
| ((prevState: T, traversed: U) => T | CustomPartial<T>);
|
|
114
|
-
export type Part<T, K extends KeyOf<T> = KeyOf<T>> =
|
|
115
|
-
| K
|
|
116
|
-
| ([K] extends [never] ? never : readonly K[])
|
|
117
|
-
| ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
|
|
67
|
+
export type StoreSetter<T, U extends PropertyKey[] = []> = T | CustomPartial<T> | ((prevState: T, traversed: U) => T | CustomPartial<T>);
|
|
68
|
+
export type Part<T, K extends KeyOf<T> = KeyOf<T>> = K | ([K] extends [never] ? never : readonly K[]) | ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
|
|
118
69
|
type W<T> = Exclude<T, NotWrappable>;
|
|
119
|
-
type KeyOf<T> = number extends keyof T
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
: [T] extends [never]
|
|
123
|
-
? never
|
|
124
|
-
: [T] extends [readonly unknown[]]
|
|
125
|
-
? number
|
|
126
|
-
: keyof T
|
|
127
|
-
: keyof T;
|
|
70
|
+
type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [never] ? never : [
|
|
71
|
+
T
|
|
72
|
+
] extends [readonly unknown[]] ? number : keyof T : keyof T;
|
|
128
73
|
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
|
|
129
|
-
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never]
|
|
130
|
-
|
|
131
|
-
: K extends MutableKeyOf<T>
|
|
132
|
-
? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>]
|
|
133
|
-
: K extends KeyOf<T>
|
|
134
|
-
? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>]
|
|
135
|
-
: never;
|
|
136
|
-
type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T
|
|
137
|
-
? [...Part<any>[], StoreSetter<any, PropertyKey[]>]
|
|
138
|
-
: Rest<W<T>, U>;
|
|
74
|
+
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never] ? never : K extends MutableKeyOf<T> ? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>] : K extends KeyOf<T> ? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>] : never;
|
|
75
|
+
type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T ? [...Part<any>[], StoreSetter<any, PropertyKey[]>] : Rest<W<T>, U>;
|
|
139
76
|
type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
|
|
140
77
|
export interface SetStoreFunction<T> {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
k1: Part<W<T>, K1>,
|
|
151
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
152
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7],
|
|
159
|
-
[K7, K6, K5, K4, K3, K2, K1]
|
|
160
|
-
>
|
|
161
|
-
): void;
|
|
162
|
-
<
|
|
163
|
-
K1 extends KeyOf<W<T>>,
|
|
164
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
165
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
166
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
167
|
-
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
|
|
168
|
-
K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>
|
|
169
|
-
>(
|
|
170
|
-
k1: Part<W<T>, K1>,
|
|
171
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
172
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
173
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
174
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
175
|
-
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
|
|
176
|
-
setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>
|
|
177
|
-
): void;
|
|
178
|
-
<
|
|
179
|
-
K1 extends KeyOf<W<T>>,
|
|
180
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
181
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
182
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
183
|
-
K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>
|
|
184
|
-
>(
|
|
185
|
-
k1: Part<W<T>, K1>,
|
|
186
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
187
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
188
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
189
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
190
|
-
setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>
|
|
191
|
-
): void;
|
|
192
|
-
<
|
|
193
|
-
K1 extends KeyOf<W<T>>,
|
|
194
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
195
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
196
|
-
K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>
|
|
197
|
-
>(
|
|
198
|
-
k1: Part<W<T>, K1>,
|
|
199
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
200
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
201
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
202
|
-
setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>
|
|
203
|
-
): void;
|
|
204
|
-
<
|
|
205
|
-
K1 extends KeyOf<W<T>>,
|
|
206
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
207
|
-
K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>
|
|
208
|
-
>(
|
|
209
|
-
k1: Part<W<T>, K1>,
|
|
210
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
211
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
212
|
-
setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>
|
|
213
|
-
): void;
|
|
214
|
-
<K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(
|
|
215
|
-
k1: Part<W<T>, K1>,
|
|
216
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
217
|
-
setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>
|
|
218
|
-
): void;
|
|
219
|
-
<K1 extends MutableKeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: StoreSetter<W<T>[K1], [K1]>): void;
|
|
220
|
-
(setter: StoreSetter<T, []>): void;
|
|
221
|
-
<
|
|
222
|
-
K1 extends KeyOf<W<T>>,
|
|
223
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
224
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
225
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
226
|
-
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
|
|
227
|
-
K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
|
|
228
|
-
K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>
|
|
229
|
-
>(
|
|
230
|
-
k1: Part<W<T>, K1>,
|
|
231
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
232
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
233
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
234
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
235
|
-
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
|
|
236
|
-
k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
|
|
237
|
-
...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>
|
|
238
|
-
): void;
|
|
78
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>, K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>, setter: StoreSetter<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [
|
|
79
|
+
K7,
|
|
80
|
+
K6,
|
|
81
|
+
K5,
|
|
82
|
+
K4,
|
|
83
|
+
K3,
|
|
84
|
+
K2,
|
|
85
|
+
K1
|
|
86
|
+
]>): void;
|
|
87
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>): void;
|
|
88
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>): void;
|
|
89
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>): void;
|
|
90
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>): void;
|
|
91
|
+
<K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>): void;
|
|
92
|
+
<K1 extends MutableKeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: StoreSetter<W<T>[K1], [K1]>): void;
|
|
93
|
+
(setter: StoreSetter<T, []>): void;
|
|
94
|
+
<K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>, K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>, ...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>): void;
|
|
239
95
|
}
|
|
240
96
|
/**
|
|
241
97
|
* creates a reactive store that can be read through a proxy object and written with a setter function
|
|
242
98
|
*
|
|
243
99
|
* @description https://www.solidjs.com/docs/latest/api#createstore
|
|
244
100
|
*/
|
|
245
|
-
export declare function createStore<T extends object = {}>(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
name?: string;
|
|
251
|
-
}
|
|
252
|
-
]
|
|
253
|
-
: [
|
|
254
|
-
store: T | Store<T>,
|
|
255
|
-
options?: {
|
|
256
|
-
name?: string;
|
|
257
|
-
}
|
|
258
|
-
]
|
|
259
|
-
): [get: Store<T>, set: SetStoreFunction<T>];
|
|
101
|
+
export declare function createStore<T extends object = {}>(...[store, options]: {} extends T ? [store?: T | Store<T>, options?: {
|
|
102
|
+
name?: string;
|
|
103
|
+
}] : [store: T | Store<T>, options?: {
|
|
104
|
+
name?: string;
|
|
105
|
+
}]): [get: Store<T>, set: SetStoreFunction<T>];
|
|
260
106
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,63 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
$PROXY,
|
|
4
|
-
$TRACK,
|
|
5
|
-
batch,
|
|
6
|
-
children,
|
|
7
|
-
createComputed,
|
|
8
|
-
createContext,
|
|
9
|
-
createDeferred,
|
|
10
|
-
createEffect,
|
|
11
|
-
createMemo,
|
|
12
|
-
createReaction,
|
|
13
|
-
createRenderEffect,
|
|
14
|
-
createResource,
|
|
15
|
-
createRoot,
|
|
16
|
-
createSelector,
|
|
17
|
-
createSignal,
|
|
18
|
-
enableExternalSource,
|
|
19
|
-
enableScheduling,
|
|
20
|
-
equalFn,
|
|
21
|
-
getListener,
|
|
22
|
-
getOwner,
|
|
23
|
-
on,
|
|
24
|
-
onCleanup,
|
|
25
|
-
onError,
|
|
26
|
-
catchError,
|
|
27
|
-
onMount,
|
|
28
|
-
runWithOwner,
|
|
29
|
-
startTransition,
|
|
30
|
-
untrack,
|
|
31
|
-
useContext,
|
|
32
|
-
useTransition
|
|
33
|
-
} from "./reactive/signal.js";
|
|
34
|
-
export type {
|
|
35
|
-
Accessor,
|
|
36
|
-
AccessorArray,
|
|
37
|
-
ChildrenReturn,
|
|
38
|
-
Context,
|
|
39
|
-
EffectFunction,
|
|
40
|
-
EffectOptions,
|
|
41
|
-
InitializedResource,
|
|
42
|
-
InitializedResourceOptions,
|
|
43
|
-
InitializedResourceReturn,
|
|
44
|
-
MemoOptions,
|
|
45
|
-
NoInfer,
|
|
46
|
-
OnEffectFunction,
|
|
47
|
-
OnOptions,
|
|
48
|
-
Owner,
|
|
49
|
-
Resource,
|
|
50
|
-
ResourceActions,
|
|
51
|
-
ResourceFetcher,
|
|
52
|
-
ResourceFetcherInfo,
|
|
53
|
-
ResourceOptions,
|
|
54
|
-
ResourceReturn,
|
|
55
|
-
ResourceSource,
|
|
56
|
-
ReturnTypes,
|
|
57
|
-
Setter,
|
|
58
|
-
Signal,
|
|
59
|
-
SignalOptions
|
|
60
|
-
} from "./reactive/signal.js";
|
|
1
|
+
export { $DEVCOMP, $PROXY, $TRACK, batch, catchError, children, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, enableExternalSource, enableScheduling, equalFn, getListener, getOwner, on, onCleanup, onError, onMount, runWithOwner, startTransition, untrack, useContext, useTransition } from "./reactive/signal.js";
|
|
2
|
+
export type { Accessor, AccessorArray, ChildrenReturn, Context, ContextProviderComponent, EffectFunction, EffectOptions, InitializedResource, InitializedResourceOptions, InitializedResourceReturn, MemoOptions, NoInfer, OnEffectFunction, OnOptions, Owner, ResolvedChildren, ResolvedJSXElement, Resource, ResourceActions, ResourceFetcher, ResourceFetcherInfo, ResourceOptions, ResourceReturn, ResourceSource, ReturnTypes, Setter, Signal, SignalOptions } from "./reactive/signal.js";
|
|
61
3
|
export * from "./reactive/observable.js";
|
|
62
4
|
export * from "./reactive/scheduler.js";
|
|
63
5
|
export * from "./reactive/array.js";
|
|
@@ -66,16 +8,14 @@ import type { JSX } from "./jsx.js";
|
|
|
66
8
|
type JSXElement = JSX.Element;
|
|
67
9
|
export type { JSXElement, JSX };
|
|
68
10
|
import { registerGraph, writeSignal } from "./reactive/signal.js";
|
|
69
|
-
export declare const DEV:
|
|
70
|
-
|
|
71
|
-
readonly hooks: {
|
|
11
|
+
export declare const DEV: {
|
|
12
|
+
readonly hooks: {
|
|
72
13
|
afterUpdate: (() => void) | null;
|
|
73
14
|
afterCreateOwner: ((owner: import("./reactive/signal.js").Owner) => void) | null;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
| undefined;
|
|
15
|
+
};
|
|
16
|
+
readonly writeSignal: typeof writeSignal;
|
|
17
|
+
readonly registerGraph: typeof registerGraph;
|
|
18
|
+
} | undefined;
|
|
79
19
|
declare global {
|
|
80
|
-
|
|
20
|
+
var Solid$$: boolean;
|
|
81
21
|
}
|
|
@@ -29,13 +29,9 @@ SOFTWARE.
|
|
|
29
29
|
*
|
|
30
30
|
* @description https://www.solidjs.com/docs/latest/api#maparray
|
|
31
31
|
*/
|
|
32
|
-
export declare function mapArray<T, U>(
|
|
33
|
-
list: Accessor<readonly T[] | undefined | null | false>,
|
|
34
|
-
mapFn: (v: T, i: Accessor<number>) => U,
|
|
35
|
-
options?: {
|
|
32
|
+
export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: T, i: Accessor<number>) => U, options?: {
|
|
36
33
|
fallback?: Accessor<any>;
|
|
37
|
-
|
|
38
|
-
): () => U[];
|
|
34
|
+
}): () => U[];
|
|
39
35
|
/**
|
|
40
36
|
* reactively maps arrays by index instead of value - underlying helper for the `<Index>` control flow
|
|
41
37
|
*
|
|
@@ -43,10 +39,6 @@ export declare function mapArray<T, U>(
|
|
|
43
39
|
*
|
|
44
40
|
* @description https://www.solidjs.com/docs/latest/api#indexarray
|
|
45
41
|
*/
|
|
46
|
-
export declare function indexArray<T, U>(
|
|
47
|
-
list: Accessor<readonly T[] | undefined | null | false>,
|
|
48
|
-
mapFn: (v: Accessor<T>, i: number) => U,
|
|
49
|
-
options?: {
|
|
42
|
+
export declare function indexArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: Accessor<T>, i: number) => U, options?: {
|
|
50
43
|
fallback?: Accessor<any>;
|
|
51
|
-
|
|
52
|
-
): () => U[];
|
|
44
|
+
}): () => U[];
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { Accessor, Setter } from "./signal.js";
|
|
2
2
|
declare global {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
interface SymbolConstructor {
|
|
4
|
+
readonly observable: symbol;
|
|
5
|
+
}
|
|
6
6
|
}
|
|
7
7
|
interface Observable<T> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
[Symbol.observable](): Observable<T>;
|
|
12
|
-
}
|
|
13
|
-
export type ObservableObserver<T> =
|
|
14
|
-
| ((v: T) => void)
|
|
15
|
-
| {
|
|
16
|
-
next?: (v: T) => void;
|
|
17
|
-
error?: (v: any) => void;
|
|
18
|
-
complete?: (v: boolean) => void;
|
|
8
|
+
subscribe(observer: ObservableObserver<T>): {
|
|
9
|
+
unsubscribe(): void;
|
|
19
10
|
};
|
|
11
|
+
[Symbol.observable](): Observable<T>;
|
|
12
|
+
}
|
|
13
|
+
export type ObservableObserver<T> = ((v: T) => void) | {
|
|
14
|
+
next?: (v: T) => void;
|
|
15
|
+
error?: (v: any) => void;
|
|
16
|
+
complete?: (v: boolean) => void;
|
|
17
|
+
};
|
|
20
18
|
/**
|
|
21
19
|
* creates a simple observable from a signal's accessor to be used with the `from` operator of observable libraries like e.g. rxjs
|
|
22
20
|
* ```typescript
|
|
@@ -28,15 +26,9 @@ export type ObservableObserver<T> =
|
|
|
28
26
|
* description https://www.solidjs.com/docs/latest/api#observable
|
|
29
27
|
*/
|
|
30
28
|
export declare function observable<T>(input: Accessor<T>): Observable<T>;
|
|
31
|
-
export declare function from<T>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| (() => void)
|
|
37
|
-
| {
|
|
38
|
-
unsubscribe: () => void;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
): Accessor<T | undefined>;
|
|
29
|
+
export declare function from<T>(producer: ((setter: Setter<T | undefined>) => () => void) | {
|
|
30
|
+
subscribe: (fn: (v: T) => void) => (() => void) | {
|
|
31
|
+
unsubscribe: () => void;
|
|
32
|
+
};
|
|
33
|
+
}): Accessor<T | undefined>;
|
|
42
34
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export interface Task {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
id: number;
|
|
3
|
+
fn: ((didTimeout: boolean) => void) | null;
|
|
4
|
+
startTime: number;
|
|
5
|
+
expirationTime: number;
|
|
6
6
|
}
|
|
7
|
-
export declare function requestCallback(
|
|
8
|
-
fn: () => void,
|
|
9
|
-
options?: {
|
|
7
|
+
export declare function requestCallback(fn: () => void, options?: {
|
|
10
8
|
timeout: number;
|
|
11
|
-
|
|
12
|
-
): Task;
|
|
9
|
+
}): Task;
|
|
13
10
|
export declare function cancelCallback(task: Task): void;
|