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.
@@ -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
- 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;
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
- count: number;
35
- fallback?: JSX.Element;
36
- children: ((index: number) => T) | T;
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
- when: T | undefined | null | false;
44
- keyed?: boolean;
45
- fallback?: JSX.Element;
46
- children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
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
- fallback?: JSX.Element;
64
- children: JSX.Element;
64
+ fallback?: JSX.Element;
65
+ children: JSX.Element;
65
66
  }): JSX.Element;
66
67
  export type MatchProps<T> = {
67
- when: T | undefined | null | false;
68
- keyed?: boolean;
69
- children: JSX.Element | ((item: Accessor<NonNullable<T>>) => JSX.Element);
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
- fallback: JSX.Element | ((err: any, reset: () => void) => JSX.Element);
98
- children: JSX.Element;
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
- fallback?: JSX.Element;
113
- children: JSX.Element;
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
- context?: HydrationContext;
7
- resources?: {
8
- [key: string]: any;
9
- };
10
- load?: (id: string) => Promise<any> | any;
11
- has?: (id: string) => boolean;
12
- gather?: (key: string) => void;
13
- registry?: Map<string, Element>;
14
- done?: boolean;
15
- count?: number;
16
- getContextId(): string;
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
- interface SymbolConstructor {
4
- readonly observable: symbol;
5
- }
3
+ interface SymbolConstructor {
4
+ readonly observable: symbol;
5
+ }
6
6
  }
7
7
  interface Observable<T> {
8
- subscribe(observer: ObservableObserver<T>): {
9
- unsubscribe(): void;
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
- | ((setter: Setter<T>) => () => void)
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
- $PROXY,
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
- readonly hooks: {};
71
- readonly registerGraph: typeof registerGraph;
72
- }
73
- | undefined;
15
+ export declare const DEV: {
16
+ readonly hooks: {};
17
+ readonly registerGraph: typeof registerGraph;
18
+ } | undefined;
74
19
  declare global {
75
- var Solid$$: boolean;
20
+ var Solid$$: boolean;
76
21
  }