@solidjs/web 2.0.0-beta.6 → 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.
@@ -0,0 +1,161 @@
1
+ import { JSX } from "./jsx.cjs";
2
+ export const ChildProperties: Set<string>;
3
+ export const DelegatedEvents: Set<string>;
4
+ export const DOMElements: Set<string>;
5
+ export const SVGElements: Set<string>;
6
+ export const MathMLElements: Set<string>;
7
+ export const Namespaces: 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
+ manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
19
+ onError?: (err: any) => void;
20
+ }
21
+ ): string;
22
+ /** @deprecated use renderToStream which also returns a promise */
23
+ export function renderToStringAsync<T>(
24
+ fn: () => T,
25
+ options?: {
26
+ timeoutMs?: number;
27
+ nonce?: string;
28
+ renderId?: string;
29
+ noScripts?: boolean;
30
+ plugins?: any[];
31
+ manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
32
+ onError?: (err: any) => void;
33
+ }
34
+ ): Promise<string>;
35
+ export function renderToStream<T>(
36
+ fn: () => T,
37
+ options?: {
38
+ nonce?: string;
39
+ renderId?: string;
40
+ noScripts?: boolean;
41
+ plugins?: any[];
42
+ manifest?: Record<string, { file: string; css?: string[]; isEntry?: boolean; imports?: string[] }> & { _base?: string };
43
+ onCompleteShell?: (info: { write: (v: string) => void }) => void;
44
+ onCompleteAll?: (info: { write: (v: string) => void }) => void;
45
+ onError?: (err: any) => void;
46
+ }
47
+ ): {
48
+ then: (fn: (html: string) => void) => void;
49
+ pipe: (writable: { write: (v: string) => void; end: () => void }) => void;
50
+ pipeTo: (writable: WritableStream) => Promise<void>;
51
+ };
52
+
53
+ export function HydrationScript(props: { nonce?: string; eventNames?: string[] }): JSX.Element;
54
+ export function ssr(template: string[] | string, ...nodes: any[]): { t: string };
55
+ export function ssrElement(
56
+ name: string,
57
+ props: any,
58
+ children: any,
59
+ needsId: boolean
60
+ ): { t: string };
61
+ export function ssrClassName(value: string | { [k: string]: boolean } | Array<any>): string;
62
+ export function ssrStyle(value: string | { [k: string]: string }): string;
63
+ export function ssrStyleProperty(name: string, value: any): string;
64
+ export function ssrAttribute(key: string, value: any): string;
65
+ export function ssrHydrationKey(): string;
66
+ export function resolveSSRNode(node: any, result?: any, top?: boolean): any;
67
+ export function escape(s: any, attr?: boolean): any;
68
+ export function applyRef(r: ((element: any) => void) | ((element: any) => void)[], element: any): void;
69
+ export function useAssets(fn: () => JSX.Element): void;
70
+ export function getAssets(): string;
71
+ export function getHydrationKey(): string | undefined;
72
+ export function effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void): void;
73
+ export function memo<T>(fn: () => T, equal: boolean): () => T;
74
+ export function createComponent<T>(Comp: (props: T) => JSX.Element, props: T): JSX.Element;
75
+ export function mergeProps(...sources: unknown[]): unknown;
76
+ export function getOwner(): unknown;
77
+ export function ssrRunInScope(fn: () => void, owner: unknown): void;
78
+ export function generateHydrationScript(options?: { nonce?: string; eventNames?: string[] }): string;
79
+ export declare const RequestContext: unique symbol;
80
+ export interface RequestEvent {
81
+ request: Request;
82
+ locals: Record<string | number | symbol, any>;
83
+ }
84
+ export function getRequestEvent(): RequestEvent | undefined;
85
+
86
+ export function Assets(props: { children?: JSX.Element }): JSX.Element;
87
+ export function untrack<T>(fn: () => T): T;
88
+
89
+ // client-only APIs
90
+
91
+ /** @deprecated not supported on the server side */
92
+ export function style(
93
+ node: Element,
94
+ value: { [k: string]: string },
95
+ prev?: { [k: string]: string }
96
+ ): void;
97
+
98
+ /** @deprecated not supported on the server side */
99
+ export function insert<T>(
100
+ parent: MountableElement,
101
+ accessor: (() => T) | T,
102
+ marker?: Node | null,
103
+ init?: JSX.Element
104
+ ): JSX.Element;
105
+
106
+ /** @deprecated not supported on the server side */
107
+ export function spread<T>(
108
+ node: Element,
109
+ accessor: T,
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
+ /**
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;
140
+ /** @deprecated not supported on the server side */
141
+ export function setProperty(node: Element, name: string, value: any): void;
142
+ /** @deprecated not supported on the server side */
143
+ export function className(node: Element, value: string): void;
144
+ /** @deprecated not supported on the server side */
145
+ export function assign(node: Element, props: any, skipChildren?: Boolean): void;
146
+
147
+ /** @deprecated not supported on the server side */
148
+ export function hydrate(
149
+ fn: () => JSX.Element,
150
+ node: MountableElement,
151
+ options?: { renderId?: string; owner?: unknown }
152
+ ): () => void;
153
+
154
+ /** @deprecated not supported on the server side */
155
+ export function getNextElement(template?: () => Element): Element;
156
+ /** @deprecated not supported on the server side */
157
+ export function getNextMatch(start: Node, elementName: string): Element;
158
+ /** @deprecated not supported on the server side */
159
+ export function getNextMarker(start: Node): [Node, Array<Node>];
160
+ /** @deprecated not supported on the server side */
161
+ export function runHydrationEvents(): void;