solid-js 1.8.7 → 1.8.8
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 +30 -20
- package/dist/dev.js +327 -552
- package/dist/server.js +75 -170
- package/dist/solid.cjs +30 -20
- package/dist/solid.js +285 -479
- 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/jsx-runtime/types/jsx.d.ts +15 -1
- 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 +2 -2
- package/store/dist/dev.cjs +3 -2
- package/store/dist/dev.js +44 -115
- package/store/dist/server.js +8 -19
- package/store/dist/store.cjs +3 -2
- package/store/dist/store.js +41 -106
- 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 -218
- package/types/index.d.ts +10 -75
- package/types/jsx.d.ts +15 -1
- 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 +142 -231
- package/types/render/Suspense.d.ts +5 -5
- package/types/render/component.d.ts +33 -62
- package/types/render/flow.d.ts +31 -43
- package/types/render/hydration.d.ts +13 -13
- package/types/server/index.d.ts +2 -57
- package/types/server/reactive.d.ts +42 -73
- package/types/server/rendering.d.ts +96 -167
- 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 +81 -620
- package/web/dist/server.cjs +7 -2
- package/web/dist/server.js +102 -179
- package/web/dist/storage.js +3 -3
- package/web/dist/web.js +80 -614
- 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
|
@@ -30,64 +30,60 @@ export declare const $TRACK: unique symbol;
|
|
|
30
30
|
export declare const $DEVCOMP: unique symbol;
|
|
31
31
|
export declare var Owner: Owner | null;
|
|
32
32
|
export declare let Transition: TransitionState | null;
|
|
33
|
-
declare let ExternalSourceFactory: ExternalSourceFactory | null;
|
|
34
33
|
/** Object storing callbacks for debugging during development */
|
|
35
34
|
export declare const DevHooks: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
afterUpdate: (() => void) | null;
|
|
36
|
+
afterCreateOwner: ((owner: Owner) => void) | null;
|
|
37
|
+
afterCreateSignal: ((signal: SignalState<any>) => void) | null;
|
|
39
38
|
};
|
|
40
39
|
export type ComputationState = 0 | 1 | 2;
|
|
41
40
|
export interface SourceMapValue {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
value: unknown;
|
|
42
|
+
name?: string;
|
|
43
|
+
graph?: Owner;
|
|
45
44
|
}
|
|
46
45
|
export interface SignalState<T> extends SourceMapValue {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
value: T;
|
|
47
|
+
observers: Computation<any>[] | null;
|
|
48
|
+
observerSlots: number[] | null;
|
|
49
|
+
tValue?: T;
|
|
50
|
+
comparator?: (prev: T, next: T) => boolean;
|
|
52
51
|
}
|
|
53
52
|
export interface Owner {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
owned: Computation<any>[] | null;
|
|
54
|
+
cleanups: (() => void)[] | null;
|
|
55
|
+
owner: Owner | null;
|
|
56
|
+
context: any | null;
|
|
57
|
+
sourceMap?: SourceMapValue[];
|
|
58
|
+
name?: string;
|
|
60
59
|
}
|
|
61
60
|
export interface Computation<Init, Next extends Init = Init> extends Owner {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
fn: EffectFunction<Init, Next>;
|
|
62
|
+
state: ComputationState;
|
|
63
|
+
tState?: ComputationState;
|
|
64
|
+
sources: SignalState<Next>[] | null;
|
|
65
|
+
sourceSlots: number[] | null;
|
|
66
|
+
value?: Init;
|
|
67
|
+
updatedAt: number | null;
|
|
68
|
+
pure: boolean;
|
|
69
|
+
user?: boolean;
|
|
70
|
+
suspense?: SuspenseContextType;
|
|
72
71
|
}
|
|
73
72
|
export interface TransitionState {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
sources: Set<SignalState<any>>;
|
|
74
|
+
effects: Computation<any>[];
|
|
75
|
+
promises: Set<Promise<any>>;
|
|
76
|
+
disposed: Set<Computation<any>>;
|
|
77
|
+
queue: Set<Computation<any>>;
|
|
78
|
+
scheduler?: (fn: () => void) => unknown;
|
|
79
|
+
running: boolean;
|
|
80
|
+
done?: Promise<void>;
|
|
81
|
+
resolve?: () => void;
|
|
83
82
|
}
|
|
84
|
-
type ExternalSourceFactory = <Prev, Next extends Prev = Prev>(
|
|
85
|
-
fn: EffectFunction<Prev, Next>,
|
|
86
|
-
trigger: () => void
|
|
87
|
-
) => ExternalSource;
|
|
83
|
+
type ExternalSourceFactory = <Prev, Next extends Prev = Prev>(fn: EffectFunction<Prev, Next>, trigger: () => void) => ExternalSource;
|
|
88
84
|
export interface ExternalSource {
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
track: EffectFunction<any, any>;
|
|
86
|
+
dispose: () => void;
|
|
91
87
|
}
|
|
92
88
|
export type RootFunction<T> = (dispose: () => void) => T;
|
|
93
89
|
/**
|
|
@@ -102,16 +98,14 @@ export type RootFunction<T> = (dispose: () => void) => T;
|
|
|
102
98
|
export declare function createRoot<T>(fn: RootFunction<T>, detachedOwner?: typeof Owner): T;
|
|
103
99
|
export type Accessor<T> = () => T;
|
|
104
100
|
export type Setter<in out T> = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
: U;
|
|
108
|
-
|
|
109
|
-
<U extends T>(value: Exclude<U, Function>): U;
|
|
110
|
-
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
|
|
101
|
+
<U extends T>(...args: undefined extends T ? [] : [value: (prev: T) => U]): undefined extends T ? undefined : U;
|
|
102
|
+
<U extends T>(value: (prev: T) => U): U;
|
|
103
|
+
<U extends T>(value: Exclude<U, Function>): U;
|
|
104
|
+
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U;
|
|
111
105
|
};
|
|
112
106
|
export type Signal<T> = [get: Accessor<T>, set: Setter<T>];
|
|
113
107
|
export interface SignalOptions<T> extends MemoOptions<T> {
|
|
114
|
-
|
|
108
|
+
internal?: boolean;
|
|
115
109
|
}
|
|
116
110
|
/**
|
|
117
111
|
* Creates a simple reactive state with a getter and setter
|
|
@@ -139,10 +133,11 @@ export interface SignalOptions<T> extends MemoOptions<T> {
|
|
|
139
133
|
export declare function createSignal<T>(): Signal<T | undefined>;
|
|
140
134
|
export declare function createSignal<T>(value: T, options?: SignalOptions<T>): Signal<T>;
|
|
141
135
|
export interface BaseOptions {
|
|
142
|
-
|
|
136
|
+
name?: string;
|
|
143
137
|
}
|
|
144
138
|
export type NoInfer<T extends any> = [T][T extends any ? 0 : never];
|
|
145
|
-
export interface EffectOptions extends BaseOptions {
|
|
139
|
+
export interface EffectOptions extends BaseOptions {
|
|
140
|
+
}
|
|
146
141
|
export type EffectFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
|
|
147
142
|
/**
|
|
148
143
|
* Creates a reactive computation that runs immediately before render, mainly used to write to other reactive primitives
|
|
@@ -159,14 +154,8 @@ export type EffectFunction<Prev, Next extends Prev = Prev> = (v: Prev) => Next;
|
|
|
159
154
|
*
|
|
160
155
|
* @description https://www.solidjs.com/docs/latest/api#createcomputed
|
|
161
156
|
*/
|
|
162
|
-
export declare function createComputed<Next>(
|
|
163
|
-
|
|
164
|
-
): void;
|
|
165
|
-
export declare function createComputed<Next, Init = Next>(
|
|
166
|
-
fn: EffectFunction<Init | Next, Next>,
|
|
167
|
-
value: Init,
|
|
168
|
-
options?: EffectOptions
|
|
169
|
-
): void;
|
|
157
|
+
export declare function createComputed<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
|
|
158
|
+
export declare function createComputed<Next, Init = Next>(fn: EffectFunction<Init | Next, Next>, value: Init, options?: EffectOptions): void;
|
|
170
159
|
/**
|
|
171
160
|
* Creates a reactive computation that runs during the render phase as DOM elements are created and updated but not necessarily connected
|
|
172
161
|
* ```typescript
|
|
@@ -182,14 +171,8 @@ export declare function createComputed<Next, Init = Next>(
|
|
|
182
171
|
*
|
|
183
172
|
* @description https://www.solidjs.com/docs/latest/api#createrendereffect
|
|
184
173
|
*/
|
|
185
|
-
export declare function createRenderEffect<Next>(
|
|
186
|
-
|
|
187
|
-
): void;
|
|
188
|
-
export declare function createRenderEffect<Next, Init = Next>(
|
|
189
|
-
fn: EffectFunction<Init | Next, Next>,
|
|
190
|
-
value: Init,
|
|
191
|
-
options?: EffectOptions
|
|
192
|
-
): void;
|
|
174
|
+
export declare function createRenderEffect<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
|
|
175
|
+
export declare function createRenderEffect<Next, Init = Next>(fn: EffectFunction<Init | Next, Next>, value: Init, options?: EffectOptions): void;
|
|
193
176
|
/**
|
|
194
177
|
* Creates a reactive computation that runs after the render phase
|
|
195
178
|
* ```typescript
|
|
@@ -205,16 +188,10 @@ export declare function createRenderEffect<Next, Init = Next>(
|
|
|
205
188
|
*
|
|
206
189
|
* @description https://www.solidjs.com/docs/latest/api#createeffect
|
|
207
190
|
*/
|
|
208
|
-
export declare function createEffect<Next>(
|
|
209
|
-
|
|
210
|
-
): void;
|
|
211
|
-
export declare function createEffect<Next, Init = Next>(
|
|
212
|
-
fn: EffectFunction<Init | Next, Next>,
|
|
213
|
-
value: Init,
|
|
214
|
-
options?: EffectOptions & {
|
|
191
|
+
export declare function createEffect<Next>(fn: EffectFunction<undefined | NoInfer<Next>, Next>): void;
|
|
192
|
+
export declare function createEffect<Next, Init = Next>(fn: EffectFunction<Init | Next, Next>, value: Init, options?: EffectOptions & {
|
|
215
193
|
render?: boolean;
|
|
216
|
-
|
|
217
|
-
): void;
|
|
194
|
+
}): void;
|
|
218
195
|
/**
|
|
219
196
|
* Creates a reactive computation that runs after the render phase with flexible tracking
|
|
220
197
|
* ```typescript
|
|
@@ -228,16 +205,13 @@ export declare function createEffect<Next, Init = Next>(
|
|
|
228
205
|
*
|
|
229
206
|
* @description https://www.solidjs.com/docs/latest/api#createreaction
|
|
230
207
|
*/
|
|
231
|
-
export declare function createReaction(
|
|
232
|
-
onInvalidate: () => void,
|
|
233
|
-
options?: EffectOptions
|
|
234
|
-
): (tracking: () => void) => void;
|
|
208
|
+
export declare function createReaction(onInvalidate: () => void, options?: EffectOptions): (tracking: () => void) => void;
|
|
235
209
|
export interface Memo<Prev, Next = Prev> extends SignalState<Next>, Computation<Next> {
|
|
236
|
-
|
|
237
|
-
|
|
210
|
+
value: Next;
|
|
211
|
+
tOwned?: Computation<Prev | Next, Next>[];
|
|
238
212
|
}
|
|
239
213
|
export interface MemoOptions<T> extends EffectOptions {
|
|
240
|
-
|
|
214
|
+
equals?: false | ((prev: T, next: T) => boolean);
|
|
241
215
|
}
|
|
242
216
|
/**
|
|
243
217
|
* Creates a readonly derived reactive memoized signal
|
|
@@ -254,84 +228,72 @@ export interface MemoOptions<T> extends EffectOptions {
|
|
|
254
228
|
*
|
|
255
229
|
* @description https://www.solidjs.com/docs/latest/api#creatememo
|
|
256
230
|
*/
|
|
257
|
-
export declare function createMemo<Next extends Prev, Prev = Next>(
|
|
258
|
-
|
|
259
|
-
): Accessor<Next>;
|
|
260
|
-
export declare function createMemo<Next extends Prev, Init = Next, Prev = Next>(
|
|
261
|
-
fn: EffectFunction<Init | Prev, Next>,
|
|
262
|
-
value: Init,
|
|
263
|
-
options?: MemoOptions<Next>
|
|
264
|
-
): Accessor<Next>;
|
|
231
|
+
export declare function createMemo<Next extends Prev, Prev = Next>(fn: EffectFunction<undefined | NoInfer<Prev>, Next>): Accessor<Next>;
|
|
232
|
+
export declare function createMemo<Next extends Prev, Init = Next, Prev = Next>(fn: EffectFunction<Init | Prev, Next>, value: Init, options?: MemoOptions<Next>): Accessor<Next>;
|
|
265
233
|
interface Unresolved {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
234
|
+
state: "unresolved";
|
|
235
|
+
loading: false;
|
|
236
|
+
error: undefined;
|
|
237
|
+
latest: undefined;
|
|
238
|
+
(): undefined;
|
|
271
239
|
}
|
|
272
240
|
interface Pending {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
241
|
+
state: "pending";
|
|
242
|
+
loading: true;
|
|
243
|
+
error: undefined;
|
|
244
|
+
latest: undefined;
|
|
245
|
+
(): undefined;
|
|
278
246
|
}
|
|
279
247
|
interface Ready<T> {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
248
|
+
state: "ready";
|
|
249
|
+
loading: false;
|
|
250
|
+
error: undefined;
|
|
251
|
+
latest: T;
|
|
252
|
+
(): T;
|
|
285
253
|
}
|
|
286
254
|
interface Refreshing<T> {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
255
|
+
state: "refreshing";
|
|
256
|
+
loading: true;
|
|
257
|
+
error: undefined;
|
|
258
|
+
latest: T;
|
|
259
|
+
(): T;
|
|
292
260
|
}
|
|
293
261
|
interface Errored {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
262
|
+
state: "errored";
|
|
263
|
+
loading: false;
|
|
264
|
+
error: any;
|
|
265
|
+
latest: never;
|
|
266
|
+
(): never;
|
|
299
267
|
}
|
|
300
268
|
export type Resource<T> = Unresolved | Pending | Ready<T> | Refreshing<T> | Errored;
|
|
301
269
|
export type InitializedResource<T> = Ready<T> | Refreshing<T> | Errored;
|
|
302
270
|
export type ResourceActions<T, R = unknown> = {
|
|
303
|
-
|
|
304
|
-
|
|
271
|
+
mutate: Setter<T>;
|
|
272
|
+
refetch: (info?: R) => T | Promise<T> | undefined | null;
|
|
305
273
|
};
|
|
306
274
|
export type ResourceSource<S> = S | false | null | undefined | (() => S | false | null | undefined);
|
|
307
|
-
export type ResourceFetcher<S, T, R = unknown> = (
|
|
308
|
-
k: S,
|
|
309
|
-
info: ResourceFetcherInfo<T, R>
|
|
310
|
-
) => T | Promise<T>;
|
|
275
|
+
export type ResourceFetcher<S, T, R = unknown> = (k: S, info: ResourceFetcherInfo<T, R>) => T | Promise<T>;
|
|
311
276
|
export type ResourceFetcherInfo<T, R = unknown> = {
|
|
312
|
-
|
|
313
|
-
|
|
277
|
+
value: T | undefined;
|
|
278
|
+
refetching: R | boolean;
|
|
314
279
|
};
|
|
315
280
|
export type ResourceOptions<T, S = unknown> = {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
value: T | undefined;
|
|
325
|
-
}
|
|
326
|
-
) => void;
|
|
281
|
+
initialValue?: T;
|
|
282
|
+
name?: string;
|
|
283
|
+
deferStream?: boolean;
|
|
284
|
+
ssrLoadFrom?: "initial" | "server";
|
|
285
|
+
storage?: (init: T | undefined) => [Accessor<T | undefined>, Setter<T | undefined>];
|
|
286
|
+
onHydrated?: (k: S | undefined, info: {
|
|
287
|
+
value: T | undefined;
|
|
288
|
+
}) => void;
|
|
327
289
|
};
|
|
328
290
|
export type InitializedResourceOptions<T, S = unknown> = ResourceOptions<T, S> & {
|
|
329
|
-
|
|
291
|
+
initialValue: T;
|
|
330
292
|
};
|
|
331
293
|
export type ResourceReturn<T, R = unknown> = [Resource<T>, ResourceActions<T | undefined, R>];
|
|
332
294
|
export type InitializedResourceReturn<T, R = unknown> = [
|
|
333
|
-
|
|
334
|
-
|
|
295
|
+
InitializedResource<T>,
|
|
296
|
+
ResourceActions<T, R>
|
|
335
297
|
];
|
|
336
298
|
/**
|
|
337
299
|
* Creates a resource that wraps a repeated promise in a reactive pattern:
|
|
@@ -361,28 +323,14 @@ export type InitializedResourceReturn<T, R = unknown> = [
|
|
|
361
323
|
*
|
|
362
324
|
* @description https://www.solidjs.com/docs/latest/api#createresource
|
|
363
325
|
*/
|
|
364
|
-
export declare function createResource<T, R = unknown>(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
):
|
|
368
|
-
export declare function createResource<T, R = unknown>(
|
|
369
|
-
fetcher: ResourceFetcher<true, T, R>,
|
|
370
|
-
options?: ResourceOptions<NoInfer<T>, true>
|
|
371
|
-
): ResourceReturn<T, R>;
|
|
372
|
-
export declare function createResource<T, S, R = unknown>(
|
|
373
|
-
source: ResourceSource<S>,
|
|
374
|
-
fetcher: ResourceFetcher<S, T, R>,
|
|
375
|
-
options: InitializedResourceOptions<NoInfer<T>, S>
|
|
376
|
-
): InitializedResourceReturn<T, R>;
|
|
377
|
-
export declare function createResource<T, S, R = unknown>(
|
|
378
|
-
source: ResourceSource<S>,
|
|
379
|
-
fetcher: ResourceFetcher<S, T, R>,
|
|
380
|
-
options?: ResourceOptions<NoInfer<T>, S>
|
|
381
|
-
): ResourceReturn<T, R>;
|
|
326
|
+
export declare function createResource<T, R = unknown>(fetcher: ResourceFetcher<true, T, R>, options: InitializedResourceOptions<NoInfer<T>, true>): InitializedResourceReturn<T, R>;
|
|
327
|
+
export declare function createResource<T, R = unknown>(fetcher: ResourceFetcher<true, T, R>, options?: ResourceOptions<NoInfer<T>, true>): ResourceReturn<T, R>;
|
|
328
|
+
export declare function createResource<T, S, R = unknown>(source: ResourceSource<S>, fetcher: ResourceFetcher<S, T, R>, options: InitializedResourceOptions<NoInfer<T>, S>): InitializedResourceReturn<T, R>;
|
|
329
|
+
export declare function createResource<T, S, R = unknown>(source: ResourceSource<S>, fetcher: ResourceFetcher<S, T, R>, options?: ResourceOptions<NoInfer<T>, S>): ResourceReturn<T, R>;
|
|
382
330
|
export interface DeferredOptions<T> {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
331
|
+
equals?: false | ((prev: T, next: T) => boolean);
|
|
332
|
+
name?: string;
|
|
333
|
+
timeoutMs?: number;
|
|
386
334
|
}
|
|
387
335
|
/**
|
|
388
336
|
* Creates a reactive computation that only runs and notifies the reactive context when the browser is idle
|
|
@@ -397,10 +345,7 @@ export interface DeferredOptions<T> {
|
|
|
397
345
|
*
|
|
398
346
|
* @description https://www.solidjs.com/docs/latest/api#createdeferred
|
|
399
347
|
*/
|
|
400
|
-
export declare function createDeferred<T>(
|
|
401
|
-
source: Accessor<T>,
|
|
402
|
-
options?: DeferredOptions<T>
|
|
403
|
-
): Accessor<T>;
|
|
348
|
+
export declare function createDeferred<T>(source: Accessor<T>, options?: DeferredOptions<T>): Accessor<T>;
|
|
404
349
|
export type EqualityCheckerFunction<T, U> = (a: U, b: T) => boolean;
|
|
405
350
|
/**
|
|
406
351
|
* Creates a conditional signal that only notifies subscribers when entering or exiting their key matching the value
|
|
@@ -426,11 +371,7 @@ export type EqualityCheckerFunction<T, U> = (a: U, b: T) => boolean;
|
|
|
426
371
|
*
|
|
427
372
|
* @description https://www.solidjs.com/docs/latest/api#createselector
|
|
428
373
|
*/
|
|
429
|
-
export declare function createSelector<T, U = T>(
|
|
430
|
-
source: Accessor<T>,
|
|
431
|
-
fn?: EqualityCheckerFunction<T, U>,
|
|
432
|
-
options?: BaseOptions
|
|
433
|
-
): (key: U) => boolean;
|
|
374
|
+
export declare function createSelector<T, U = T>(source: Accessor<T>, fn?: EqualityCheckerFunction<T, U>, options?: BaseOptions): (key: U) => boolean;
|
|
434
375
|
/**
|
|
435
376
|
* Holds changes inside the block before the reactive context is updated
|
|
436
377
|
* @param fn wraps the reactive updates that should be batched
|
|
@@ -448,28 +389,15 @@ export declare function batch<T>(fn: Accessor<T>): T;
|
|
|
448
389
|
*/
|
|
449
390
|
export declare function untrack<T>(fn: Accessor<T>): T;
|
|
450
391
|
/** @deprecated */
|
|
451
|
-
export type ReturnTypes<T> = T extends readonly Accessor<unknown>[]
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
export type AccessorArray<T> = [
|
|
459
|
-
...Extract<
|
|
460
|
-
{
|
|
461
|
-
[K in keyof T]: Accessor<T[K]>;
|
|
462
|
-
},
|
|
463
|
-
readonly unknown[]
|
|
464
|
-
>
|
|
465
|
-
];
|
|
466
|
-
export type OnEffectFunction<S, Prev, Next extends Prev = Prev> = (
|
|
467
|
-
input: S,
|
|
468
|
-
prevInput: S | undefined,
|
|
469
|
-
prev: Prev
|
|
470
|
-
) => Next;
|
|
392
|
+
export type ReturnTypes<T> = T extends readonly Accessor<unknown>[] ? {
|
|
393
|
+
[K in keyof T]: T[K] extends Accessor<infer I> ? I : never;
|
|
394
|
+
} : T extends Accessor<infer I> ? I : never;
|
|
395
|
+
export type AccessorArray<T> = [...Extract<{
|
|
396
|
+
[K in keyof T]: Accessor<T[K]>;
|
|
397
|
+
}, readonly unknown[]>];
|
|
398
|
+
export type OnEffectFunction<S, Prev, Next extends Prev = Prev> = (input: S, prevInput: S | undefined, prev: Prev) => Next;
|
|
471
399
|
export interface OnOptions {
|
|
472
|
-
|
|
400
|
+
defer?: boolean;
|
|
473
401
|
}
|
|
474
402
|
/**
|
|
475
403
|
* on - make dependencies of a computation explicit
|
|
@@ -497,22 +425,12 @@ export interface OnOptions {
|
|
|
497
425
|
*
|
|
498
426
|
* @description https://www.solidjs.com/docs/latest/api#on
|
|
499
427
|
*/
|
|
500
|
-
export declare function on<S, Next extends Prev, Prev = Next>(
|
|
501
|
-
deps: AccessorArray<S> | Accessor<S>,
|
|
502
|
-
fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>,
|
|
503
|
-
options?: OnOptions & {
|
|
428
|
+
export declare function on<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options?: OnOptions & {
|
|
504
429
|
defer?: false;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>,
|
|
510
|
-
options:
|
|
511
|
-
| OnOptions
|
|
512
|
-
| {
|
|
513
|
-
defer: true;
|
|
514
|
-
}
|
|
515
|
-
): EffectFunction<undefined | NoInfer<Next>>;
|
|
430
|
+
}): EffectFunction<undefined | NoInfer<Next>, NoInfer<Next>>;
|
|
431
|
+
export declare function on<S, Next extends Prev, Prev = Next>(deps: AccessorArray<S> | Accessor<S>, fn: OnEffectFunction<S, undefined | NoInfer<Prev>, Next>, options: OnOptions | {
|
|
432
|
+
defer: true;
|
|
433
|
+
}): EffectFunction<undefined | NoInfer<Next>>;
|
|
516
434
|
/**
|
|
517
435
|
* onMount - run an effect only after initial render on mount
|
|
518
436
|
* @param fn an effect that should run only once on mount
|
|
@@ -564,19 +482,19 @@ export type Transition = [Accessor<boolean>, (fn: () => void) => Promise<void>];
|
|
|
564
482
|
export declare function useTransition(): Transition;
|
|
565
483
|
export declare function resumeEffects(e: Computation<any>[]): void;
|
|
566
484
|
export interface DevComponent<T> extends Memo<unknown> {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
485
|
+
props: T;
|
|
486
|
+
name: string;
|
|
487
|
+
component: (props: T) => unknown;
|
|
570
488
|
}
|
|
571
489
|
export declare function devComponent<P, V>(Comp: (props: P) => V, props: P): V;
|
|
572
490
|
export declare function registerGraph(value: SourceMapValue): void;
|
|
573
491
|
export type ContextProviderComponent<T> = FlowComponent<{
|
|
574
|
-
|
|
492
|
+
value: T;
|
|
575
493
|
}>;
|
|
576
494
|
export interface Context<T> {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
495
|
+
id: symbol;
|
|
496
|
+
Provider: ContextProviderComponent<T>;
|
|
497
|
+
defaultValue: T;
|
|
580
498
|
}
|
|
581
499
|
/**
|
|
582
500
|
* Creates a Context to handle a state scoped for the children of a component
|
|
@@ -597,10 +515,7 @@ export interface Context<T> {
|
|
|
597
515
|
*
|
|
598
516
|
* @description https://www.solidjs.com/docs/latest/api#createcontext
|
|
599
517
|
*/
|
|
600
|
-
export declare function createContext<T>(
|
|
601
|
-
defaultValue?: undefined,
|
|
602
|
-
options?: EffectOptions
|
|
603
|
-
): Context<T | undefined>;
|
|
518
|
+
export declare function createContext<T>(defaultValue?: undefined, options?: EffectOptions): Context<T | undefined>;
|
|
604
519
|
export declare function createContext<T>(defaultValue: T, options?: EffectOptions): Context<T>;
|
|
605
520
|
/**
|
|
606
521
|
* use a context to receive a scoped state from a parent's Context.Provider
|
|
@@ -614,7 +529,7 @@ export declare function useContext<T>(context: Context<T>): T;
|
|
|
614
529
|
export type ResolvedJSXElement = Exclude<JSX.Element, JSX.ArrayElement>;
|
|
615
530
|
export type ResolvedChildren = ResolvedJSXElement | ResolvedJSXElement[];
|
|
616
531
|
export type ChildrenReturn = Accessor<ResolvedChildren> & {
|
|
617
|
-
|
|
532
|
+
toArray: () => ResolvedJSXElement[];
|
|
618
533
|
};
|
|
619
534
|
/**
|
|
620
535
|
* Resolves child elements to help interact with children
|
|
@@ -626,26 +541,22 @@ export type ChildrenReturn = Accessor<ResolvedChildren> & {
|
|
|
626
541
|
*/
|
|
627
542
|
export declare function children(fn: Accessor<JSX.Element>): ChildrenReturn;
|
|
628
543
|
export type SuspenseContextType = {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
544
|
+
increment?: () => void;
|
|
545
|
+
decrement?: () => void;
|
|
546
|
+
inFallback?: () => boolean;
|
|
547
|
+
effects?: Computation<any>[];
|
|
548
|
+
resolved?: boolean;
|
|
634
549
|
};
|
|
635
550
|
type SuspenseContext = Context<SuspenseContextType | undefined> & {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
551
|
+
active?(): boolean;
|
|
552
|
+
increment?(): void;
|
|
553
|
+
decrement?(): void;
|
|
639
554
|
};
|
|
640
555
|
declare let SuspenseContext: SuspenseContext;
|
|
641
556
|
export declare function getSuspenseContext(): SuspenseContext;
|
|
642
|
-
export declare function enableExternalSource(factory: ExternalSourceFactory): void;
|
|
557
|
+
export declare function enableExternalSource(factory: ExternalSourceFactory, untrack?: <V>(fn: () => V) => V): void;
|
|
643
558
|
export declare function readSignal(this: SignalState<any> | Memo<any>): any;
|
|
644
|
-
export declare function writeSignal(
|
|
645
|
-
node: SignalState<any> | Memo<any>,
|
|
646
|
-
value: any,
|
|
647
|
-
isComp?: boolean
|
|
648
|
-
): any;
|
|
559
|
+
export declare function writeSignal(node: SignalState<any> | Memo<any>, value: any, isComp?: boolean): any;
|
|
649
560
|
/**
|
|
650
561
|
* @deprecated since version 1.7.0 and will be removed in next major - use catchError instead
|
|
651
562
|
* onError - run an effect whenever an error is thrown within the context of the child scopes
|
|
@@ -5,9 +5,9 @@ import type { JSX } from "../jsx.js";
|
|
|
5
5
|
* @description https://www.solidjs.com/docs/latest/api#suspenselist-experimental
|
|
6
6
|
*/
|
|
7
7
|
export declare function SuspenseList(props: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
revealOrder: "forwards" | "backwards" | "together";
|
|
10
|
+
tail?: "collapsed" | "hidden";
|
|
11
11
|
}): JSX.Element;
|
|
12
12
|
/**
|
|
13
13
|
* tracks all resources inside a component and renders a fallback until they are all resolved
|
|
@@ -21,6 +21,6 @@ export declare function SuspenseList(props: {
|
|
|
21
21
|
* @description https://www.solidjs.com/docs/latest/api#suspense
|
|
22
22
|
*/
|
|
23
23
|
export declare function Suspense(props: {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
fallback?: JSX.Element;
|
|
25
|
+
children: JSX.Element;
|
|
26
26
|
}): JSX.Element;
|