@solidjs/web 2.0.0-beta.5 → 2.0.0-beta.7
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 +98 -40
- package/dist/dev.js +91 -41
- package/dist/server.cjs +146 -55
- package/dist/server.js +142 -56
- package/dist/web.cjs +94 -37
- package/dist/web.js +87 -38
- package/package.json +72 -30
- package/storage/package.json +8 -3
- package/storage/types/src/index.d.ts +1 -1
- 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 +46 -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 +10 -4
- package/types/core.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/server.d.ts +11 -4
- package/types-cjs/client.d.cts +93 -0
- package/types-cjs/core.d.cts +3 -0
- package/types-cjs/index.d.cts +46 -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 +161 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/web",
|
|
3
3
|
"description": "Solid's web runtime for the browser and the server",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.7",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -21,53 +21,94 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
23
|
"types",
|
|
24
|
+
"types-cjs",
|
|
24
25
|
"package.json",
|
|
25
26
|
"storage/dist",
|
|
26
27
|
"storage/types",
|
|
28
|
+
"storage/types-cjs",
|
|
27
29
|
"storage/package.json"
|
|
28
30
|
],
|
|
29
31
|
"exports": {
|
|
30
32
|
".": {
|
|
31
33
|
"worker": {
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./types/index.d.ts",
|
|
36
|
+
"default": "./dist/server.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./types-cjs/index.d.cts",
|
|
40
|
+
"default": "./dist/server.cjs"
|
|
41
|
+
}
|
|
35
42
|
},
|
|
36
43
|
"browser": {
|
|
37
44
|
"development": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./types/index.d.ts",
|
|
47
|
+
"default": "./dist/dev.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./types-cjs/index.d.cts",
|
|
51
|
+
"default": "./dist/dev.cjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"import": {
|
|
38
55
|
"types": "./types/index.d.ts",
|
|
39
|
-
"
|
|
40
|
-
"require": "./dist/dev.cjs"
|
|
56
|
+
"default": "./dist/web.js"
|
|
41
57
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
"require": {
|
|
59
|
+
"types": "./types-cjs/index.d.cts",
|
|
60
|
+
"default": "./dist/web.cjs"
|
|
61
|
+
}
|
|
45
62
|
},
|
|
46
63
|
"deno": {
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
"import": {
|
|
65
|
+
"types": "./types/index.d.ts",
|
|
66
|
+
"default": "./dist/server.js"
|
|
67
|
+
},
|
|
68
|
+
"require": {
|
|
69
|
+
"types": "./types-cjs/index.d.cts",
|
|
70
|
+
"default": "./dist/server.cjs"
|
|
71
|
+
}
|
|
50
72
|
},
|
|
51
73
|
"node": {
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
"import": {
|
|
75
|
+
"types": "./types/index.d.ts",
|
|
76
|
+
"default": "./dist/server.js"
|
|
77
|
+
},
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./types-cjs/index.d.cts",
|
|
80
|
+
"default": "./dist/server.cjs"
|
|
81
|
+
}
|
|
55
82
|
},
|
|
56
83
|
"development": {
|
|
84
|
+
"import": {
|
|
85
|
+
"types": "./types/index.d.ts",
|
|
86
|
+
"default": "./dist/dev.js"
|
|
87
|
+
},
|
|
88
|
+
"require": {
|
|
89
|
+
"types": "./types-cjs/index.d.cts",
|
|
90
|
+
"default": "./dist/dev.cjs"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"import": {
|
|
57
94
|
"types": "./types/index.d.ts",
|
|
58
|
-
"
|
|
59
|
-
"require": "./dist/dev.cjs"
|
|
95
|
+
"default": "./dist/web.js"
|
|
60
96
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./types-cjs/index.d.cts",
|
|
99
|
+
"default": "./dist/web.cjs"
|
|
100
|
+
}
|
|
64
101
|
},
|
|
65
102
|
"./storage": {
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./storage/types/index.d.ts",
|
|
105
|
+
"default": "./storage/dist/storage.js"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./storage/types-cjs/index.d.cts",
|
|
109
|
+
"default": "./storage/dist/storage.cjs"
|
|
110
|
+
}
|
|
69
111
|
},
|
|
70
|
-
"./dist/*": "./dist/*",
|
|
71
112
|
"./types/*": "./types/*"
|
|
72
113
|
},
|
|
73
114
|
"dependencies": {
|
|
@@ -75,23 +116,24 @@
|
|
|
75
116
|
"seroval-plugins": "^1.1.0"
|
|
76
117
|
},
|
|
77
118
|
"peerDependencies": {
|
|
78
|
-
"@solidjs/signals": "^0.
|
|
79
|
-
"solid-js": "^2.0.0-beta.
|
|
119
|
+
"@solidjs/signals": "^2.0.0-beta.7",
|
|
120
|
+
"solid-js": "^2.0.0-beta.7"
|
|
80
121
|
},
|
|
81
122
|
"devDependencies": {
|
|
82
|
-
"@solidjs/signals": "
|
|
83
|
-
"solid-js": "2.0.0-beta.
|
|
123
|
+
"@solidjs/signals": "2.0.0-beta.7",
|
|
124
|
+
"solid-js": "2.0.0-beta.7"
|
|
84
125
|
},
|
|
85
126
|
"scripts": {
|
|
86
127
|
"build": "npm-run-all -nl build:*",
|
|
87
128
|
"build:clean": "rimraf dist/",
|
|
88
129
|
"build:js": "rollup -c",
|
|
89
130
|
"link": "symlink-dir . node_modules/@solidjs/web",
|
|
90
|
-
"types": "npm-run-all -nl types
|
|
91
|
-
"types:clean": "rimraf types/",
|
|
131
|
+
"types": "npm-run-all -nl types:clean types:web types:copy-web types:web-storage types:cjs",
|
|
132
|
+
"types:clean": "rimraf types/ types-cjs/ storage/types-cjs/",
|
|
92
133
|
"types:web": "tsc --project ./tsconfig.build.json",
|
|
93
134
|
"types:copy-web": "ncp ../../node_modules/dom-expressions/src/client.d.ts ./types/client.d.ts && ncp ../../node_modules/dom-expressions/src/server.d.ts ./types/server.d.ts",
|
|
94
135
|
"types:web-storage": "tsc --project ./storage/tsconfig.build.json",
|
|
136
|
+
"types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./storage/types ./storage/types-cjs",
|
|
95
137
|
"test": "vitest run && vitest run --config vite.config.server.mjs && vitest run --config vite.config.hydrate.mjs",
|
|
96
138
|
"test:server": "vitest run --config vite.config.server.mjs",
|
|
97
139
|
"coverage": "vitest run --coverage",
|
package/storage/package.json
CHANGED
|
@@ -7,9 +7,14 @@
|
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./types/index.d.ts",
|
|
12
|
+
"default": "./dist/storage.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./types-cjs/index.d.cts",
|
|
16
|
+
"default": "./dist/storage.cjs"
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
@@ -2,7 +2,7 @@ import { hydrate as hydrateCore, render as renderCore } from "./client.js";
|
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
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";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
6
|
export * from "./server-mock.js";
|
|
7
7
|
export declare const isServer: boolean;
|
|
8
8
|
export declare const isDev: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "dom-expressions/src/client.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { hydrate as hydrateCore, render as renderCore } from "./client.cjs";
|
|
2
|
+
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
|
+
export * from "./client.cjs";
|
|
4
|
+
export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
|
+
export * from "./server-mock.cjs";
|
|
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;
|
|
@@ -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,11 +1,11 @@
|
|
|
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>;
|
|
6
6
|
export const SVGElements: Set<string>;
|
|
7
7
|
export const MathMLElements: Set<string>;
|
|
8
|
-
export const
|
|
8
|
+
export const Namespaces: Record<string, string>;
|
|
9
9
|
|
|
10
10
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
11
11
|
export function render(
|
|
@@ -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>(
|
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) => void;
|
|
3
3
|
export declare const memo: (fn: any, transparent: any) => any;
|
package/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { hydrate as hydrateCore, render as renderCore } from "./client.js";
|
|
|
2
2
|
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
3
|
export * from "./client.js";
|
|
4
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";
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
6
|
export * from "./server-mock.js";
|
|
7
7
|
export declare const isServer: boolean;
|
|
8
8
|
export declare const isDev: boolean;
|
package/types/server.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export const ChildProperties: Set<string>;
|
|
|
3
3
|
export const DelegatedEvents: Set<string>;
|
|
4
4
|
export const DOMElements: Set<string>;
|
|
5
5
|
export const SVGElements: Set<string>;
|
|
6
|
-
export const
|
|
6
|
+
export const MathMLElements: Set<string>;
|
|
7
|
+
export const Namespaces: Record<string, string>;
|
|
7
8
|
|
|
8
9
|
type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
|
|
9
10
|
|
|
@@ -68,7 +69,7 @@ export function applyRef(r: ((element: any) => void) | ((element: any) => void)[
|
|
|
68
69
|
export function useAssets(fn: () => JSX.Element): void;
|
|
69
70
|
export function getAssets(): string;
|
|
70
71
|
export function getHydrationKey(): string | undefined;
|
|
71
|
-
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void
|
|
72
|
+
export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
|
|
72
73
|
export function memo<T>(fn: () => T, equal: boolean): () => T;
|
|
73
74
|
export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
|
|
74
75
|
export function mergeProps(...sources: unknown[]): unknown;
|
|
@@ -128,8 +129,14 @@ export function addEventListener(
|
|
|
128
129
|
|
|
129
130
|
/** @deprecated not supported on the server side */
|
|
130
131
|
export function render(code: () => JSX.Element, element: MountableElement): () => void;
|
|
131
|
-
/**
|
|
132
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated not supported on the server side
|
|
134
|
+
* @param flag
|
|
135
|
+
* - `undefined` — clone the template as-is (uses `cloneNode`).
|
|
136
|
+
* - `1` — use `document.importNode` instead of `cloneNode`.
|
|
137
|
+
* - `2` — the template html is wrapped; the outer tag is stripped at clone time.
|
|
138
|
+
*/
|
|
139
|
+
export function template(html: string, flag?: 1 | 2): () => Element;
|
|
133
140
|
/** @deprecated not supported on the server side */
|
|
134
141
|
export function setProperty(node: Element, name: string, value: any): void;
|
|
135
142
|
/** @deprecated not supported on the server side */
|
|
@@ -0,0 +1,93 @@
|
|
|
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>(
|
|
37
|
+
node: Element,
|
|
38
|
+
accessor: T,
|
|
39
|
+
skipChildren?: Boolean
|
|
40
|
+
): void;
|
|
41
|
+
export function assign(
|
|
42
|
+
node: Element,
|
|
43
|
+
props: any,
|
|
44
|
+
skipChildren?: Boolean,
|
|
45
|
+
prevProps?: any,
|
|
46
|
+
skipRef?: Boolean
|
|
47
|
+
): void;
|
|
48
|
+
export function setAttribute(node: Element, name: string, value: string): void;
|
|
49
|
+
export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
|
|
50
|
+
type ClassList =
|
|
51
|
+
| Record<string, boolean>
|
|
52
|
+
| Array<string | number | boolean | null | undefined | Record<string, boolean>>;
|
|
53
|
+
export function className(node: Element, value: string | ClassList, prev?: string | ClassList): 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(r: ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
71
|
+
export function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
|
|
72
|
+
|
|
73
|
+
export function hydrate(
|
|
74
|
+
fn: () => JSX.Element,
|
|
75
|
+
node: MountableElement,
|
|
76
|
+
options?: { renderId?: string; owner?: unknown }
|
|
77
|
+
): () => void;
|
|
78
|
+
export function getHydrationKey(): string | undefined;
|
|
79
|
+
export function getNextElement(template?: () => Element): Element;
|
|
80
|
+
export function getNextMatch(start: Node, elementName: string): Element;
|
|
81
|
+
export function getNextMarker(start: Node): [Node, Array<Node>];
|
|
82
|
+
export function useAssets(fn: () => JSX.Element): void;
|
|
83
|
+
export function getAssets(): string;
|
|
84
|
+
export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
|
|
85
|
+
export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
|
|
86
|
+
export function Assets(props: { children?: JSX.Element }): JSX.Element;
|
|
87
|
+
export interface RequestEvent {
|
|
88
|
+
request: Request;
|
|
89
|
+
locals: Record<string | number | symbol, any>;
|
|
90
|
+
}
|
|
91
|
+
export declare const RequestContext: unique symbol;
|
|
92
|
+
export function getRequestEvent(): RequestEvent | undefined;
|
|
93
|
+
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) => void;
|
|
3
|
+
export declare const memo: (fn: any, transparent: any) => any;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { hydrate as hydrateCore, render as renderCore } from "./client.cjs";
|
|
2
|
+
import { JSX, ComponentProps, ValidComponent } from "solid-js";
|
|
3
|
+
export * from "./client.cjs";
|
|
4
|
+
export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
|
|
5
|
+
export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
|
|
6
|
+
export * from "./server-mock.cjs";
|
|
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;
|
|
@@ -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;
|