@solidjs/web 2.0.0-beta.0

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/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@solidjs/web",
3
+ "description": "Solid's web runtime for the browser and the server",
4
+ "version": "2.0.0-beta.0",
5
+ "author": "Ryan Carniato",
6
+ "license": "MIT",
7
+ "homepage": "https://solidjs.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/solidjs/solid-web"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "./dist/server.cjs",
16
+ "module": "./dist/server.js",
17
+ "unpkg": "./dist/web.cjs",
18
+ "types": "./types/index.d.ts",
19
+ "type": "module",
20
+ "sideEffects": false,
21
+ "files": [
22
+ "dist",
23
+ "types",
24
+ "package.json",
25
+ "storage/dist",
26
+ "storage/types",
27
+ "storage/package.json"
28
+ ],
29
+ "exports": {
30
+ ".": {
31
+ "worker": {
32
+ "types": "./types/index.d.ts",
33
+ "import": "./dist/server.js",
34
+ "require": "./dist/server.cjs"
35
+ },
36
+ "browser": {
37
+ "development": {
38
+ "types": "./types/index.d.ts",
39
+ "import": "./dist/dev.js",
40
+ "require": "./dist/dev.cjs"
41
+ },
42
+ "types": "./types/index.d.ts",
43
+ "import": "./dist/web.js",
44
+ "require": "./dist/web.cjs"
45
+ },
46
+ "deno": {
47
+ "types": "./types/index.d.ts",
48
+ "import": "./dist/server.js",
49
+ "require": "./dist/server.cjs"
50
+ },
51
+ "node": {
52
+ "types": "./types/index.d.ts",
53
+ "import": "./dist/server.js",
54
+ "require": "./dist/server.cjs"
55
+ },
56
+ "development": {
57
+ "types": "./types/index.d.ts",
58
+ "import": "./dist/dev.js",
59
+ "require": "./dist/dev.cjs"
60
+ },
61
+ "types": "./types/index.d.ts",
62
+ "import": "./dist/web.js",
63
+ "require": "./dist/web.cjs"
64
+ },
65
+ "./storage": {
66
+ "types": "./storage/types/index.d.ts",
67
+ "import": "./storage/dist/storage.js",
68
+ "require": "./storage/dist/storage.cjs"
69
+ },
70
+ "./dist/*": "./dist/*",
71
+ "./types/*": "./types/*"
72
+ },
73
+ "dependencies": {
74
+ "seroval": "^1.1.0",
75
+ "seroval-plugins": "^1.1.0"
76
+ },
77
+ "peerDependencies": {
78
+ "solid-js": "^2.0.0-beta.0"
79
+ },
80
+ "devDependencies": {
81
+ "solid-js": "2.0.0-beta.0"
82
+ },
83
+ "scripts": {
84
+ "build": "npm-run-all -nl build:*",
85
+ "build:clean": "rimraf dist/",
86
+ "build:js": "rollup -c",
87
+ "link": "symlink-dir . node_modules/@solidjs/web",
88
+ "types": "npm-run-all -nl types:*",
89
+ "types:clean": "rimraf types/",
90
+ "types:web": "tsc --project ./tsconfig.build.json",
91
+ "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",
92
+ "types:web-storage": "tsc --project ./storage/tsconfig.build.json",
93
+ "test": "vitest run && vitest run --config vite.config.server.mjs && vitest run --config vite.config.hydrate.mjs",
94
+ "test:server": "vitest run --config vite.config.server.mjs",
95
+ "coverage": "vitest run --coverage",
96
+ "test-types": "tsc --project tsconfig.test.json"
97
+ }
98
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var node_async_hooks = require('node:async_hooks');
4
+ var web = require('@solidjs/web');
5
+
6
+ function provideRequestEvent(init, cb) {
7
+ if (!web.isServer) throw new Error("Attempting to use server context in non-server build");
8
+ const ctx = globalThis[web.RequestContext] = globalThis[web.RequestContext] || new node_async_hooks.AsyncLocalStorage();
9
+ return ctx.run(init, cb);
10
+ }
11
+
12
+ exports.provideRequestEvent = provideRequestEvent;
@@ -0,0 +1,10 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import { isServer, RequestContext } from '@solidjs/web';
3
+
4
+ function provideRequestEvent(init, cb) {
5
+ if (!isServer) throw new Error("Attempting to use server context in non-server build");
6
+ const ctx = globalThis[RequestContext] = globalThis[RequestContext] || new AsyncLocalStorage();
7
+ return ctx.run(init, cb);
8
+ }
9
+
10
+ export { provideRequestEvent };
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@solidjs/web/storage",
3
+ "main": "./dist/storage.cjs",
4
+ "module": "./dist/storage.js",
5
+ "types": "./types/index.d.ts",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "types": "./types/index.d.ts",
11
+ "import": "./dist/storage.js",
12
+ "require": "./dist/storage.cjs"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,2 @@
1
+ import type { RequestEvent } from "@solidjs/web";
2
+ export declare function provideRequestEvent<T extends RequestEvent, U>(init: T, cb: () => U): U;
@@ -0,0 +1 @@
1
+ export * from "dom-expressions/src/client.js";
@@ -0,0 +1,45 @@
1
+ import { hydrate as hydrateCore } from "./client.js";
2
+ import { JSX, ComponentProps, ValidComponent } from "solid-js";
3
+ export * from "./client.js";
4
+ export { For, Show, Switch, Match, Errored, Loading, merge as mergeProps } from "solid-js";
5
+ export * from "./server-mock.js";
6
+ export declare const isServer: boolean;
7
+ export declare const isDev: boolean;
8
+ export declare const hydrate: typeof hydrateCore;
9
+ /**
10
+ * Renders components somewhere else in the DOM
11
+ *
12
+ * 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.
13
+ *
14
+ * @description https://docs.solidjs.com/reference/components/portal
15
+ */
16
+ export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
17
+ mount?: Element;
18
+ children: JSX.Element;
19
+ }): Text;
20
+ export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
21
+ [K in keyof P]: P[K];
22
+ } & {
23
+ component: T | undefined;
24
+ };
25
+ /**
26
+ * Renders an arbitrary component or element with the given props
27
+ *
28
+ * This is a lower level version of the `Dynamic` component, useful for
29
+ * performance optimizations in libraries. Do not use this unless you know
30
+ * what you are doing.
31
+ * ```typescript
32
+ * const element = () => multiline() ? 'textarea' : 'input';
33
+ * createDynamic(element, { value: value() });
34
+ * ```
35
+ * @description https://docs.solidjs.com/reference/components/dynamic
36
+ */
37
+ export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
38
+ /**
39
+ * Renders an arbitrary custom or native component and passes the other props
40
+ * ```typescript
41
+ * <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
42
+ * ```
43
+ * @description https://docs.solidjs.com/reference/components/dynamic
44
+ */
45
+ 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;
@@ -0,0 +1,2 @@
1
+ import type { RequestEvent } from "@solidjs/web";
2
+ export declare function provideRequestEvent<T extends RequestEvent, U>(init: T, cb: () => U): U;
@@ -0,0 +1,90 @@
1
+ import { JSX } from "./jsx.js";
2
+ export const Properties: Set<string>;
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 SVGNamespace: Record<string, string>;
8
+
9
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
10
+ export function render(
11
+ code: () => JSX.Element,
12
+ element: MountableElement,
13
+ init?: JSX.Element,
14
+ options?: { owner?: unknown }
15
+ ): () => void;
16
+ export function template(html: string, isImportNode?: boolean, isSVG?: boolean, isMathML?: boolean): () => Element;
17
+ export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
18
+ export function memo<T>(fn: () => T, equal: boolean): () => T;
19
+ export function untrack<T>(fn: () => T): T;
20
+ export function insert<T>(
21
+ parent: MountableElement,
22
+ accessor: (() => T) | T,
23
+ marker?: Node | null,
24
+ init?: JSX.Element
25
+ ): JSX.Element;
26
+ export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
27
+ export function delegateEvents(eventNames: string[], d?: Document): void;
28
+ export function clearDelegatedEvents(d?: Document): void;
29
+ export function spread<T>(
30
+ node: Element,
31
+ accessor: T,
32
+ isSVG?: Boolean,
33
+ skipChildren?: Boolean
34
+ ): void;
35
+ export function assign(
36
+ node: Element,
37
+ props: any,
38
+ isSVG?: Boolean,
39
+ skipChildren?: Boolean,
40
+ prevProps?: any,
41
+ skipRef?: Boolean
42
+ ): void;
43
+ export function setAttribute(node: Element, name: string, value: string): void;
44
+ export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
45
+ type ClassList =
46
+ | Record<string, boolean>
47
+ | Array<string | number | boolean | null | undefined | Record<string, boolean>>;
48
+ export function className(node: Element, value: string | ClassList, isSvg?: boolean, prev?: string | ClassList): void;
49
+ export function setProperty(node: Element, name: string, value: any): void;
50
+ export function setStyleProperty(node: Element, name: string, value: any): void;
51
+ export function addEventListener(
52
+ node: Element,
53
+ name: string,
54
+ handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions),
55
+ delegate: boolean
56
+ ): void;
57
+ export function style(
58
+ node: Element,
59
+ value: { [k: string]: string },
60
+ prev?: { [k: string]: string }
61
+ ): void;
62
+ export function getOwner(): unknown;
63
+ export function mergeProps(...sources: unknown[]): unknown;
64
+ export function dynamicProperty(props: unknown, key: string): unknown;
65
+ export function applyRef(r: ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
66
+ export function ref(fn: () => ((element: Element) => void) | ((element: Element) => void)[], element: Element): void;
67
+
68
+ export function hydrate(
69
+ fn: () => JSX.Element,
70
+ node: MountableElement,
71
+ options?: { renderId?: string; owner?: unknown }
72
+ ): () => void;
73
+ export function getHydrationKey(): string | undefined;
74
+ export function getNextElement(template?: () => Element): Element;
75
+ export function getNextMatch(start: Node, elementName: string): Element;
76
+ export function getNextMarker(start: Node): [Node, Array<Node>];
77
+ export function useAssets(fn: () => JSX.Element): void;
78
+ export function getAssets(): string;
79
+ export function HydrationScript(props?: { nonce?: string; eventNames?: string[] }): JSX.Element;
80
+ export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
81
+ export function Assets(props: { children?: JSX.Element }): JSX.Element;
82
+ export function Hydration(props: { children?: JSX.Element }): JSX.Element;
83
+ export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
84
+ export interface RequestEvent {
85
+ request: Request;
86
+ locals: Record<string | number | symbol, any>;
87
+ }
88
+ export declare const RequestContext: unique symbol;
89
+ export function getRequestEvent(): RequestEvent | undefined;
90
+ 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, initial: any) => void;
3
+ export declare const memo: (fn: any) => import("solid-js").Accessor<any>;
@@ -0,0 +1,45 @@
1
+ import { hydrate as hydrateCore } from "./client.js";
2
+ import { JSX, ComponentProps, ValidComponent } from "solid-js";
3
+ export * from "./client.js";
4
+ export { For, Show, Switch, Match, Errored, Loading, merge as mergeProps } from "solid-js";
5
+ export * from "./server-mock.js";
6
+ export declare const isServer: boolean;
7
+ export declare const isDev: boolean;
8
+ export declare const hydrate: typeof hydrateCore;
9
+ /**
10
+ * Renders components somewhere else in the DOM
11
+ *
12
+ * 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.
13
+ *
14
+ * @description https://docs.solidjs.com/reference/components/portal
15
+ */
16
+ export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
17
+ mount?: Element;
18
+ children: JSX.Element;
19
+ }): Text;
20
+ export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
21
+ [K in keyof P]: P[K];
22
+ } & {
23
+ component: T | undefined;
24
+ };
25
+ /**
26
+ * Renders an arbitrary component or element with the given props
27
+ *
28
+ * This is a lower level version of the `Dynamic` component, useful for
29
+ * performance optimizations in libraries. Do not use this unless you know
30
+ * what you are doing.
31
+ * ```typescript
32
+ * const element = () => multiline() ? 'textarea' : 'input';
33
+ * createDynamic(element, { value: value() });
34
+ * ```
35
+ * @description https://docs.solidjs.com/reference/components/dynamic
36
+ */
37
+ export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
38
+ /**
39
+ * Renders an arbitrary custom or native component and passes the other props
40
+ * ```typescript
41
+ * <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
42
+ * ```
43
+ * @description https://docs.solidjs.com/reference/components/dynamic
44
+ */
45
+ export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;
package/types/jsx.d.ts ADDED
@@ -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;
@@ -0,0 +1,155 @@
1
+ import { JSX } from "./jsx.js";
2
+ export const Properties: Set<string>;
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 SVGNamespace: Record<string, string>;
8
+
9
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
10
+
11
+ export function renderToString<T>(
12
+ fn: () => T,
13
+ options?: {
14
+ nonce?: string;
15
+ renderId?: string;
16
+ noScripts?: boolean;
17
+ plugins?: any[];
18
+ onError?: (err: any) => void;
19
+ }
20
+ ): string;
21
+ /** @deprecated use renderToStream which also returns a promise */
22
+ export function renderToStringAsync<T>(
23
+ fn: () => T,
24
+ options?: {
25
+ timeoutMs?: number;
26
+ nonce?: string;
27
+ renderId?: string;
28
+ noScripts?: boolean;
29
+ plugins?: any[];
30
+ onError?: (err: any) => void;
31
+ }
32
+ ): Promise<string>;
33
+ export function renderToStream<T>(
34
+ fn: () => T,
35
+ options?: {
36
+ nonce?: string;
37
+ renderId?: string;
38
+ noScripts?: boolean;
39
+ plugins?: any[];
40
+ onCompleteShell?: (info: { write: (v: string) => void }) => void;
41
+ onCompleteAll?: (info: { write: (v: string) => void }) => void;
42
+ onError?: (err: any) => void;
43
+ }
44
+ ): {
45
+ then: (fn: (html: string) => void) => void;
46
+ pipe: (writable: { write: (v: string) => void; end: () => void }) => void;
47
+ pipeTo: (writable: WritableStream) => Promise<void>;
48
+ };
49
+
50
+ export function HydrationScript(props: { nonce?: string; eventNames?: string[] }): JSX.Element;
51
+ export function ssr(template: string[] | string, ...nodes: any[]): { t: string };
52
+ export function ssrElement(
53
+ name: string,
54
+ props: any,
55
+ children: any,
56
+ needsId: boolean
57
+ ): { t: string };
58
+ export function ssrClassName(value: string | { [k: string]: boolean } | Array<any>): string;
59
+ export function ssrStyle(value: string | { [k: string]: string }): string;
60
+ export function ssrStyleProperty(name: string, value: any): string;
61
+ export function ssrAttribute(key: string, value: any): string;
62
+ export function ssrHydrationKey(): string;
63
+ export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
64
+ export function escape(s: any, attr?: boolean): any;
65
+ export function applyRef(r: ((element: any) => void) | ((element: any) => void)[], element: any): void;
66
+ export function useAssets(fn: () => JSX.Element): void;
67
+ export function getAssets(): string;
68
+ export function getHydrationKey(): string | undefined;
69
+ export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
70
+ export function memo<T>(fn: () => T, equal: boolean): () => T;
71
+ export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
72
+ export function mergeProps(...sources: unknown[]): unknown;
73
+ export function getOwner(): unknown;
74
+ export function ssrRunInScope(fn: () => void, owner: unknown): void;
75
+ export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
76
+ export declare const RequestContext: unique symbol;
77
+ export interface RequestEvent {
78
+ request: Request;
79
+ locals: Record<string | number | symbol, any>;
80
+ }
81
+ export function getRequestEvent(): RequestEvent | undefined;
82
+
83
+ export function Hydration(props: { children?: JSX.Element }): JSX.Element;
84
+ export function NoHydration(props: { children?: JSX.Element }): JSX.Element;
85
+ export function Assets(props: { children?: JSX.Element }): JSX.Element;
86
+ export function untrack<T>(fn: () => T): T;
87
+
88
+ // client-only APIs
89
+
90
+ /** @deprecated not supported on the server side */
91
+ export function style(
92
+ node: Element,
93
+ value: { [k: string]: string },
94
+ prev?: { [k: string]: string }
95
+ ): void;
96
+
97
+ /** @deprecated not supported on the server side */
98
+ export function insert<T>(
99
+ parent: MountableElement,
100
+ accessor: (() => T) | T,
101
+ marker?: Node | null,
102
+ init?: JSX.Element
103
+ ): JSX.Element;
104
+
105
+ /** @deprecated not supported on the server side */
106
+ export function spread<T>(
107
+ node: Element,
108
+ accessor: T,
109
+ isSVG?: Boolean,
110
+ skipChildren?: Boolean
111
+ ): void;
112
+
113
+ /** @deprecated not supported on the server side */
114
+ export function delegateEvents(eventNames: string[], d?: Document): void;
115
+ /** @deprecated not supported on the server side */
116
+ export function dynamicProperty(props: unknown, key: string): unknown;
117
+ /** @deprecated not supported on the server side */
118
+ export function setAttribute(node: Element, name: string, value: string): void;
119
+ /** @deprecated not supported on the server side */
120
+ export function setAttributeNS(node: Element, namespace: string, name: string, value: string): void;
121
+
122
+ /** @deprecated not supported on the server side */
123
+ export function addEventListener(
124
+ node: Element,
125
+ name: string,
126
+ handler: () => void,
127
+ delegate: boolean
128
+ ): void;
129
+
130
+ /** @deprecated not supported on the server side */
131
+ export function render(code: () => JSX.Element, element: MountableElement): () => void;
132
+ /** @deprecated not supported on the server side */
133
+ export function template(html: string, isImportNode?: boolean, isSVG?: boolean, isMathML?: boolean): () => Element;
134
+ /** @deprecated not supported on the server side */
135
+ export function setProperty(node: Element, name: string, value: any): void;
136
+ /** @deprecated not supported on the server side */
137
+ export function className(node: Element, value: string): void;
138
+ /** @deprecated not supported on the server side */
139
+ export function assign(node: Element, props: any, isSVG?: Boolean, skipChildren?: Boolean): void;
140
+
141
+ /** @deprecated not supported on the server side */
142
+ export function hydrate(
143
+ fn: () => JSX.Element,
144
+ node: MountableElement,
145
+ options?: { renderId?: string; owner?: unknown }
146
+ ): () => void;
147
+
148
+ /** @deprecated not supported on the server side */
149
+ export function getNextElement(template?: () => Element): Element;
150
+ /** @deprecated not supported on the server side */
151
+ export function getNextMatch(start: Node, elementName: string): Element;
152
+ /** @deprecated not supported on the server side */
153
+ export function getNextMarker(start: Node): [Node, Array<Node>];
154
+ /** @deprecated not supported on the server side */
155
+ export function runHydrationEvents(): void;