solid-js 1.8.17 → 1.8.19
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/README.md +223 -223
- package/dist/dev.cjs +29 -24
- package/dist/dev.js +344 -580
- package/dist/server.cjs +31 -18
- package/dist/server.js +103 -185
- package/dist/solid.cjs +29 -24
- package/dist/solid.js +302 -507
- package/h/dist/h.cjs +12 -1
- package/h/dist/h.js +19 -34
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +8 -11
- package/h/jsx-runtime/types/jsx.d.ts +5 -0
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +94 -216
- package/html/types/lit.d.ts +33 -47
- package/package.json +3 -3
- package/store/dist/dev.js +43 -122
- package/store/dist/server.js +8 -19
- package/store/dist/store.js +40 -113
- 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 +62 -219
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +5 -0
- package/types/reactive/array.d.ts +6 -14
- package/types/reactive/observable.d.ts +18 -26
- package/types/reactive/scheduler.d.ts +6 -9
- package/types/reactive/signal.d.ts +164 -255
- package/types/render/Suspense.d.ts +7 -7
- package/types/render/component.d.ts +33 -64
- package/types/render/flow.d.ts +37 -49
- package/types/render/hydration.d.ts +15 -13
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +99 -168
- 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.cjs +6 -4
- package/web/dist/dev.js +88 -630
- package/web/dist/server.cjs +6 -6
- package/web/dist/server.js +102 -216
- package/web/dist/web.cjs +6 -4
- package/web/dist/web.js +86 -621
- package/web/storage/dist/storage.js +3 -3
- package/web/types/client.d.ts +2 -2
- package/web/types/core.d.ts +1 -10
- package/web/types/index.d.ts +12 -29
- package/web/types/server-mock.d.ts +32 -47
package/store/types/store.d.ts
CHANGED
|
@@ -1,38 +1,22 @@
|
|
|
1
|
-
export declare const $RAW: unique symbol,
|
|
2
|
-
$NODE: unique symbol,
|
|
3
|
-
$HAS: unique symbol,
|
|
4
|
-
$SELF: unique symbol;
|
|
1
|
+
export declare const $RAW: unique symbol, $NODE: unique symbol, $HAS: unique symbol, $SELF: unique symbol;
|
|
5
2
|
export declare const DevHooks: {
|
|
6
|
-
|
|
3
|
+
onStoreNodeUpdate: OnStoreNodeUpdate | null;
|
|
7
4
|
};
|
|
8
5
|
type DataNode = {
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
(): any;
|
|
7
|
+
$(value?: any): void;
|
|
11
8
|
};
|
|
12
9
|
type DataNodes = Record<PropertyKey, DataNode | undefined>;
|
|
13
|
-
export type OnStoreNodeUpdate = (
|
|
14
|
-
state: StoreNode,
|
|
15
|
-
property: PropertyKey,
|
|
16
|
-
value: StoreNode | NotWrappable,
|
|
17
|
-
prev: StoreNode | NotWrappable
|
|
18
|
-
) => void;
|
|
10
|
+
export type OnStoreNodeUpdate = (state: StoreNode, property: PropertyKey, value: StoreNode | NotWrappable, prev: StoreNode | NotWrappable) => void;
|
|
19
11
|
export interface StoreNode {
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
[$NODE]?: DataNodes;
|
|
13
|
+
[key: PropertyKey]: any;
|
|
22
14
|
}
|
|
23
15
|
export declare namespace SolidStore {
|
|
24
|
-
|
|
16
|
+
interface Unwrappable {
|
|
17
|
+
}
|
|
25
18
|
}
|
|
26
|
-
export type NotWrappable =
|
|
27
|
-
| string
|
|
28
|
-
| number
|
|
29
|
-
| bigint
|
|
30
|
-
| symbol
|
|
31
|
-
| boolean
|
|
32
|
-
| Function
|
|
33
|
-
| null
|
|
34
|
-
| undefined
|
|
35
|
-
| SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
|
|
19
|
+
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
|
|
36
20
|
export type Store<T> = T;
|
|
37
21
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
38
22
|
/**
|
|
@@ -49,215 +33,74 @@ export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
|
49
33
|
export declare function unwrap<T>(item: T, set?: Set<unknown>): T;
|
|
50
34
|
export declare function getNodes(target: StoreNode, symbol: typeof $NODE | typeof $HAS): DataNodes;
|
|
51
35
|
export declare function getNode(nodes: DataNodes, property: PropertyKey, value?: any): DataNode;
|
|
52
|
-
export declare function proxyDescriptor(
|
|
53
|
-
target: StoreNode,
|
|
54
|
-
property: PropertyKey
|
|
55
|
-
): TypedPropertyDescriptor<any> | undefined;
|
|
36
|
+
export declare function proxyDescriptor(target: StoreNode, property: PropertyKey): TypedPropertyDescriptor<any> | undefined;
|
|
56
37
|
export declare function trackSelf(target: StoreNode): void;
|
|
57
38
|
export declare function ownKeys(target: StoreNode): (string | symbol)[];
|
|
58
|
-
export declare function setProperty(
|
|
59
|
-
|
|
60
|
-
property: PropertyKey,
|
|
61
|
-
value: any,
|
|
62
|
-
deleting?: boolean
|
|
63
|
-
): void;
|
|
64
|
-
export declare function updatePath(
|
|
65
|
-
current: StoreNode,
|
|
66
|
-
path: any[],
|
|
67
|
-
traversed?: PropertyKey[]
|
|
68
|
-
): 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;
|
|
69
41
|
/** @deprecated */
|
|
70
|
-
export type DeepReadonly<T> = 0 extends 1 & T
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
? T
|
|
74
|
-
: {
|
|
75
|
-
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
76
|
-
};
|
|
42
|
+
export type DeepReadonly<T> = 0 extends 1 & T ? T : T extends NotWrappable ? T : {
|
|
43
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
44
|
+
};
|
|
77
45
|
/** @deprecated */
|
|
78
|
-
export type DeepMutable<T> = 0 extends 1 & T
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
? "0" extends keyof T
|
|
87
|
-
? {
|
|
88
|
-
[K in Extract<keyof T, `${number}`>]?: T[K];
|
|
89
|
-
}
|
|
90
|
-
: {
|
|
91
|
-
[x: number]: T[number];
|
|
92
|
-
}
|
|
93
|
-
: 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>;
|
|
94
54
|
export type PickMutable<T> = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
: 2
|
|
100
|
-
-readonly [V in K]: T[V];
|
|
101
|
-
}
|
|
102
|
-
? 1
|
|
103
|
-
: 2
|
|
104
|
-
? K
|
|
105
|
-
: 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];
|
|
106
60
|
};
|
|
107
61
|
export type StorePathRange = {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
62
|
+
from?: number;
|
|
63
|
+
to?: number;
|
|
64
|
+
by?: number;
|
|
111
65
|
};
|
|
112
66
|
export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
|
|
113
|
-
export type StoreSetter<T, U extends PropertyKey[] = []> =
|
|
114
|
-
|
|
115
|
-
| CustomPartial<T>
|
|
116
|
-
| ((prevState: T, traversed: U) => T | CustomPartial<T>);
|
|
117
|
-
export type Part<T, K extends KeyOf<T> = KeyOf<T>> =
|
|
118
|
-
| K
|
|
119
|
-
| ([K] extends [never] ? never : readonly K[])
|
|
120
|
-
| ([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);
|
|
121
69
|
type W<T> = Exclude<T, NotWrappable>;
|
|
122
|
-
type KeyOf<T> = number extends keyof T
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
: [T] extends [never]
|
|
126
|
-
? never
|
|
127
|
-
: [T] extends [readonly unknown[]]
|
|
128
|
-
? number
|
|
129
|
-
: keyof T
|
|
130
|
-
: 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;
|
|
131
73
|
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
|
|
132
|
-
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never]
|
|
133
|
-
|
|
134
|
-
: K extends MutableKeyOf<T>
|
|
135
|
-
? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>]
|
|
136
|
-
: K extends KeyOf<T>
|
|
137
|
-
? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>]
|
|
138
|
-
: never;
|
|
139
|
-
type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T
|
|
140
|
-
? [...Part<any>[], StoreSetter<any, PropertyKey[]>]
|
|
141
|
-
: 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>;
|
|
142
76
|
type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
|
|
143
77
|
export interface SetStoreFunction<T> {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
k1: Part<W<T>, K1>,
|
|
154
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
155
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7],
|
|
162
|
-
[K7, K6, K5, K4, K3, K2, K1]
|
|
163
|
-
>
|
|
164
|
-
): void;
|
|
165
|
-
<
|
|
166
|
-
K1 extends KeyOf<W<T>>,
|
|
167
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
168
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
169
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
170
|
-
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
|
|
171
|
-
K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>
|
|
172
|
-
>(
|
|
173
|
-
k1: Part<W<T>, K1>,
|
|
174
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
175
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
176
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
177
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
178
|
-
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
|
|
179
|
-
setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>
|
|
180
|
-
): void;
|
|
181
|
-
<
|
|
182
|
-
K1 extends KeyOf<W<T>>,
|
|
183
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
184
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
185
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
186
|
-
K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>
|
|
187
|
-
>(
|
|
188
|
-
k1: Part<W<T>, K1>,
|
|
189
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
190
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
191
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
192
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
193
|
-
setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>
|
|
194
|
-
): void;
|
|
195
|
-
<
|
|
196
|
-
K1 extends KeyOf<W<T>>,
|
|
197
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
198
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
199
|
-
K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>
|
|
200
|
-
>(
|
|
201
|
-
k1: Part<W<T>, K1>,
|
|
202
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
203
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
204
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
205
|
-
setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>
|
|
206
|
-
): void;
|
|
207
|
-
<
|
|
208
|
-
K1 extends KeyOf<W<T>>,
|
|
209
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
210
|
-
K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>
|
|
211
|
-
>(
|
|
212
|
-
k1: Part<W<T>, K1>,
|
|
213
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
214
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
215
|
-
setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>
|
|
216
|
-
): void;
|
|
217
|
-
<K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(
|
|
218
|
-
k1: Part<W<T>, K1>,
|
|
219
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
220
|
-
setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>
|
|
221
|
-
): void;
|
|
222
|
-
<K1 extends MutableKeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: StoreSetter<W<T>[K1], [K1]>): void;
|
|
223
|
-
(setter: StoreSetter<T, []>): void;
|
|
224
|
-
<
|
|
225
|
-
K1 extends KeyOf<W<T>>,
|
|
226
|
-
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
227
|
-
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
228
|
-
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
229
|
-
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
|
|
230
|
-
K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
|
|
231
|
-
K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>
|
|
232
|
-
>(
|
|
233
|
-
k1: Part<W<T>, K1>,
|
|
234
|
-
k2: Part<W<W<T>[K1]>, K2>,
|
|
235
|
-
k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
|
|
236
|
-
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
237
|
-
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
238
|
-
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
|
|
239
|
-
k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
|
|
240
|
-
...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>
|
|
241
|
-
): 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;
|
|
242
95
|
}
|
|
243
96
|
/**
|
|
244
97
|
* Creates a reactive store that can be read through a proxy object and written with a setter function
|
|
245
98
|
*
|
|
246
|
-
* @description https://
|
|
99
|
+
* @description https://docs.solidjs.com/reference/store-utilities/create-store
|
|
247
100
|
*/
|
|
248
|
-
export declare function createStore<T extends object = {}>(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
name?: string;
|
|
254
|
-
}
|
|
255
|
-
]
|
|
256
|
-
: [
|
|
257
|
-
store: T | Store<T>,
|
|
258
|
-
options?: {
|
|
259
|
-
name?: string;
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
): [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>];
|
|
263
106
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,66 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
$PROXY,
|
|
4
|
-
$TRACK,
|
|
5
|
-
batch,
|
|
6
|
-
catchError,
|
|
7
|
-
children,
|
|
8
|
-
createComputed,
|
|
9
|
-
createContext,
|
|
10
|
-
createDeferred,
|
|
11
|
-
createEffect,
|
|
12
|
-
createMemo,
|
|
13
|
-
createReaction,
|
|
14
|
-
createRenderEffect,
|
|
15
|
-
createResource,
|
|
16
|
-
createRoot,
|
|
17
|
-
createSelector,
|
|
18
|
-
createSignal,
|
|
19
|
-
enableExternalSource,
|
|
20
|
-
enableScheduling,
|
|
21
|
-
equalFn,
|
|
22
|
-
getListener,
|
|
23
|
-
getOwner,
|
|
24
|
-
on,
|
|
25
|
-
onCleanup,
|
|
26
|
-
onError,
|
|
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
|
-
ContextProviderComponent,
|
|
40
|
-
EffectFunction,
|
|
41
|
-
EffectOptions,
|
|
42
|
-
InitializedResource,
|
|
43
|
-
InitializedResourceOptions,
|
|
44
|
-
InitializedResourceReturn,
|
|
45
|
-
MemoOptions,
|
|
46
|
-
NoInfer,
|
|
47
|
-
OnEffectFunction,
|
|
48
|
-
OnOptions,
|
|
49
|
-
Owner,
|
|
50
|
-
ResolvedChildren,
|
|
51
|
-
ResolvedJSXElement,
|
|
52
|
-
Resource,
|
|
53
|
-
ResourceActions,
|
|
54
|
-
ResourceFetcher,
|
|
55
|
-
ResourceFetcherInfo,
|
|
56
|
-
ResourceOptions,
|
|
57
|
-
ResourceReturn,
|
|
58
|
-
ResourceSource,
|
|
59
|
-
ReturnTypes,
|
|
60
|
-
Setter,
|
|
61
|
-
Signal,
|
|
62
|
-
SignalOptions
|
|
63
|
-
} 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";
|
|
64
3
|
export * from "./reactive/observable.js";
|
|
65
4
|
export * from "./reactive/scheduler.js";
|
|
66
5
|
export * from "./reactive/array.js";
|
|
@@ -69,19 +8,15 @@ import type { JSX } from "./jsx.js";
|
|
|
69
8
|
type JSXElement = JSX.Element;
|
|
70
9
|
export type { JSXElement, JSX };
|
|
71
10
|
import { registerGraph, writeSignal } from "./reactive/signal.js";
|
|
72
|
-
export declare const DEV:
|
|
73
|
-
|
|
74
|
-
readonly hooks: {
|
|
11
|
+
export declare const DEV: {
|
|
12
|
+
readonly hooks: {
|
|
75
13
|
afterUpdate: (() => void) | null;
|
|
76
14
|
afterCreateOwner: ((owner: import("./reactive/signal.js").Owner) => void) | null;
|
|
77
|
-
afterCreateSignal:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
readonly registerGraph: typeof registerGraph;
|
|
83
|
-
}
|
|
84
|
-
| undefined;
|
|
15
|
+
afterCreateSignal: ((signal: import("./reactive/signal.js").SignalState<any>) => void) | null;
|
|
16
|
+
};
|
|
17
|
+
readonly writeSignal: typeof writeSignal;
|
|
18
|
+
readonly registerGraph: typeof registerGraph;
|
|
19
|
+
} | undefined;
|
|
85
20
|
declare global {
|
|
86
|
-
|
|
21
|
+
var Solid$$: boolean;
|
|
87
22
|
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -221,6 +221,7 @@ export namespace JSX {
|
|
|
221
221
|
onAnimationStart?: EventHandlerUnion<T, AnimationEvent>;
|
|
222
222
|
onAuxClick?: EventHandlerUnion<T, MouseEvent>;
|
|
223
223
|
onBeforeInput?: InputEventHandlerUnion<T, InputEvent>;
|
|
224
|
+
onBeforeToggle?: EventHandlerUnion<T, ToggleEvent>;
|
|
224
225
|
onBlur?: FocusEventHandlerUnion<T, FocusEvent>;
|
|
225
226
|
onCanPlay?: EventHandlerUnion<T, Event>;
|
|
226
227
|
onCanPlayThrough?: EventHandlerUnion<T, Event>;
|
|
@@ -286,6 +287,7 @@ export namespace JSX {
|
|
|
286
287
|
>;
|
|
287
288
|
onSuspend?: EventHandlerUnion<T, Event>;
|
|
288
289
|
onTimeUpdate?: EventHandlerUnion<T, Event>;
|
|
290
|
+
onToggle?: EventHandlerUnion<T, ToggleEvent>;
|
|
289
291
|
onTouchCancel?: EventHandlerUnion<T, TouchEvent>;
|
|
290
292
|
onTouchEnd?: EventHandlerUnion<T, TouchEvent>;
|
|
291
293
|
onTouchMove?: EventHandlerUnion<T, TouchEvent>;
|
|
@@ -308,6 +310,7 @@ export namespace JSX {
|
|
|
308
310
|
onanimationstart?: EventHandlerUnion<T, AnimationEvent>;
|
|
309
311
|
onauxclick?: EventHandlerUnion<T, MouseEvent>;
|
|
310
312
|
onbeforeinput?: InputEventHandlerUnion<T, InputEvent>;
|
|
313
|
+
onbeforetoggle?: EventHandlerUnion<T, ToggleEvent>;
|
|
311
314
|
onblur?: FocusEventHandlerUnion<T, FocusEvent>;
|
|
312
315
|
oncanplay?: EventHandlerUnion<T, Event>;
|
|
313
316
|
oncanplaythrough?: EventHandlerUnion<T, Event>;
|
|
@@ -373,6 +376,7 @@ export namespace JSX {
|
|
|
373
376
|
>;
|
|
374
377
|
onsuspend?: EventHandlerUnion<T, Event>;
|
|
375
378
|
ontimeupdate?: EventHandlerUnion<T, Event>;
|
|
379
|
+
ontoggle?: EventHandlerUnion<T, ToggleEvent>;
|
|
376
380
|
ontouchcancel?: EventHandlerUnion<T, TouchEvent>;
|
|
377
381
|
ontouchend?: EventHandlerUnion<T, TouchEvent>;
|
|
378
382
|
ontouchmove?: EventHandlerUnion<T, TouchEvent>;
|
|
@@ -1897,6 +1901,7 @@ export namespace JSX {
|
|
|
1897
1901
|
contentScriptType?: string;
|
|
1898
1902
|
contentStyleType?: string;
|
|
1899
1903
|
xmlns?: string;
|
|
1904
|
+
"xmlns:xlink"?: string;
|
|
1900
1905
|
}
|
|
1901
1906
|
interface SwitchSVGAttributes<T>
|
|
1902
1907
|
extends ContainerElementSVGAttributes<T>,
|
|
@@ -27,26 +27,18 @@ SOFTWARE.
|
|
|
27
27
|
*
|
|
28
28
|
* similar to `Array.prototype.map`, but gets the index as accessor, transforms only values that changed and returns an accessor and reactively tracks changes to the list.
|
|
29
29
|
*
|
|
30
|
-
* @description https://
|
|
30
|
+
* @description https://docs.solidjs.com/reference/reactive-utilities/map-array
|
|
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
|
*
|
|
42
38
|
* similar to `Array.prototype.map`, but gets the value as an accessor, transforms only changed items of the original arrays anew and returns an accessor.
|
|
43
39
|
*
|
|
44
|
-
* @description https://
|
|
40
|
+
* @description https://docs.solidjs.com/reference/reactive-utilities/index-array
|
|
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
|
|
@@ -25,18 +23,12 @@ export type ObservableObserver<T> =
|
|
|
25
23
|
* const obsv$ = from(observable(s));
|
|
26
24
|
* obsv$.subscribe((v) => console.log(v));
|
|
27
25
|
* ```
|
|
28
|
-
* description https://
|
|
26
|
+
* description https://docs.solidjs.com/reference/reactive-utilities/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;
|