solid-js 1.8.8 → 1.8.9
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 +17 -21
- package/dist/dev.js +554 -321
- package/dist/server.js +170 -75
- package/dist/solid.cjs +17 -21
- package/dist/solid.js +481 -279
- package/h/dist/h.js +34 -8
- package/h/jsx-runtime/dist/jsx.js +1 -1
- package/h/jsx-runtime/types/index.d.ts +11 -8
- package/h/jsx-runtime/types/jsx.d.ts +2 -1
- package/h/types/hyperscript.d.ts +11 -11
- package/html/dist/html.js +216 -94
- package/html/types/lit.d.ts +47 -33
- package/package.json +3 -2
- package/store/dist/dev.cjs +1 -1
- package/store/dist/dev.js +117 -42
- package/store/dist/server.js +19 -8
- package/store/dist/store.cjs +1 -1
- package/store/dist/store.js +108 -39
- 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 +12 -4
- package/store/types/store.d.ts +218 -61
- package/types/index.d.ts +75 -10
- package/types/jsx.d.ts +2 -1
- 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 +233 -142
- 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 +13 -13
- package/types/server/index.d.ts +57 -2
- package/types/server/reactive.d.ts +73 -42
- package/types/server/rendering.d.ts +167 -96
- 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 +1 -1
- package/web/dist/dev.js +621 -82
- package/web/dist/server.cjs +30 -27
- package/web/dist/server.js +232 -121
- package/web/dist/storage.js +3 -3
- package/web/dist/web.cjs +1 -1
- package/web/dist/web.js +615 -81
- package/web/types/client.d.ts +2 -2
- 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/store/types/store.d.ts
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
export declare const $RAW: unique symbol,
|
|
1
|
+
export declare const $RAW: unique symbol,
|
|
2
|
+
$NODE: unique symbol,
|
|
3
|
+
$HAS: unique symbol,
|
|
4
|
+
$SELF: unique symbol;
|
|
2
5
|
export declare const DevHooks: {
|
|
3
|
-
|
|
6
|
+
onStoreNodeUpdate: OnStoreNodeUpdate | null;
|
|
4
7
|
};
|
|
5
8
|
type DataNode = {
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
(): any;
|
|
10
|
+
$(value?: any): void;
|
|
8
11
|
};
|
|
9
12
|
type DataNodes = Record<PropertyKey, DataNode | undefined>;
|
|
10
|
-
export type OnStoreNodeUpdate = (
|
|
13
|
+
export type OnStoreNodeUpdate = (
|
|
14
|
+
state: StoreNode,
|
|
15
|
+
property: PropertyKey,
|
|
16
|
+
value: StoreNode | NotWrappable,
|
|
17
|
+
prev: StoreNode | NotWrappable
|
|
18
|
+
) => void;
|
|
11
19
|
export interface StoreNode {
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
[$NODE]?: DataNodes;
|
|
21
|
+
[key: PropertyKey]: any;
|
|
14
22
|
}
|
|
15
23
|
export declare namespace SolidStore {
|
|
16
|
-
|
|
17
|
-
}
|
|
24
|
+
interface Unwrappable {}
|
|
18
25
|
}
|
|
19
|
-
export type NotWrappable =
|
|
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];
|
|
20
36
|
export type Store<T> = T;
|
|
21
37
|
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
22
38
|
/**
|
|
@@ -33,74 +49,215 @@ export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
|
33
49
|
export declare function unwrap<T>(item: T, set?: Set<unknown>): T;
|
|
34
50
|
export declare function getNodes(target: StoreNode, symbol: typeof $NODE | typeof $HAS): DataNodes;
|
|
35
51
|
export declare function getNode(nodes: DataNodes, property: PropertyKey, value?: any): DataNode;
|
|
36
|
-
export declare function proxyDescriptor(
|
|
52
|
+
export declare function proxyDescriptor(
|
|
53
|
+
target: StoreNode,
|
|
54
|
+
property: PropertyKey
|
|
55
|
+
): TypedPropertyDescriptor<any> | undefined;
|
|
37
56
|
export declare function trackSelf(target: StoreNode): void;
|
|
38
57
|
export declare function ownKeys(target: StoreNode): (string | symbol)[];
|
|
39
|
-
export declare function setProperty(
|
|
40
|
-
|
|
58
|
+
export declare function setProperty(
|
|
59
|
+
state: StoreNode,
|
|
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;
|
|
41
69
|
/** @deprecated */
|
|
42
|
-
export type DeepReadonly<T> = 0 extends 1 & T
|
|
43
|
-
|
|
44
|
-
|
|
70
|
+
export type DeepReadonly<T> = 0 extends 1 & T
|
|
71
|
+
? T
|
|
72
|
+
: T extends NotWrappable
|
|
73
|
+
? T
|
|
74
|
+
: {
|
|
75
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
76
|
+
};
|
|
45
77
|
/** @deprecated */
|
|
46
|
-
export type DeepMutable<T> = 0 extends 1 & T
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
78
|
+
export type DeepMutable<T> = 0 extends 1 & T
|
|
79
|
+
? T
|
|
80
|
+
: T extends NotWrappable
|
|
81
|
+
? T
|
|
82
|
+
: {
|
|
83
|
+
-readonly [K in keyof T]: DeepMutable<T[K]>;
|
|
84
|
+
};
|
|
85
|
+
export type CustomPartial<T> = T extends readonly unknown[]
|
|
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>;
|
|
54
94
|
export type PickMutable<T> = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
[K in keyof T as (<U>() => U extends {
|
|
96
|
+
[V in K]: T[V];
|
|
97
|
+
}
|
|
98
|
+
? 1
|
|
99
|
+
: 2) extends <U>() => U extends {
|
|
100
|
+
-readonly [V in K]: T[V];
|
|
101
|
+
}
|
|
102
|
+
? 1
|
|
103
|
+
: 2
|
|
104
|
+
? K
|
|
105
|
+
: never]: T[K];
|
|
60
106
|
};
|
|
61
107
|
export type StorePathRange = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
108
|
+
from?: number;
|
|
109
|
+
to?: number;
|
|
110
|
+
by?: number;
|
|
65
111
|
};
|
|
66
112
|
export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
|
|
67
|
-
export type StoreSetter<T, U extends PropertyKey[] = []> =
|
|
68
|
-
|
|
113
|
+
export type StoreSetter<T, U extends PropertyKey[] = []> =
|
|
114
|
+
| T
|
|
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);
|
|
69
121
|
type W<T> = Exclude<T, NotWrappable>;
|
|
70
|
-
type KeyOf<T> = number extends keyof T
|
|
71
|
-
|
|
72
|
-
|
|
122
|
+
type KeyOf<T> = number extends keyof T
|
|
123
|
+
? 0 extends 1 & T
|
|
124
|
+
? keyof T
|
|
125
|
+
: [T] extends [never]
|
|
126
|
+
? never
|
|
127
|
+
: [T] extends [readonly unknown[]]
|
|
128
|
+
? number
|
|
129
|
+
: keyof T
|
|
130
|
+
: keyof T;
|
|
73
131
|
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
|
|
74
|
-
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never]
|
|
75
|
-
|
|
132
|
+
type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never]
|
|
133
|
+
? never
|
|
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>;
|
|
76
142
|
type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
|
|
77
143
|
export interface SetStoreFunction<T> {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
144
|
+
<
|
|
145
|
+
K1 extends KeyOf<W<T>>,
|
|
146
|
+
K2 extends KeyOf<W<W<T>[K1]>>,
|
|
147
|
+
K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
|
|
148
|
+
K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
|
|
149
|
+
K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
|
|
150
|
+
K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
|
|
151
|
+
K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>
|
|
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
|
+
k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
|
|
157
|
+
k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
|
|
158
|
+
k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
|
|
159
|
+
k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
|
|
160
|
+
setter: StoreSetter<
|
|
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;
|
|
95
242
|
}
|
|
96
243
|
/**
|
|
97
244
|
* creates a reactive store that can be read through a proxy object and written with a setter function
|
|
98
245
|
*
|
|
99
246
|
* @description https://www.solidjs.com/docs/latest/api#createstore
|
|
100
247
|
*/
|
|
101
|
-
export declare function createStore<T extends object = {}>(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
248
|
+
export declare function createStore<T extends object = {}>(
|
|
249
|
+
...[store, options]: {} extends T
|
|
250
|
+
? [
|
|
251
|
+
store?: T | Store<T>,
|
|
252
|
+
options?: {
|
|
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>];
|
|
106
263
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
$DEVCOMP,
|
|
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";
|
|
3
64
|
export * from "./reactive/observable.js";
|
|
4
65
|
export * from "./reactive/scheduler.js";
|
|
5
66
|
export * from "./reactive/array.js";
|
|
@@ -8,15 +69,19 @@ import type { JSX } from "./jsx.js";
|
|
|
8
69
|
type JSXElement = JSX.Element;
|
|
9
70
|
export type { JSXElement, JSX };
|
|
10
71
|
import { registerGraph, writeSignal } from "./reactive/signal.js";
|
|
11
|
-
export declare const DEV:
|
|
12
|
-
|
|
72
|
+
export declare const DEV:
|
|
73
|
+
| {
|
|
74
|
+
readonly hooks: {
|
|
13
75
|
afterUpdate: (() => void) | null;
|
|
14
76
|
afterCreateOwner: ((owner: import("./reactive/signal.js").Owner) => void) | null;
|
|
15
|
-
afterCreateSignal:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
77
|
+
afterCreateSignal:
|
|
78
|
+
| ((signal: import("./reactive/signal.js").SignalState<any>) => void)
|
|
79
|
+
| null;
|
|
80
|
+
};
|
|
81
|
+
readonly writeSignal: typeof writeSignal;
|
|
82
|
+
readonly registerGraph: typeof registerGraph;
|
|
83
|
+
}
|
|
84
|
+
| undefined;
|
|
20
85
|
declare global {
|
|
21
|
-
|
|
86
|
+
var Solid$$: boolean;
|
|
22
87
|
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -2072,7 +2072,8 @@ export namespace JSX {
|
|
|
2072
2072
|
ruby: HTMLAttributes<HTMLElement>;
|
|
2073
2073
|
s: HTMLAttributes<HTMLElement>;
|
|
2074
2074
|
samp: HTMLAttributes<HTMLElement>;
|
|
2075
|
-
script: ScriptHTMLAttributes<
|
|
2075
|
+
script: ScriptHTMLAttributes<HTMLScriptElement>;
|
|
2076
|
+
search: HTMLAttributes<HTMLElement>;
|
|
2076
2077
|
section: HTMLAttributes<HTMLElement>;
|
|
2077
2078
|
select: SelectHTMLAttributes<HTMLSelectElement>;
|
|
2078
2079
|
slot: HTMLSlotElementAttributes;
|
|
@@ -29,9 +29,13 @@ SOFTWARE.
|
|
|
29
29
|
*
|
|
30
30
|
* @description https://www.solidjs.com/docs/latest/api#maparray
|
|
31
31
|
*/
|
|
32
|
-
export declare function mapArray<T, U>(
|
|
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?: {
|
|
33
36
|
fallback?: Accessor<any>;
|
|
34
|
-
}
|
|
37
|
+
}
|
|
38
|
+
): () => U[];
|
|
35
39
|
/**
|
|
36
40
|
* reactively maps arrays by index instead of value - underlying helper for the `<Index>` control flow
|
|
37
41
|
*
|
|
@@ -39,6 +43,10 @@ export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined |
|
|
|
39
43
|
*
|
|
40
44
|
* @description https://www.solidjs.com/docs/latest/api#indexarray
|
|
41
45
|
*/
|
|
42
|
-
export declare function indexArray<T, U>(
|
|
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?: {
|
|
43
50
|
fallback?: Accessor<any>;
|
|
44
|
-
}
|
|
51
|
+
}
|
|
52
|
+
): () => U[];
|
|
@@ -1,20 +1,22 @@
|
|
|
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
|
-
|
|
8
|
+
subscribe(observer: ObservableObserver<T>): {
|
|
9
|
+
unsubscribe(): void;
|
|
10
|
+
};
|
|
11
|
+
[Symbol.observable](): Observable<T>;
|
|
12
12
|
}
|
|
13
|
-
export type ObservableObserver<T> =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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;
|
|
19
|
+
};
|
|
18
20
|
/**
|
|
19
21
|
* creates a simple observable from a signal's accessor to be used with the `from` operator of observable libraries like e.g. rxjs
|
|
20
22
|
* ```typescript
|
|
@@ -26,9 +28,15 @@ export type ObservableObserver<T> = ((v: T) => void) | {
|
|
|
26
28
|
* description https://www.solidjs.com/docs/latest/api#observable
|
|
27
29
|
*/
|
|
28
30
|
export declare function observable<T>(input: Accessor<T>): Observable<T>;
|
|
29
|
-
export declare function from<T>(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export declare function from<T>(
|
|
32
|
+
producer:
|
|
33
|
+
| ((setter: Setter<T | undefined>) => () => void)
|
|
34
|
+
| {
|
|
35
|
+
subscribe: (fn: (v: T) => void) =>
|
|
36
|
+
| (() => void)
|
|
37
|
+
| {
|
|
38
|
+
unsubscribe: () => void;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
): Accessor<T | undefined>;
|
|
34
42
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
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(
|
|
7
|
+
export declare function requestCallback(
|
|
8
|
+
fn: () => void,
|
|
9
|
+
options?: {
|
|
8
10
|
timeout: number;
|
|
9
|
-
}
|
|
11
|
+
}
|
|
12
|
+
): Task;
|
|
10
13
|
export declare function cancelCallback(task: Task): void;
|