@solidjs/web 2.0.0-beta.6 → 2.0.0-beta.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 +133 -63
- package/dist/dev.js +131 -65
- package/dist/server.cjs +94 -85
- package/dist/server.js +94 -85
- package/dist/web.cjs +123 -57
- package/dist/web.js +121 -59
- package/package.json +72 -30
- package/storage/package.json +8 -3
- package/storage/types/src/index.d.ts +22 -8
- package/storage/types-cjs/index.d.cts +2 -0
- package/storage/types-cjs/package.json +3 -0
- package/storage/types-cjs/src/client.d.cts +1 -0
- package/storage/types-cjs/src/index.d.cts +60 -0
- package/storage/types-cjs/src/server-mock.d.cts +72 -0
- package/storage/types-cjs/storage/src/index.d.cts +2 -0
- package/types/client.d.ts +27 -12
- package/types/core.d.ts +1 -1
- package/types/index.d.ts +22 -8
- package/types/server.d.ts +30 -13
- package/types-cjs/client.d.cts +102 -0
- package/types-cjs/core.d.cts +3 -0
- package/types-cjs/index.d.cts +60 -0
- package/types-cjs/jsx.d.cts +1 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/server-mock.d.cts +72 -0
- package/types-cjs/server.d.cts +172 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare function renderToString<T>(fn: () => T, options?: {
|
|
2
|
+
nonce?: string;
|
|
3
|
+
renderId?: string;
|
|
4
|
+
noScripts?: boolean;
|
|
5
|
+
plugins?: any[];
|
|
6
|
+
manifest?: Record<string, {
|
|
7
|
+
file: string;
|
|
8
|
+
css?: string[];
|
|
9
|
+
isEntry?: boolean;
|
|
10
|
+
isDynamicEntry?: boolean;
|
|
11
|
+
imports?: string[];
|
|
12
|
+
}>;
|
|
13
|
+
onError?: (err: any) => void;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function renderToStringAsync<T>(fn: () => T, options?: {
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
nonce?: string;
|
|
18
|
+
renderId?: string;
|
|
19
|
+
noScripts?: boolean;
|
|
20
|
+
plugins?: any[];
|
|
21
|
+
manifest?: Record<string, {
|
|
22
|
+
file: string;
|
|
23
|
+
css?: string[];
|
|
24
|
+
isEntry?: boolean;
|
|
25
|
+
isDynamicEntry?: boolean;
|
|
26
|
+
imports?: string[];
|
|
27
|
+
}>;
|
|
28
|
+
onError?: (err: any) => void;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
export declare function renderToStream<T>(fn: () => T, options?: {
|
|
31
|
+
nonce?: string;
|
|
32
|
+
renderId?: string;
|
|
33
|
+
noScripts?: boolean;
|
|
34
|
+
plugins?: any[];
|
|
35
|
+
manifest?: Record<string, {
|
|
36
|
+
file: string;
|
|
37
|
+
css?: string[];
|
|
38
|
+
isEntry?: boolean;
|
|
39
|
+
isDynamicEntry?: boolean;
|
|
40
|
+
imports?: string[];
|
|
41
|
+
}>;
|
|
42
|
+
onCompleteShell?: (info: {
|
|
43
|
+
write: (v: string) => void;
|
|
44
|
+
}) => void;
|
|
45
|
+
onCompleteAll?: (info: {
|
|
46
|
+
write: (v: string) => void;
|
|
47
|
+
}) => void;
|
|
48
|
+
onError?: (err: any) => void;
|
|
49
|
+
}): {
|
|
50
|
+
then: (fn: (html: string) => void) => void;
|
|
51
|
+
pipe: (writable: {
|
|
52
|
+
write: (v: string) => void;
|
|
53
|
+
end: () => void;
|
|
54
|
+
}) => void;
|
|
55
|
+
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
export declare function ssr(template: string[] | string, ...nodes: any[]): {
|
|
58
|
+
t: string;
|
|
59
|
+
};
|
|
60
|
+
export declare function ssrElement(name: string, props: any, children: any, needsId: boolean): {
|
|
61
|
+
t: string;
|
|
62
|
+
};
|
|
63
|
+
export declare function ssrClassList(value: {
|
|
64
|
+
[k: string]: boolean;
|
|
65
|
+
}): string;
|
|
66
|
+
export declare function ssrStyle(value: {
|
|
67
|
+
[k: string]: string;
|
|
68
|
+
}): string;
|
|
69
|
+
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
70
|
+
export declare function ssrHydrationKey(): string;
|
|
71
|
+
export declare function resolveSSRNode(node: any): string;
|
|
72
|
+
export declare function escape(html: string): string;
|
package/types/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from "./jsx.js";
|
|
2
|
-
export const DOMWithState: Record<string, Record<string,
|
|
2
|
+
export const DOMWithState: Record<string, Record<string, 1 | 2>>;
|
|
3
3
|
export const ChildProperties: Set<string>;
|
|
4
4
|
export const DelegatedEvents: Set<string>;
|
|
5
5
|
export const DOMElements: Set<string>;
|
|
@@ -14,8 +14,14 @@ export function render(
|
|
|
14
14
|
init?: JSX.Element,
|
|
15
15
|
options?: { owner?: unknown }
|
|
16
16
|
): () => void;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @param flag
|
|
19
|
+
* - `undefined` — clone the template as-is (uses `cloneNode`).
|
|
20
|
+
* - `1` — use `document.importNode` instead of `cloneNode`.
|
|
21
|
+
* - `2` — the template html is wrapped; the outer tag is stripped at clone time.
|
|
22
|
+
*/
|
|
23
|
+
export function template(html: string, flag?: 1 | 2): () => Element;
|
|
24
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
19
25
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
20
26
|
export function untrack<T>(fn: () => T): T;
|
|
21
27
|
export function insert<T>(
|
|
@@ -27,11 +33,7 @@ export function insert<T>(
|
|
|
27
33
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
28
34
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|
|
29
35
|
export function clearDelegatedEvents(d?: Document): void;
|
|
30
|
-
export function spread<T>(
|
|
31
|
-
node: Element,
|
|
32
|
-
accessor: T,
|
|
33
|
-
skipChildren?: Boolean
|
|
34
|
-
): void;
|
|
36
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
35
37
|
export function assign(
|
|
36
38
|
node: Element,
|
|
37
39
|
props: any,
|
|
@@ -44,7 +46,11 @@ export function setAttributeNS(node: Element, namespace: string, name: string, v
|
|
|
44
46
|
type ClassList =
|
|
45
47
|
| Record<string, boolean>
|
|
46
48
|
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
47
|
-
export function className(
|
|
49
|
+
export function className(
|
|
50
|
+
node: Element,
|
|
51
|
+
value: string | ClassList,
|
|
52
|
+
prev?: string | ClassList
|
|
53
|
+
): void;
|
|
48
54
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
49
55
|
export function setStyleProperty(node: Element, name: string, value: any): void;
|
|
50
56
|
export function addEventListener(
|
|
@@ -61,8 +67,14 @@ export function style(
|
|
|
61
67
|
export function getOwner(): unknown;
|
|
62
68
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
63
69
|
export function dynamicProperty(props: unknown, key: string): unknown;
|
|
64
|
-
export function applyRef(
|
|
65
|
-
|
|
70
|
+
export function applyRef(
|
|
71
|
+
r: ((element: Element) => void) | ((element: Element) => void)[],
|
|
72
|
+
element: Element
|
|
73
|
+
): void;
|
|
74
|
+
export function ref(
|
|
75
|
+
fn: () => ((element: Element) => void) | ((element: Element) => void)[],
|
|
76
|
+
element: Element
|
|
77
|
+
): void;
|
|
66
78
|
|
|
67
79
|
export function hydrate(
|
|
68
80
|
fn: () => JSX.Element,
|
|
@@ -76,7 +88,10 @@ export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
|
76
88
|
export function useAssets(fn: () => JSX.Element): void;
|
|
77
89
|
export function getAssets(): string;
|
|
78
90
|
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
79
|
-
export function generateHydrationScript(options?: {
|
|
91
|
+
export function generateHydrationScript(options?: {
|
|
92
|
+
nonce?: string;
|
|
93
|
+
eventNames?: string[];
|
|
94
|
+
}): string;
|
|
80
95
|
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
81
96
|
export interface RequestEvent {
|
|
82
97
|
request: Request;
|
package/types/core.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { getOwner, runWithOwner, createComponent, createRoot as root, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrRunInScope } from "solid-js";
|
|
2
|
-
export declare const effect: (fn: any, effectFn: any,
|
|
2
|
+
export declare const effect: (fn: any, effectFn: any, options: any) => void;
|
|
3
3
|
export declare const memo: (fn: any, transparent: any) => any;
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { hydrate as hydrateCore
|
|
1
|
+
import { hydrate as hydrateCore } from "./client.js";
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
|
-
export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
-
export { For, Show, Switch, Match, Errored, Loading, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
4
|
export * from "./server-mock.js";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
7
6
|
export declare const isServer: boolean;
|
|
8
7
|
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
9
28
|
export declare const hydrate: typeof hydrateCore;
|
|
10
29
|
/**
|
|
11
30
|
* Renders components somewhere else in the DOM
|
|
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
|
|
|
18
37
|
mount?: Element;
|
|
19
38
|
children: JSX.Element;
|
|
20
39
|
}): Text;
|
|
21
|
-
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
22
|
-
[K in keyof P]: P[K];
|
|
23
|
-
} & {
|
|
24
|
-
component: T | undefined;
|
|
25
|
-
};
|
|
26
40
|
/**
|
|
27
41
|
* Renders an arbitrary component or element with the given props
|
|
28
42
|
*
|
package/types/server.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ export function renderToString<T>(
|
|
|
15
15
|
renderId?: string;
|
|
16
16
|
noScripts?: boolean;
|
|
17
17
|
plugins?: any[];
|
|
18
|
-
manifest?: Record<
|
|
18
|
+
manifest?: Record<
|
|
19
|
+
string,
|
|
20
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
21
|
+
> & { _base?: string };
|
|
19
22
|
onError?: (err: any) => void;
|
|
20
23
|
}
|
|
21
24
|
): string;
|
|
@@ -28,7 +31,10 @@ export function renderToStringAsync<T>(
|
|
|
28
31
|
renderId?: string;
|
|
29
32
|
noScripts?: boolean;
|
|
30
33
|
plugins?: any[];
|
|
31
|
-
manifest?: Record<
|
|
34
|
+
manifest?: Record<
|
|
35
|
+
string,
|
|
36
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
37
|
+
> & { _base?: string };
|
|
32
38
|
onError?: (err: any) => void;
|
|
33
39
|
}
|
|
34
40
|
): Promise<string>;
|
|
@@ -39,7 +45,10 @@ export function renderToStream<T>(
|
|
|
39
45
|
renderId?: string;
|
|
40
46
|
noScripts?: boolean;
|
|
41
47
|
plugins?: any[];
|
|
42
|
-
manifest?: Record<
|
|
48
|
+
manifest?: Record<
|
|
49
|
+
string,
|
|
50
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
51
|
+
> & { _base?: string };
|
|
43
52
|
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
44
53
|
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
45
54
|
onError?: (err: any) => void;
|
|
@@ -65,17 +74,23 @@ export function ssrAttribute(key: string, value: any): string;
|
|
|
65
74
|
export function ssrHydrationKey(): string;
|
|
66
75
|
export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
|
|
67
76
|
export function escape(s: any, attr?: boolean): any;
|
|
68
|
-
export function applyRef(
|
|
77
|
+
export function applyRef(
|
|
78
|
+
r: ((element: any) => void) | ((element: any) => void)[],
|
|
79
|
+
element: any
|
|
80
|
+
): void;
|
|
69
81
|
export function useAssets(fn: () => JSX.Element): void;
|
|
70
82
|
export function getAssets(): string;
|
|
71
83
|
export function getHydrationKey(): string | undefined;
|
|
72
|
-
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void
|
|
84
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
73
85
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
74
86
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
75
87
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
76
88
|
export function getOwner(): unknown;
|
|
77
89
|
export function ssrRunInScope(fn: () => void, owner: unknown): void;
|
|
78
|
-
export function generateHydrationScript(options?: {
|
|
90
|
+
export function generateHydrationScript(options?: {
|
|
91
|
+
nonce?: string;
|
|
92
|
+
eventNames?: string[];
|
|
93
|
+
}): string;
|
|
79
94
|
export declare const RequestContext: unique symbol;
|
|
80
95
|
export interface RequestEvent {
|
|
81
96
|
request: Request;
|
|
@@ -104,11 +119,7 @@ export function insert<T>(
|
|
|
104
119
|
): JSX.Element;
|
|
105
120
|
|
|
106
121
|
/** @deprecated not supported on the server side */
|
|
107
|
-
export function spread<T>(
|
|
108
|
-
node: Element,
|
|
109
|
-
accessor: T,
|
|
110
|
-
skipChildren?: Boolean
|
|
111
|
-
): void;
|
|
122
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
112
123
|
|
|
113
124
|
/** @deprecated not supported on the server side */
|
|
114
125
|
export function delegateEvents(eventNames: string[], d?: Document): void;
|
|
@@ -129,8 +140,14 @@ export function addEventListener(
|
|
|
129
140
|
|
|
130
141
|
/** @deprecated not supported on the server side */
|
|
131
142
|
export function render(code: () => JSX.Element, element: MountableElement): () => void;
|
|
132
|
-
/**
|
|
133
|
-
|
|
143
|
+
/**
|
|
144
|
+
* @deprecated not supported on the server side
|
|
145
|
+
* @param flag
|
|
146
|
+
* - `undefined` — clone the template as-is (uses `cloneNode`).
|
|
147
|
+
* - `1` — use `document.importNode` instead of `cloneNode`.
|
|
148
|
+
* - `2` — the template html is wrapped; the outer tag is stripped at clone time.
|
|
149
|
+
*/
|
|
150
|
+
export function template(html: string, flag?: 1 | 2): () => Element;
|
|
134
151
|
/** @deprecated not supported on the server side */
|
|
135
152
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
136
153
|
/** @deprecated not supported on the server side */
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { JSX } from "./jsx.cjs";
|
|
2
|
+
export const DOMWithState: Record<string, Record<string, 1 | 2>>;
|
|
3
|
+
export const ChildProperties: Set<string>;
|
|
4
|
+
export const DelegatedEvents: Set<string>;
|
|
5
|
+
export const DOMElements: Set<string>;
|
|
6
|
+
export const SVGElements: Set<string>;
|
|
7
|
+
export const MathMLElements: Set<string>;
|
|
8
|
+
export const Namespaces: Record<string, string>;
|
|
9
|
+
|
|
10
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
11
|
+
export function render(
|
|
12
|
+
code: () => JSX.Element,
|
|
13
|
+
element: MountableElement,
|
|
14
|
+
init?: JSX.Element,
|
|
15
|
+
options?: { owner?: unknown }
|
|
16
|
+
): () => void;
|
|
17
|
+
/**
|
|
18
|
+
* @param flag
|
|
19
|
+
* - `undefined` — clone the template as-is (uses `cloneNode`).
|
|
20
|
+
* - `1` — use `document.importNode` instead of `cloneNode`.
|
|
21
|
+
* - `2` — the template html is wrapped; the outer tag is stripped at clone time.
|
|
22
|
+
*/
|
|
23
|
+
export function template(html: string, flag?: 1 | 2): () => Element;
|
|
24
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
25
|
+
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
26
|
+
export function untrack<T>(fn: () => T): T;
|
|
27
|
+
export function insert<T>(
|
|
28
|
+
parent: MountableElement,
|
|
29
|
+
accessor: (() => T) | T,
|
|
30
|
+
marker?: Node | null,
|
|
31
|
+
init?: JSX.Element
|
|
32
|
+
): JSX.Element;
|
|
33
|
+
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
34
|
+
export function delegateEvents(eventNames: string[], d?: Document): void;
|
|
35
|
+
export function clearDelegatedEvents(d?: Document): void;
|
|
36
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
37
|
+
export function assign(
|
|
38
|
+
node: Element,
|
|
39
|
+
props: any,
|
|
40
|
+
skipChildren?: Boolean,
|
|
41
|
+
prevProps?: any,
|
|
42
|
+
skipRef?: Boolean
|
|
43
|
+
): void;
|
|
44
|
+
export function setAttribute(node: Element, name: string, value: string): void;
|
|
45
|
+
export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
|
|
46
|
+
type ClassList =
|
|
47
|
+
| Record<string, boolean>
|
|
48
|
+
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
49
|
+
export function className(
|
|
50
|
+
node: Element,
|
|
51
|
+
value: string | ClassList,
|
|
52
|
+
prev?: string | ClassList
|
|
53
|
+
): void;
|
|
54
|
+
export function setProperty(node: Element, name: string, value: any): void;
|
|
55
|
+
export function setStyleProperty(node: Element, name: string, value: any): void;
|
|
56
|
+
export function addEventListener(
|
|
57
|
+
node: Element,
|
|
58
|
+
name: string,
|
|
59
|
+
handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions),
|
|
60
|
+
delegate: boolean
|
|
61
|
+
): void;
|
|
62
|
+
export function style(
|
|
63
|
+
node: Element,
|
|
64
|
+
value: { [k: string]: string },
|
|
65
|
+
prev?: { [k: string]: string }
|
|
66
|
+
): void;
|
|
67
|
+
export function getOwner(): unknown;
|
|
68
|
+
export function mergeProps(...sources: unknown[]): unknown;
|
|
69
|
+
export function dynamicProperty(props: unknown, key: string): unknown;
|
|
70
|
+
export function applyRef(
|
|
71
|
+
r: ((element: Element) => void) | ((element: Element) => void)[],
|
|
72
|
+
element: Element
|
|
73
|
+
): void;
|
|
74
|
+
export function ref(
|
|
75
|
+
fn: () => ((element: Element) => void) | ((element: Element) => void)[],
|
|
76
|
+
element: Element
|
|
77
|
+
): void;
|
|
78
|
+
|
|
79
|
+
export function hydrate(
|
|
80
|
+
fn: () => JSX.Element,
|
|
81
|
+
node: MountableElement,
|
|
82
|
+
options?: { renderId?: string; owner?: unknown }
|
|
83
|
+
): () => void;
|
|
84
|
+
export function getHydrationKey(): string | undefined;
|
|
85
|
+
export function getNextElement(template?: () => Element): Element;
|
|
86
|
+
export function getNextMatch(start: Node, elementName: string): Element;
|
|
87
|
+
export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
88
|
+
export function useAssets(fn: () => JSX.Element): void;
|
|
89
|
+
export function getAssets(): string;
|
|
90
|
+
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
91
|
+
export function generateHydrationScript(options?: {
|
|
92
|
+
nonce?: string;
|
|
93
|
+
eventNames?: string[];
|
|
94
|
+
}): string;
|
|
95
|
+
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
96
|
+
export interface RequestEvent {
|
|
97
|
+
request: Request;
|
|
98
|
+
locals: Record<string | number | symbol, any>;
|
|
99
|
+
}
|
|
100
|
+
export declare const RequestContext: unique symbol;
|
|
101
|
+
export function getRequestEvent(): RequestEvent | undefined;
|
|
102
|
+
export function runHydrationEvents(): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { getOwner, runWithOwner, createComponent, createRoot as root, sharedConfig, untrack, merge as mergeProps, flatten, ssrHandleError, ssrRunInScope } from "solid-js";
|
|
2
|
+
export declare const effect: (fn: any, effectFn: any, options: any) => void;
|
|
3
|
+
export declare const memo: (fn: any, transparent: any) => any;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { hydrate as hydrateCore } from "./client.cjs";
|
|
2
|
+
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
|
+
export * from "./client.cjs";
|
|
4
|
+
export * from "./server-mock.cjs";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
|
+
export declare const isServer: boolean;
|
|
7
|
+
export declare const isDev: boolean;
|
|
8
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
|
+
export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
|
|
10
|
+
[K in keyof P]: P[K];
|
|
11
|
+
} & {
|
|
12
|
+
component: T | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders a component tree into a DOM element and returns a dispose function.
|
|
16
|
+
*
|
|
17
|
+
* The top-level insert runs with `schedule: true` so its initial DOM attach
|
|
18
|
+
* goes through the effect queue rather than executing inline. This lets the
|
|
19
|
+
* mount participate in transitions: if an uncaught async read surfaces during
|
|
20
|
+
* the initial render (no `Loading` ancestor absorbs it), the mount is held by
|
|
21
|
+
* the transition and attaches atomically once all pending settles. On the
|
|
22
|
+
* no-async happy path the tail `flush()` drains the queued callback so the
|
|
23
|
+
* attach is synchronous by the time `render()` returns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
|
|
26
|
+
renderId?: string;
|
|
27
|
+
}): () => void;
|
|
28
|
+
export declare const hydrate: typeof hydrateCore;
|
|
29
|
+
/**
|
|
30
|
+
* Renders components somewhere else in the DOM
|
|
31
|
+
*
|
|
32
|
+
* Useful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted in document.body; it is wrapped in a `<div>` unless the target is document.head or `isSVG` is true. setting `useShadow` to true places the element in a shadow root to isolate styles.
|
|
33
|
+
*
|
|
34
|
+
* @description https://docs.solidjs.com/reference/components/portal
|
|
35
|
+
*/
|
|
36
|
+
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
37
|
+
mount?: Element;
|
|
38
|
+
children: JSX.Element;
|
|
39
|
+
}): Text;
|
|
40
|
+
/**
|
|
41
|
+
* Renders an arbitrary component or element with the given props
|
|
42
|
+
*
|
|
43
|
+
* This is a lower level version of the `Dynamic` component, useful for
|
|
44
|
+
* performance optimizations in libraries. Do not use this unless you know
|
|
45
|
+
* what you are doing.
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const element = () => multiline() ? 'textarea' : 'input';
|
|
48
|
+
* createDynamic(element, { value: value() });
|
|
49
|
+
* ```
|
|
50
|
+
* @description https://docs.solidjs.com/reference/components/dynamic
|
|
51
|
+
*/
|
|
52
|
+
export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
|
|
53
|
+
/**
|
|
54
|
+
* Renders an arbitrary custom or native component and passes the other props
|
|
55
|
+
* ```typescript
|
|
56
|
+
* <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
|
|
57
|
+
* ```
|
|
58
|
+
* @description https://docs.solidjs.com/reference/components/dynamic
|
|
59
|
+
*/
|
|
60
|
+
export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { JSX } from "solid-js";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare function renderToString<T>(fn: () => T, options?: {
|
|
2
|
+
nonce?: string;
|
|
3
|
+
renderId?: string;
|
|
4
|
+
noScripts?: boolean;
|
|
5
|
+
plugins?: any[];
|
|
6
|
+
manifest?: Record<string, {
|
|
7
|
+
file: string;
|
|
8
|
+
css?: string[];
|
|
9
|
+
isEntry?: boolean;
|
|
10
|
+
isDynamicEntry?: boolean;
|
|
11
|
+
imports?: string[];
|
|
12
|
+
}>;
|
|
13
|
+
onError?: (err: any) => void;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function renderToStringAsync<T>(fn: () => T, options?: {
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
nonce?: string;
|
|
18
|
+
renderId?: string;
|
|
19
|
+
noScripts?: boolean;
|
|
20
|
+
plugins?: any[];
|
|
21
|
+
manifest?: Record<string, {
|
|
22
|
+
file: string;
|
|
23
|
+
css?: string[];
|
|
24
|
+
isEntry?: boolean;
|
|
25
|
+
isDynamicEntry?: boolean;
|
|
26
|
+
imports?: string[];
|
|
27
|
+
}>;
|
|
28
|
+
onError?: (err: any) => void;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
export declare function renderToStream<T>(fn: () => T, options?: {
|
|
31
|
+
nonce?: string;
|
|
32
|
+
renderId?: string;
|
|
33
|
+
noScripts?: boolean;
|
|
34
|
+
plugins?: any[];
|
|
35
|
+
manifest?: Record<string, {
|
|
36
|
+
file: string;
|
|
37
|
+
css?: string[];
|
|
38
|
+
isEntry?: boolean;
|
|
39
|
+
isDynamicEntry?: boolean;
|
|
40
|
+
imports?: string[];
|
|
41
|
+
}>;
|
|
42
|
+
onCompleteShell?: (info: {
|
|
43
|
+
write: (v: string) => void;
|
|
44
|
+
}) => void;
|
|
45
|
+
onCompleteAll?: (info: {
|
|
46
|
+
write: (v: string) => void;
|
|
47
|
+
}) => void;
|
|
48
|
+
onError?: (err: any) => void;
|
|
49
|
+
}): {
|
|
50
|
+
then: (fn: (html: string) => void) => void;
|
|
51
|
+
pipe: (writable: {
|
|
52
|
+
write: (v: string) => void;
|
|
53
|
+
end: () => void;
|
|
54
|
+
}) => void;
|
|
55
|
+
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
export declare function ssr(template: string[] | string, ...nodes: any[]): {
|
|
58
|
+
t: string;
|
|
59
|
+
};
|
|
60
|
+
export declare function ssrElement(name: string, props: any, children: any, needsId: boolean): {
|
|
61
|
+
t: string;
|
|
62
|
+
};
|
|
63
|
+
export declare function ssrClassList(value: {
|
|
64
|
+
[k: string]: boolean;
|
|
65
|
+
}): string;
|
|
66
|
+
export declare function ssrStyle(value: {
|
|
67
|
+
[k: string]: string;
|
|
68
|
+
}): string;
|
|
69
|
+
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
70
|
+
export declare function ssrHydrationKey(): string;
|
|
71
|
+
export declare function resolveSSRNode(node: any): string;
|
|
72
|
+
export declare function escape(html: string): string;
|