solid-js 2.0.0-experimental.3 → 2.0.0-experimental.5
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 +18 -33
- package/dist/dev.js +96 -244
- package/dist/server.cjs +379 -659
- package/dist/server.js +327 -736
- package/dist/solid.cjs +18 -33
- package/dist/solid.js +74 -214
- package/package.json +2 -2
- package/types/client/component.d.ts +11 -22
- package/types/client/core.d.ts +8 -11
- package/types/client/flow.d.ts +26 -21
- package/types/client/hydration.d.ts +12 -16
- package/types/client/observable.d.ts +16 -22
- package/types/index.d.ts +10 -65
- package/types/jsx.d.ts +1346 -998
- package/types/server/index.d.ts +8 -58
- package/types/server/reactive.d.ts +22 -122
- package/types/server/rendering.d.ts +49 -206
- package/types/server/signals.d.ts +28 -0
- package/types/server/store.d.ts +4 -1
package/types/client/flow.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Accessor } from "@solidjs/signals";
|
|
1
|
+
import type { Accessor, BoundaryMode } from "@solidjs/signals";
|
|
2
2
|
import type { JSX } from "../jsx.js";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a list of elements from a list
|
|
@@ -13,10 +13,10 @@ import type { JSX } from "../jsx.js";
|
|
|
13
13
|
* @description https://docs.solidjs.com/reference/components/for
|
|
14
14
|
*/
|
|
15
15
|
export declare function For<T extends readonly any[], U extends JSX.Element>(props: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
each: T | undefined | null | false;
|
|
17
|
+
fallback?: JSX.Element;
|
|
18
|
+
keyed?: boolean | ((item: T) => any);
|
|
19
|
+
children: (item: Accessor<T[number]>, index: Accessor<number>) => U;
|
|
20
20
|
}): JSX.Element;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a list elements from a count
|
|
@@ -31,19 +31,20 @@ export declare function For<T extends readonly any[], U extends JSX.Element>(pro
|
|
|
31
31
|
* @description https://docs.solidjs.com/reference/components/repeat
|
|
32
32
|
*/
|
|
33
33
|
export declare function Repeat<T extends JSX.Element>(props: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
count: number;
|
|
35
|
+
from?: number | undefined;
|
|
36
|
+
fallback?: JSX.Element;
|
|
37
|
+
children: ((index: number) => T) | T;
|
|
37
38
|
}): JSX.Element;
|
|
38
39
|
/**
|
|
39
40
|
* Conditionally render its children or an optional fallback component
|
|
40
41
|
* @description https://docs.solidjs.com/reference/components/show
|
|
41
42
|
*/
|
|
42
43
|
export declare function Show<T>(props: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
when: T | undefined | null | false;
|
|
45
|
+
keyed?: boolean;
|
|
46
|
+
fallback?: JSX.Element;
|
|
47
|
+
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
|
|
47
48
|
}): JSX.Element;
|
|
48
49
|
/**
|
|
49
50
|
* Switches between content based on mutually exclusive conditions
|
|
@@ -60,13 +61,13 @@ export declare function Show<T>(props: {
|
|
|
60
61
|
* @description https://docs.solidjs.com/reference/components/switch-and-match
|
|
61
62
|
*/
|
|
62
63
|
export declare function Switch(props: {
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
fallback?: JSX.Element;
|
|
65
|
+
children: JSX.Element;
|
|
65
66
|
}): JSX.Element;
|
|
66
67
|
export type MatchProps<T> = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
when: T | undefined | null | false;
|
|
69
|
+
keyed?: boolean;
|
|
70
|
+
children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
|
|
70
71
|
};
|
|
71
72
|
/**
|
|
72
73
|
* Selects a content based on condition when inside a `<Switch>` control flow
|
|
@@ -94,8 +95,8 @@ export declare function Match<T>(props: MatchProps<T>): JSX.Element;
|
|
|
94
95
|
* @description https://docs.solidjs.com/reference/components/error-boundary
|
|
95
96
|
*/
|
|
96
97
|
export declare function ErrorBoundary(props: {
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
|
|
99
|
+
children: JSX.Element;
|
|
99
100
|
}): JSX.Element;
|
|
100
101
|
/**
|
|
101
102
|
* Tracks all resources inside a component and renders a fallback until they are all resolved
|
|
@@ -109,6 +110,10 @@ export declare function ErrorBoundary(props: {
|
|
|
109
110
|
* @description https://docs.solidjs.com/reference/components/suspense
|
|
110
111
|
*/
|
|
111
112
|
export declare function Suspense(props: {
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
fallback?: JSX.Element;
|
|
114
|
+
children: JSX.Element;
|
|
115
|
+
}): JSX.Element;
|
|
116
|
+
export declare function Boundary(props: {
|
|
117
|
+
mode: BoundaryMode;
|
|
118
|
+
children: JSX.Element;
|
|
114
119
|
}): JSX.Element;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
export type HydrationContext = {
|
|
2
|
-
id: string;
|
|
3
|
-
count: number;
|
|
4
|
-
};
|
|
1
|
+
export type HydrationContext = {};
|
|
5
2
|
type SharedConfig = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getNextContextId(): string;
|
|
3
|
+
context?: HydrationContext;
|
|
4
|
+
resources?: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
load?: (id: string) => Promise<any> | any;
|
|
8
|
+
has?: (id: string) => boolean;
|
|
9
|
+
gather?: (key: string) => void;
|
|
10
|
+
registry?: Map<string, Element>;
|
|
11
|
+
done?: boolean;
|
|
12
|
+
count?: number;
|
|
13
|
+
getNextContextId(): string;
|
|
18
14
|
};
|
|
19
15
|
export declare const sharedConfig: SharedConfig;
|
|
20
16
|
export declare function setHydrateContext(context?: HydrationContext): void;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { Accessor, Setter } from "@solidjs/signals";
|
|
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,11 @@ export type ObservableObserver<T> =
|
|
|
28
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
|
-
type Producer<T> =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
subscribe: (fn: (v: T) => void) =>
|
|
35
|
-
| (() => void)
|
|
36
|
-
| {
|
|
37
|
-
unsubscribe: () => void;
|
|
38
|
-
};
|
|
29
|
+
type Producer<T> = ((setter: Setter<T>) => () => void) | {
|
|
30
|
+
subscribe: (fn: (v: T) => void) => (() => void) | {
|
|
31
|
+
unsubscribe: () => void;
|
|
39
32
|
};
|
|
33
|
+
};
|
|
40
34
|
export declare function from<T>(producer: Producer<T>, initalValue: T): Accessor<T>;
|
|
41
35
|
export declare function from<T>(producer: Producer<T | undefined>): Accessor<T | undefined>;
|
|
42
36
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,76 +1,21 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
$TRACK,
|
|
4
|
-
$RAW,
|
|
5
|
-
catchError,
|
|
6
|
-
createAsync,
|
|
7
|
-
createEffect,
|
|
8
|
-
createMemo,
|
|
9
|
-
createProjection,
|
|
10
|
-
createRenderEffect,
|
|
11
|
-
createRoot,
|
|
12
|
-
createSignal,
|
|
13
|
-
createStore,
|
|
14
|
-
flatten,
|
|
15
|
-
flushSync,
|
|
16
|
-
getObserver,
|
|
17
|
-
getOwner,
|
|
18
|
-
isEqual,
|
|
19
|
-
isPending,
|
|
20
|
-
isWrappable,
|
|
21
|
-
latest,
|
|
22
|
-
mapArray,
|
|
23
|
-
merge,
|
|
24
|
-
omit,
|
|
25
|
-
onCleanup,
|
|
26
|
-
reconcile,
|
|
27
|
-
repeat,
|
|
28
|
-
resolve,
|
|
29
|
-
runWithObserver,
|
|
30
|
-
runWithOwner,
|
|
31
|
-
untrack,
|
|
32
|
-
unwrap
|
|
33
|
-
} from "@solidjs/signals";
|
|
34
|
-
export type {
|
|
35
|
-
Accessor,
|
|
36
|
-
ComputeFunction,
|
|
37
|
-
EffectFunction,
|
|
38
|
-
EffectOptions,
|
|
39
|
-
Merge,
|
|
40
|
-
NoInfer,
|
|
41
|
-
NotWrappable,
|
|
42
|
-
Omit,
|
|
43
|
-
Owner,
|
|
44
|
-
Signal,
|
|
45
|
-
SignalOptions,
|
|
46
|
-
Setter,
|
|
47
|
-
Store,
|
|
48
|
-
SolidStore,
|
|
49
|
-
StoreNode,
|
|
50
|
-
StoreSetter
|
|
51
|
-
} from "@solidjs/signals";
|
|
1
|
+
export { $PROXY, $TRACK, $RAW, createAsync, createEffect, createMemo, createProjection, createRenderEffect, createRoot, createSignal, createStore, flatten, flushSync, getObserver, getOwner, isEqual, isPending, isWrappable, latest, mapArray, merge, omit, onCleanup, reconcile, repeat, resolve, runWithObserver, runWithOwner, tryCatch, untrack, unwrap } from "@solidjs/signals";
|
|
2
|
+
export type { Accessor, BoundaryMode, ComputeFunction, EffectFunction, EffectOptions, Merge, NoInfer, NotWrappable, Omit, Owner, Signal, SignalOptions, Setter, Store, SolidStore, StoreNode, StoreSetter, TryCatchResult } from "@solidjs/signals";
|
|
52
3
|
export { $DEVCOMP, children, createContext, onMount, useContext } from "./client/core.js";
|
|
53
|
-
export type {
|
|
54
|
-
ChildrenReturn,
|
|
55
|
-
Context,
|
|
56
|
-
ContextProviderComponent,
|
|
57
|
-
ResolvedChildren,
|
|
58
|
-
ResolvedJSXElement
|
|
59
|
-
} from "./client/core.js";
|
|
4
|
+
export type { ChildrenReturn, Context, ContextProviderComponent, ResolvedChildren, ResolvedJSXElement } from "./client/core.js";
|
|
60
5
|
export * from "./client/observable.js";
|
|
61
6
|
export * from "./client/component.js";
|
|
62
7
|
export * from "./client/flow.js";
|
|
63
8
|
export { sharedConfig } from "./client/hydration.js";
|
|
9
|
+
export declare function ssrHandleError(): void;
|
|
10
|
+
export declare function ssrRunInScope(): void;
|
|
64
11
|
import type { JSX } from "./jsx.js";
|
|
65
12
|
type JSXElement = JSX.Element;
|
|
66
13
|
export type { JSXElement, JSX };
|
|
67
14
|
import { registerGraph } from "./client/core.js";
|
|
68
|
-
export declare const DEV:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
| undefined;
|
|
15
|
+
export declare const DEV: {
|
|
16
|
+
readonly hooks: {};
|
|
17
|
+
readonly registerGraph: typeof registerGraph;
|
|
18
|
+
} | undefined;
|
|
74
19
|
declare global {
|
|
75
|
-
|
|
20
|
+
var Solid$$: boolean;
|
|
76
21
|
}
|