solid-js 2.0.0-beta.11 → 2.0.0-beta.13
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/CHEATSHEET.md +23 -11
- package/dist/dev.cjs +10 -5
- package/dist/dev.js +10 -5
- package/dist/server.cjs +56 -16
- package/dist/server.js +58 -15
- package/dist/solid.cjs +9 -4
- package/dist/solid.js +9 -4
- package/package.json +2 -2
- package/types/client/flow.d.ts +78 -16
- package/types/client/hydration.d.ts +6 -6
- package/types/server/flow.d.ts +59 -6
- package/types/server/signals.d.ts +15 -6
- package/types-cjs/client/flow.d.cts +78 -16
- package/types-cjs/client/hydration.d.cts +6 -6
- package/types-cjs/server/flow.d.cts +59 -6
- package/types-cjs/server/signals.d.cts +15 -6
|
@@ -3,16 +3,29 @@ import type { Element as SolidElement } from "../types.cjs";
|
|
|
3
3
|
export type { RevealOrder };
|
|
4
4
|
type NonZeroParams<T extends (...args: any[]) => any> = Parameters<T>["length"] extends 0 ? never : T;
|
|
5
5
|
type ConditionalRenderCallback<T> = (item: Accessor<NonNullable<T>>) => SolidElement;
|
|
6
|
+
type KeyedConditionalRenderCallback<T> = (item: NonNullable<T>) => SolidElement;
|
|
6
7
|
type ConditionalRenderChildren<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>;
|
|
8
|
+
type KeyedConditionalRenderChildren<T, F extends KeyedConditionalRenderCallback<T> = KeyedConditionalRenderCallback<T>> = SolidElement | NonZeroParams<F>;
|
|
7
9
|
/**
|
|
8
10
|
* Creates a list of elements from a list
|
|
9
|
-
*
|
|
10
11
|
* @description https://docs.solidjs.com/reference/components/for
|
|
11
12
|
*/
|
|
12
13
|
export declare function For<T extends readonly any[], U extends SolidElement>(props: {
|
|
13
14
|
each: T | undefined | null | false;
|
|
14
15
|
fallback?: SolidElement;
|
|
15
|
-
keyed?:
|
|
16
|
+
keyed?: true;
|
|
17
|
+
children: (item: T[number], index: Accessor<number>) => U;
|
|
18
|
+
}): SolidElement;
|
|
19
|
+
export declare function For<T extends readonly any[], U extends SolidElement>(props: {
|
|
20
|
+
each: T | undefined | null | false;
|
|
21
|
+
fallback?: SolidElement;
|
|
22
|
+
keyed: false;
|
|
23
|
+
children: (item: Accessor<T[number]>, index: number) => U;
|
|
24
|
+
}): SolidElement;
|
|
25
|
+
export declare function For<T extends readonly any[], U extends SolidElement>(props: {
|
|
26
|
+
each: T | undefined | null | false;
|
|
27
|
+
fallback?: SolidElement;
|
|
28
|
+
keyed: (item: T[number]) => any;
|
|
16
29
|
children: (item: Accessor<T[number]>, index: Accessor<number>) => U;
|
|
17
30
|
}): SolidElement;
|
|
18
31
|
/**
|
|
@@ -30,11 +43,29 @@ export declare function Repeat<T extends SolidElement>(props: {
|
|
|
30
43
|
* Conditionally render its children or an optional fallback component
|
|
31
44
|
* @description https://docs.solidjs.com/reference/components/show
|
|
32
45
|
*/
|
|
46
|
+
export declare function Show<T>(props: {
|
|
47
|
+
when: T | undefined | null | false;
|
|
48
|
+
keyed: true;
|
|
49
|
+
fallback?: SolidElement;
|
|
50
|
+
children: SolidElement;
|
|
51
|
+
}): SolidElement;
|
|
52
|
+
export declare function Show<T, F extends KeyedConditionalRenderCallback<T>>(props: {
|
|
53
|
+
when: T | undefined | null | false;
|
|
54
|
+
keyed: true;
|
|
55
|
+
fallback?: SolidElement;
|
|
56
|
+
children: NonZeroParams<F>;
|
|
57
|
+
}): SolidElement;
|
|
58
|
+
export declare function Show<T>(props: {
|
|
59
|
+
when: T | undefined | null | false;
|
|
60
|
+
keyed?: false;
|
|
61
|
+
fallback?: SolidElement;
|
|
62
|
+
children: SolidElement;
|
|
63
|
+
}): SolidElement;
|
|
33
64
|
export declare function Show<T, F extends ConditionalRenderCallback<T>>(props: {
|
|
34
65
|
when: T | undefined | null | false;
|
|
35
|
-
keyed?:
|
|
66
|
+
keyed?: false;
|
|
36
67
|
fallback?: SolidElement;
|
|
37
|
-
children:
|
|
68
|
+
children: NonZeroParams<F>;
|
|
38
69
|
}): SolidElement;
|
|
39
70
|
/**
|
|
40
71
|
* Switches between content based on mutually exclusive conditions
|
|
@@ -46,20 +77,42 @@ export declare function Switch(props: {
|
|
|
46
77
|
}): SolidElement;
|
|
47
78
|
export type MatchProps<T, F extends ConditionalRenderCallback<T> = ConditionalRenderCallback<T>> = {
|
|
48
79
|
when: T | undefined | null | false;
|
|
49
|
-
keyed?:
|
|
80
|
+
keyed?: false;
|
|
50
81
|
children: ConditionalRenderChildren<T, F>;
|
|
51
82
|
};
|
|
83
|
+
export type KeyedMatchProps<T, F extends KeyedConditionalRenderCallback<T> = KeyedConditionalRenderCallback<T>> = {
|
|
84
|
+
when: T | undefined | null | false;
|
|
85
|
+
keyed: true;
|
|
86
|
+
children: KeyedConditionalRenderChildren<T, F>;
|
|
87
|
+
};
|
|
88
|
+
export type AnyMatchProps<T> = MatchProps<T> | KeyedMatchProps<T> | {
|
|
89
|
+
when: T | undefined | null | false;
|
|
90
|
+
keyed?: boolean;
|
|
91
|
+
children: SolidElement;
|
|
92
|
+
};
|
|
52
93
|
/**
|
|
53
94
|
* Selects a content based on condition when inside a `<Switch>` control flow
|
|
54
95
|
* @description https://docs.solidjs.com/reference/components/switch-and-match
|
|
55
96
|
*/
|
|
97
|
+
export declare function Match<T>(props: {
|
|
98
|
+
when: T | undefined | null | false;
|
|
99
|
+
keyed: true;
|
|
100
|
+
children: SolidElement;
|
|
101
|
+
}): SolidElement;
|
|
102
|
+
export declare function Match<T, F extends KeyedConditionalRenderCallback<T>>(props: KeyedMatchProps<T, F>): SolidElement;
|
|
103
|
+
export declare function Match<T>(props: {
|
|
104
|
+
when: T | undefined | null | false;
|
|
105
|
+
keyed?: false;
|
|
106
|
+
children: SolidElement;
|
|
107
|
+
}): SolidElement;
|
|
56
108
|
export declare function Match<T, F extends ConditionalRenderCallback<T>>(props: MatchProps<T, F>): SolidElement;
|
|
109
|
+
export declare function Match<T>(props: AnyMatchProps<T>): SolidElement;
|
|
57
110
|
/**
|
|
58
111
|
* Catches uncaught errors inside components and renders a fallback content
|
|
59
112
|
* @description https://docs.solidjs.com/reference/components/error-boundary
|
|
60
113
|
*/
|
|
61
114
|
export declare function Errored(props: {
|
|
62
|
-
fallback: SolidElement | ((err: any, reset: () => void) => SolidElement);
|
|
115
|
+
fallback: SolidElement | ((err: () => any, reset: () => void) => SolidElement);
|
|
63
116
|
children: SolidElement;
|
|
64
117
|
}): SolidElement;
|
|
65
118
|
/**
|
|
@@ -2,11 +2,11 @@ import { $REFRESH } from "@solidjs/signals";
|
|
|
2
2
|
export { $REFRESH };
|
|
3
3
|
export { NotReadyError, NoOwnerError, ContextNotFoundError, isEqual, isWrappable, SUPPORTS_PROXY, enableExternalSource, enforceLoadingBoundary } from "@solidjs/signals";
|
|
4
4
|
export { flatten } from "@solidjs/signals";
|
|
5
|
-
export { snapshot,
|
|
5
|
+
export { snapshot, omit, storePath, $PROXY, $TRACK } from "@solidjs/signals";
|
|
6
6
|
import type { Accessor as SignalAccessor, Refreshable } from "@solidjs/signals";
|
|
7
7
|
export type SourceAccessor<T> = Refreshable<SignalAccessor<T>>;
|
|
8
8
|
export type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, ExternalSource, ExternalSourceConfig, ExternalSourceFactory, MemoOptions, NoInfer, SignalOptions, Setter, Signal, Owner, Refreshable, Maybe, Store, StoreSetter, StoreNode, NotWrappable, SolidStore, Merge, Omit, Context, ContextRecord, IQueue, StorePathRange, ArrayFilterFn, CustomPartial, Part, PathSetter } from "@solidjs/signals";
|
|
9
|
-
import type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, MemoOptions, SignalOptions, Signal, Owner, Store, StoreSetter, Context } from "@solidjs/signals";
|
|
9
|
+
import type { Accessor, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, MemoOptions, SignalOptions, Signal, Merge, Owner, Store, StoreSetter, Context } from "@solidjs/signals";
|
|
10
10
|
import { sharedConfig, NoHydrateContext } from "./shared.cjs";
|
|
11
11
|
type Disposable = () => void;
|
|
12
12
|
export declare function getNextChildId(owner: Owner): string;
|
|
@@ -90,8 +90,17 @@ export declare const createOptimisticStore: typeof createStore;
|
|
|
90
90
|
export declare function createProjection<T extends object>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue: Partial<T>, options?: ServerSsrOptions): Store<T>;
|
|
91
91
|
export declare function reconcile<T extends U, U extends object>(value: T): (state: U) => T;
|
|
92
92
|
export declare function deep<T extends object>(store: Store<T>): Store<T>;
|
|
93
|
-
export declare function
|
|
94
|
-
|
|
93
|
+
export declare function merge<T extends unknown[]>(...sources: T): Merge<T>;
|
|
94
|
+
export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: T, i: Accessor<number>) => U, options?: {
|
|
95
|
+
keyed?: true;
|
|
96
|
+
fallback?: Accessor<any>;
|
|
97
|
+
}): () => U[];
|
|
98
|
+
export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: Accessor<T>, i: number) => U, options: {
|
|
99
|
+
keyed: false;
|
|
100
|
+
fallback?: Accessor<any>;
|
|
101
|
+
}): () => U[];
|
|
102
|
+
export declare function mapArray<T, U>(list: Accessor<readonly T[] | undefined | null | false>, mapFn: (v: Accessor<T>, i: Accessor<number>) => U, options: {
|
|
103
|
+
keyed: (item: T) => any;
|
|
95
104
|
fallback?: Accessor<any>;
|
|
96
105
|
}): () => U[];
|
|
97
106
|
export declare function repeat<T>(count: Accessor<number>, mapFn: (i: number) => T, options?: {
|
|
@@ -102,7 +111,7 @@ declare const ErrorContext: Context<((err: any) => void) | null>;
|
|
|
102
111
|
export { ErrorContext };
|
|
103
112
|
export declare function runWithBoundaryErrorContext<T>(owner: Owner, render: () => T, onError: (err: any, parentHandler: ((err: any) => void) | null) => void, context?: NonNullable<typeof sharedConfig.context>, boundaryId?: string): T;
|
|
104
113
|
export { NoHydrateContext };
|
|
105
|
-
export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown
|
|
114
|
+
export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: Accessor<unknown>, reset: () => void) => U): () => unknown;
|
|
106
115
|
export declare function createLoadingBoundary(fn: () => any, fallback: () => any, options?: {
|
|
107
116
|
on?: () => any;
|
|
108
117
|
}): () => unknown;
|
|
@@ -114,7 +123,7 @@ export declare function createRevealOrder<T>(fn: () => T, _options?: {
|
|
|
114
123
|
export declare function untrack<T>(fn: () => T): T;
|
|
115
124
|
export declare function flush(): void;
|
|
116
125
|
export declare function resolve<T>(fn: () => T): Promise<T>;
|
|
117
|
-
export declare function isPending(fn: () => any,
|
|
126
|
+
export declare function isPending(fn: () => any, loading?: boolean): boolean;
|
|
118
127
|
export declare function latest<T>(fn: () => T): T;
|
|
119
128
|
export declare function isRefreshing(): boolean;
|
|
120
129
|
export declare function refresh<T>(_target: Refreshable<T>): void;
|