@solidjs/web 2.0.0-beta.2 → 2.0.0-beta.20
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/README.md +27 -4
- package/dist/dev.cjs +783 -223
- package/dist/dev.js +757 -217
- package/dist/server.cjs +742 -186
- package/dist/server.js +714 -183
- package/dist/web.cjs +772 -196
- package/dist/web.js +746 -190
- package/package.json +193 -38
- package/serialization/dist/serialization.cjs +83 -0
- package/serialization/dist/serialization.js +75 -0
- package/serialization/package.json +20 -0
- package/serialization/types/index.d.ts +139 -0
- package/serialization/types-cjs/index.d.cts +139 -0
- package/serialization/types-cjs/package.json +3 -0
- package/server-functions/dist/client.cjs +370 -0
- package/server-functions/dist/client.js +363 -0
- package/server-functions/dist/server.cjs +542 -0
- package/server-functions/dist/server.js +531 -0
- package/server-functions/package.json +30 -0
- package/storage/package.json +8 -3
- package/storage/types/index.d.ts +26 -0
- package/storage/types-cjs/index.d.cts +28 -0
- package/storage/types-cjs/package.json +3 -0
- package/types/client.d.ts +64 -21
- package/types/core.d.ts +3 -3
- package/types/index.d.ts +156 -24
- package/types/jsx-properties.d.ts +93 -0
- package/types/jsx.d.ts +4135 -1
- package/types/response.d.ts +93 -0
- package/types/serializer.d.ts +139 -0
- package/types/server-functions/client.d.ts +63 -0
- package/types/server-functions/server.d.ts +188 -0
- package/types/server-functions/shared.d.ts +171 -0
- package/types/server-mock.d.ts +89 -0
- package/types/server.d.ts +123 -28
- package/types-cjs/client.d.cts +131 -0
- package/types-cjs/core.d.cts +3 -0
- package/types-cjs/index.d.cts +178 -0
- package/types-cjs/jsx-properties.d.cts +93 -0
- package/types-cjs/jsx.d.cts +4135 -0
- package/types-cjs/package.json +3 -0
- package/types-cjs/response.d.cts +93 -0
- package/types-cjs/serializer.d.cts +139 -0
- package/types-cjs/server-functions/client.d.cts +63 -0
- package/types-cjs/server-functions/server.d.cts +188 -0
- package/types-cjs/server-functions/shared.d.cts +171 -0
- package/types-cjs/server-mock.d.cts +161 -0
- package/types-cjs/server.d.cts +251 -0
- package/storage/types/src/client.d.ts +0 -1
- package/storage/types/src/index.d.ts +0 -46
- package/storage/types/src/server-mock.d.ts +0 -72
- package/storage/types/storage/src/index.d.ts +0 -2
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a component tree synchronously to an HTML string. Async reads inside
|
|
3
|
+
* `<Loading>` boundaries emit their `fallback` content; for full-graph
|
|
4
|
+
* resolution use `renderToStringAsync` instead.
|
|
5
|
+
*
|
|
6
|
+
* Pair the returned HTML with `hydrate()` on the client.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { renderToString } from "@solidjs/web";
|
|
11
|
+
*
|
|
12
|
+
* const html = renderToString(() => <App />);
|
|
13
|
+
* res.send(`<!doctype html><html><body><div id="root">${html}</div></body></html>`);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderToString<T>(fn: () => T, options?: {
|
|
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
|
+
}): string;
|
|
30
|
+
/**
|
|
31
|
+
* Renders a component tree to an HTML string and awaits all async reads in the
|
|
32
|
+
* subtree before resolving. The returned HTML reflects the fully-settled state
|
|
33
|
+
* — no `<Loading>` fallbacks appear in the output.
|
|
34
|
+
*
|
|
35
|
+
* Use this when you want a complete page in one round-trip. For incremental
|
|
36
|
+
* streaming with progressive boundary resolution, use `renderToStream`.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* import { renderToStringAsync } from "@solidjs/web";
|
|
41
|
+
*
|
|
42
|
+
* const html = await renderToStringAsync(() => <App />);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function renderToStringAsync<T>(fn: () => T, options?: {
|
|
46
|
+
timeoutMs?: number;
|
|
47
|
+
nonce?: string;
|
|
48
|
+
renderId?: string;
|
|
49
|
+
noScripts?: boolean;
|
|
50
|
+
plugins?: any[];
|
|
51
|
+
manifest?: Record<string, {
|
|
52
|
+
file: string;
|
|
53
|
+
css?: string[];
|
|
54
|
+
isEntry?: boolean;
|
|
55
|
+
isDynamicEntry?: boolean;
|
|
56
|
+
imports?: string[];
|
|
57
|
+
}>;
|
|
58
|
+
onError?: (err: any) => void;
|
|
59
|
+
}): Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Streams an HTML response, flushing the synchronous shell first and then
|
|
62
|
+
* progressively emitting async-resolved fragments as their `<Loading>`
|
|
63
|
+
* boundaries settle. Good for time-to-first-byte sensitive pages.
|
|
64
|
+
*
|
|
65
|
+
* Returns an object with `pipe`/`pipeTo` for piping to a Node `Writable` or
|
|
66
|
+
* a Web `WritableStream`, plus a `then` for awaiting full completion.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* import { renderToStream } from "@solidjs/web";
|
|
71
|
+
*
|
|
72
|
+
* // Node:
|
|
73
|
+
* renderToStream(() => <App />).pipe(res);
|
|
74
|
+
*
|
|
75
|
+
* // Web (Workers / Deno):
|
|
76
|
+
* await renderToStream(() => <App />).pipeTo(stream.writable);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function renderToStream<T>(fn: () => T, options?: {
|
|
80
|
+
nonce?: string;
|
|
81
|
+
renderId?: string;
|
|
82
|
+
noScripts?: boolean;
|
|
83
|
+
plugins?: any[];
|
|
84
|
+
manifest?: Record<string, {
|
|
85
|
+
file: string;
|
|
86
|
+
css?: string[];
|
|
87
|
+
isEntry?: boolean;
|
|
88
|
+
isDynamicEntry?: boolean;
|
|
89
|
+
imports?: string[];
|
|
90
|
+
}>;
|
|
91
|
+
onCompleteShell?: (info: {
|
|
92
|
+
write: (v: string) => void;
|
|
93
|
+
}) => void;
|
|
94
|
+
onCompleteAll?: (info: {
|
|
95
|
+
write: (v: string) => void;
|
|
96
|
+
}) => void;
|
|
97
|
+
onError?: (err: any) => void;
|
|
98
|
+
}): {
|
|
99
|
+
then: (fn: (html: string) => void) => void;
|
|
100
|
+
pipe: (writable: {
|
|
101
|
+
write: (v: string) => void;
|
|
102
|
+
end: () => void;
|
|
103
|
+
}) => void;
|
|
104
|
+
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Compiler primitive — emitted by JSX-DOM-Expressions for tagged-template
|
|
108
|
+
* SSR output. Not meant for hand-written code.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export declare function ssr(template: string[] | string, ...nodes: any[]): {
|
|
112
|
+
t: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Compiler primitive — emitted by JSX-DOM-Expressions for SSR element
|
|
116
|
+
* output. Not meant for hand-written code.
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
export declare function ssrElement(name: string, props: any, children: any, needsId: boolean): {
|
|
120
|
+
t: string;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Compiler primitive — serializes a classList object for SSR output. Not
|
|
124
|
+
* meant for hand-written code.
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
export declare function ssrClassList(value: {
|
|
128
|
+
[k: string]: boolean;
|
|
129
|
+
}): string;
|
|
130
|
+
/**
|
|
131
|
+
* Compiler primitive — serializes a style object for SSR output. Not meant
|
|
132
|
+
* for hand-written code.
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
export declare function ssrStyle(value: {
|
|
136
|
+
[k: string]: string;
|
|
137
|
+
}): string;
|
|
138
|
+
/**
|
|
139
|
+
* Compiler primitive — serializes a boolean attribute for SSR output. Not
|
|
140
|
+
* meant for hand-written code.
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
export declare function ssrAttribute(key: string, value: boolean): string;
|
|
144
|
+
/**
|
|
145
|
+
* Compiler primitive — generates the hydration-key attribute for SSR
|
|
146
|
+
* output. Not meant for hand-written code.
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
export declare function ssrHydrationKey(): string;
|
|
150
|
+
/**
|
|
151
|
+
* Compiler primitive — collapses an SSR-shaped node into its HTML string.
|
|
152
|
+
* Not meant for hand-written code.
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
export declare function resolveSSRNode(node: any): string;
|
|
156
|
+
/**
|
|
157
|
+
* Escapes a string for safe inclusion in HTML output. Used by the SSR
|
|
158
|
+
* runtime; not generally part of user code.
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function escape(html: string): string;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { JSX } from "./jsx.cjs";
|
|
2
|
+
import { SerializerPlugin } from "./serializer.cjs";
|
|
3
|
+
export const DOMWithState: Record<string, Record<string, 1 | 2>>;
|
|
4
|
+
export const ChildProperties: Set<string>;
|
|
5
|
+
export const DelegatedEvents: Set<string>;
|
|
6
|
+
export const DOMElements: Set<string>;
|
|
7
|
+
export const SVGElements: Set<string>;
|
|
8
|
+
export const MathMLElements: Set<string>;
|
|
9
|
+
export const VoidElements: Set<string>;
|
|
10
|
+
export const RawTextElements: Set<string>;
|
|
11
|
+
export const Namespaces: Record<string, string>;
|
|
12
|
+
|
|
13
|
+
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
14
|
+
|
|
15
|
+
/** Static asset manifest produced by a build (e.g. parsed Vite manifest.json). */
|
|
16
|
+
export type AssetManifest = Record<
|
|
17
|
+
string,
|
|
18
|
+
{ file: string; css?: string[]; isEntry?: boolean; imports?: string[] }
|
|
19
|
+
> & { _base?: string };
|
|
20
|
+
|
|
21
|
+
/** Inline style content, e.g. dev CSS collected from a bundler's module graph. */
|
|
22
|
+
export type InlineStyleAsset = {
|
|
23
|
+
id: string;
|
|
24
|
+
content: string;
|
|
25
|
+
attrs?: Record<string, string>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ResolvedAssets = {
|
|
29
|
+
js: string[];
|
|
30
|
+
css: (string | InlineStyleAsset)[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Resolver form of the manifest option — the primitive a dev server
|
|
35
|
+
* implements against its live module graph (a static manifest object is
|
|
36
|
+
* normalized into a sync resolver internally). `resolve` may return a
|
|
37
|
+
* promise (async resolvers require streaming rendering); CSS entries may be
|
|
38
|
+
* URL strings (emitted as load-gated `<link>` tags) or inline-style
|
|
39
|
+
* descriptors (emitted as `<style>` tags). A bare `resolve`-shaped function
|
|
40
|
+
* is accepted as shorthand for `{ resolve }`.
|
|
41
|
+
*/
|
|
42
|
+
export type AssetResolver = {
|
|
43
|
+
resolve(
|
|
44
|
+
key: string
|
|
45
|
+
): ResolvedAssets | null | undefined | Promise<ResolvedAssets | null | undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* Synchronous fast path answering with whatever is knowable without async
|
|
48
|
+
* work (typically js URLs, omitting css). Sync consumers — e.g. a lazy
|
|
49
|
+
* component's `moduleUrl` getter used by islands — use this when `resolve`
|
|
50
|
+
* would return a promise, so adapters should provide it whenever possible.
|
|
51
|
+
*/
|
|
52
|
+
resolveSync?(key: string): ResolvedAssets | null | undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Bare-function shorthand for `AssetResolver` (no sync fast path). */
|
|
56
|
+
export type AssetResolverFn = (
|
|
57
|
+
key: string
|
|
58
|
+
) => ResolvedAssets | null | undefined | Promise<ResolvedAssets | null | undefined>;
|
|
59
|
+
|
|
60
|
+
export function renderToString<T>(
|
|
61
|
+
fn: () => T,
|
|
62
|
+
options?: {
|
|
63
|
+
nonce?: string;
|
|
64
|
+
renderId?: string;
|
|
65
|
+
noScripts?: boolean;
|
|
66
|
+
plugins?: SerializerPlugin[];
|
|
67
|
+
manifest?: AssetManifest | AssetResolver | AssetResolverFn;
|
|
68
|
+
onError?: (err: any) => void;
|
|
69
|
+
}
|
|
70
|
+
): string;
|
|
71
|
+
/** @deprecated use renderToStream which also returns a promise */
|
|
72
|
+
export function renderToStringAsync<T>(
|
|
73
|
+
fn: () => T,
|
|
74
|
+
options?: {
|
|
75
|
+
timeoutMs?: number;
|
|
76
|
+
nonce?: string;
|
|
77
|
+
renderId?: string;
|
|
78
|
+
noScripts?: boolean;
|
|
79
|
+
plugins?: SerializerPlugin[];
|
|
80
|
+
manifest?: AssetManifest | AssetResolver | AssetResolverFn;
|
|
81
|
+
onError?: (err: any) => void;
|
|
82
|
+
}
|
|
83
|
+
): Promise<string>;
|
|
84
|
+
export function renderToStream<T>(
|
|
85
|
+
fn: () => T,
|
|
86
|
+
options?: {
|
|
87
|
+
nonce?: string;
|
|
88
|
+
renderId?: string;
|
|
89
|
+
noScripts?: boolean;
|
|
90
|
+
plugins?: SerializerPlugin[];
|
|
91
|
+
manifest?: AssetManifest | AssetResolver | AssetResolverFn;
|
|
92
|
+
onCompleteShell?: (info: { write: (v: string) => void }) => void;
|
|
93
|
+
onCompleteAll?: (info: { write: (v: string) => void }) => void;
|
|
94
|
+
onError?: (err: any) => void;
|
|
95
|
+
}
|
|
96
|
+
): {
|
|
97
|
+
then: (fn: (html: string) => void) => void;
|
|
98
|
+
pipe: (writable: { write: (v: string) => void; end: () => void }) => void;
|
|
99
|
+
pipeTo: (writable: WritableStream) => Promise<void>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export function HydrationScript(props: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
103
|
+
export function ssr(template: string[] | string, ...nodes: any[]): { t: string };
|
|
104
|
+
export function ssrElement(
|
|
105
|
+
name: string,
|
|
106
|
+
props: any,
|
|
107
|
+
children: any,
|
|
108
|
+
needsId: boolean
|
|
109
|
+
): { t: string };
|
|
110
|
+
export function ssrClassName(value: string | { [k: string]: boolean } | Array<any>): string;
|
|
111
|
+
export function ssrStyle(value: string | { [k: string]: string }): string;
|
|
112
|
+
export function ssrStyleProperty(name: string, value: any): string;
|
|
113
|
+
export function ssrAttribute(key: string, value: any): string;
|
|
114
|
+
export function ssrGroup<T extends () => any[]>(fn: T, n: number): T;
|
|
115
|
+
export function scope<T>(fn: () => T): () => unknown;
|
|
116
|
+
export function ssrHydrationKey(): string;
|
|
117
|
+
export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
|
|
118
|
+
export function escape(s: any, attr?: boolean): any;
|
|
119
|
+
export function applyRef(
|
|
120
|
+
r: ((element: any) => void) | ((element: any) => void)[],
|
|
121
|
+
element: any
|
|
122
|
+
): void;
|
|
123
|
+
export function useAssets(fn: () => JSX.Element): void;
|
|
124
|
+
export function getAssets(): string;
|
|
125
|
+
export function getHydrationKey(): string | undefined;
|
|
126
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
127
|
+
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
128
|
+
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
129
|
+
export function mergeProps(...sources: unknown[]): unknown;
|
|
130
|
+
export function getOwner(): unknown;
|
|
131
|
+
export function generateHydrationScript(options?: {
|
|
132
|
+
nonce?: string;
|
|
133
|
+
eventNames?: string[];
|
|
134
|
+
}): string;
|
|
135
|
+
/**
|
|
136
|
+
* Registered symbol (`Symbol.for("solid.RequestContext")`) naming the
|
|
137
|
+
* global slot where `provideRequestEvent` parks the AsyncLocalStorage that
|
|
138
|
+
* scopes request events. Integration plumbing — application code reads the
|
|
139
|
+
* event through `getRequestEvent()` instead.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
export declare const RequestContext: unique symbol;
|
|
143
|
+
/**
|
|
144
|
+
* The per-request context available on the server: the incoming `Request`
|
|
145
|
+
* and a `locals` bag integrations and middleware can hang state on.
|
|
146
|
+
* Frameworks typically extend this shape with richer fields.
|
|
147
|
+
*/
|
|
148
|
+
export interface RequestEvent {
|
|
149
|
+
request: Request;
|
|
150
|
+
locals: Record<string | number | symbol, any>;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The current request event, when called on the server inside a request
|
|
154
|
+
* scope (established by `provideRequestEvent` from `@solidjs/web/storage`
|
|
155
|
+
* or by the framework). Undefined on the client and outside a request.
|
|
156
|
+
* Read it above `await` boundaries in partially-polyfilled environments.
|
|
157
|
+
*/
|
|
158
|
+
export function getRequestEvent(): RequestEvent | undefined;
|
|
159
|
+
|
|
160
|
+
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
161
|
+
export function untrack<T>(fn: () => T): T;
|
|
162
|
+
|
|
163
|
+
// client-only APIs
|
|
164
|
+
|
|
165
|
+
/** @deprecated not supported on the server side */
|
|
166
|
+
export function style(
|
|
167
|
+
node: Element,
|
|
168
|
+
value: { [k: string]: string },
|
|
169
|
+
prev?: { [k: string]: string }
|
|
170
|
+
): void;
|
|
171
|
+
|
|
172
|
+
/** @deprecated not supported on the server side */
|
|
173
|
+
export function insert<T>(
|
|
174
|
+
parent: MountableElement,
|
|
175
|
+
accessor: (() => T) | T,
|
|
176
|
+
marker?: Node | null,
|
|
177
|
+
init?: JSX.Element
|
|
178
|
+
): JSX.Element;
|
|
179
|
+
|
|
180
|
+
/** @deprecated not supported on the server side */
|
|
181
|
+
export function spread<T>(node: Element, accessor: T, skipChildren?: Boolean): void;
|
|
182
|
+
|
|
183
|
+
/** @deprecated not supported on the server side */
|
|
184
|
+
export function delegateEvents(eventNames: string[]): void;
|
|
185
|
+
/** @deprecated not supported on the server side */
|
|
186
|
+
export function registerDelegatedRoot(root: MountableElement): void;
|
|
187
|
+
/** @deprecated not supported on the server side */
|
|
188
|
+
export function unregisterDelegatedRoot(root: MountableElement): void;
|
|
189
|
+
/** @deprecated not supported on the server side */
|
|
190
|
+
export function registerDelegatedContainer(
|
|
191
|
+
container: MountableElement,
|
|
192
|
+
owner?: MountableElement
|
|
193
|
+
): void;
|
|
194
|
+
/** @deprecated not supported on the server side */
|
|
195
|
+
export function unregisterDelegatedContainer(
|
|
196
|
+
container: MountableElement,
|
|
197
|
+
owner?: MountableElement
|
|
198
|
+
): void;
|
|
199
|
+
/** @deprecated not supported on the server side */
|
|
200
|
+
export function getDelegatedRoot(node: MountableElement): MountableElement | undefined;
|
|
201
|
+
/** @deprecated not supported on the server side */
|
|
202
|
+
export function dynamicProperty(props: unknown, key: string): unknown;
|
|
203
|
+
/** @deprecated not supported on the server side */
|
|
204
|
+
export function setAttribute(node: Element, name: string, value: string): void;
|
|
205
|
+
/** @deprecated not supported on the server side */
|
|
206
|
+
export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
|
|
207
|
+
|
|
208
|
+
/** @deprecated not supported on the server side */
|
|
209
|
+
export function addEvent(node: Element, name: string, handler: () => void, delegate: boolean): void;
|
|
210
|
+
|
|
211
|
+
/** @deprecated not supported on the server side */
|
|
212
|
+
export function render(code: () => JSX.Element, element: MountableElement): () => void;
|
|
213
|
+
/**
|
|
214
|
+
* @deprecated not supported on the server side
|
|
215
|
+
* @param flag
|
|
216
|
+
* - `undefined` — clone the template as-is (uses `cloneNode`).
|
|
217
|
+
* - `1` — use `document.importNode` instead of `cloneNode`.
|
|
218
|
+
* - `2` — the template html is wrapped; the outer tag is stripped at clone time.
|
|
219
|
+
*/
|
|
220
|
+
export function template(html: string, flag?: 1 | 2): () => Element;
|
|
221
|
+
/** @deprecated not supported on the server side */
|
|
222
|
+
export function setProperty(node: Element, name: string, value: any): void;
|
|
223
|
+
/** @deprecated not supported on the server side */
|
|
224
|
+
export function className(node: Element, value: string): void;
|
|
225
|
+
/** @deprecated not supported on the server side */
|
|
226
|
+
export function assign(node: Element, props: any, skipChildren?: Boolean): void;
|
|
227
|
+
|
|
228
|
+
/** @deprecated not supported on the server side */
|
|
229
|
+
export function hydrate(
|
|
230
|
+
fn: () => JSX.Element,
|
|
231
|
+
node: MountableElement,
|
|
232
|
+
options?: { renderId?: string; owner?: unknown }
|
|
233
|
+
): () => void;
|
|
234
|
+
|
|
235
|
+
/** @deprecated not supported on the server side */
|
|
236
|
+
export function getNextElement(template?: () => Element): Element;
|
|
237
|
+
/** @deprecated not supported on the server side */
|
|
238
|
+
export function getNextMatch(start: Node, elementName: string): Element;
|
|
239
|
+
/** @deprecated not supported on the server side */
|
|
240
|
+
export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
241
|
+
/** @deprecated not supported on the server side */
|
|
242
|
+
export function runHydrationEvents(): void;
|
|
243
|
+
/** @deprecated not supported on the server side */
|
|
244
|
+
export function ref(
|
|
245
|
+
fn: () => ((element: Element) => void) | ((element: Element) => void)[],
|
|
246
|
+
element: Element
|
|
247
|
+
): void;
|
|
248
|
+
/** @deprecated not supported on the server side */
|
|
249
|
+
export function setStyleProperty(node: Element, name: string, value: any): void;
|
|
250
|
+
/** @deprecated not supported on the server side — register assets through the render context instead */
|
|
251
|
+
export function acquireAsset(descriptor: unknown): () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "dom-expressions/src/client.js";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { hydrate as hydrateCore, render as renderCore } from "./client.js";
|
|
2
|
-
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
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, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
|
-
export * from "./server-mock.js";
|
|
7
|
-
export declare const isServer: boolean;
|
|
8
|
-
export declare const isDev: boolean;
|
|
9
|
-
export declare const hydrate: typeof hydrateCore;
|
|
10
|
-
/**
|
|
11
|
-
* Renders components somewhere else in the DOM
|
|
12
|
-
*
|
|
13
|
-
* 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.
|
|
14
|
-
*
|
|
15
|
-
* @description https://docs.solidjs.com/reference/components/portal
|
|
16
|
-
*/
|
|
17
|
-
export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
|
|
18
|
-
mount?: Element;
|
|
19
|
-
children: JSX.Element;
|
|
20
|
-
}): 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
|
-
/**
|
|
27
|
-
* Renders an arbitrary component or element with the given props
|
|
28
|
-
*
|
|
29
|
-
* This is a lower level version of the `Dynamic` component, useful for
|
|
30
|
-
* performance optimizations in libraries. Do not use this unless you know
|
|
31
|
-
* what you are doing.
|
|
32
|
-
* ```typescript
|
|
33
|
-
* const element = () => multiline() ? 'textarea' : 'input';
|
|
34
|
-
* createDynamic(element, { value: value() });
|
|
35
|
-
* ```
|
|
36
|
-
* @description https://docs.solidjs.com/reference/components/dynamic
|
|
37
|
-
*/
|
|
38
|
-
export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
|
|
39
|
-
/**
|
|
40
|
-
* Renders an arbitrary custom or native component and passes the other props
|
|
41
|
-
* ```typescript
|
|
42
|
-
* <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
|
|
43
|
-
* ```
|
|
44
|
-
* @description https://docs.solidjs.com/reference/components/dynamic
|
|
45
|
-
*/
|
|
46
|
-
export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
|
|
@@ -1,72 +0,0 @@
|
|
|
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;
|