@matthesketh/utopia-server 0.0.1

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/index.cjs ADDED
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ createHandler: () => createHandler,
24
+ createServerRouter: () => createServerRouter,
25
+ renderToStream: () => renderToStream,
26
+ renderToString: () => renderToString
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+
30
+ // src/ssr-runtime.ts
31
+ var import_utopia_core = require("@matthesketh/utopia-core");
32
+ var collectedStyles = [];
33
+ function flushStyles() {
34
+ const styles = collectedStyles;
35
+ collectedStyles = [];
36
+ return styles;
37
+ }
38
+ function createComponent(Component, props, children) {
39
+ const ctx = Component.setup ? (0, import_utopia_core.untrack)(() => Component.setup(props ?? {})) : {};
40
+ const renderCtx = {
41
+ ...ctx,
42
+ $slots: children ?? {}
43
+ };
44
+ const el = (0, import_utopia_core.untrack)(() => Component.render(renderCtx));
45
+ if (Component.styles) {
46
+ collectedStyles.push(Component.styles);
47
+ }
48
+ return el;
49
+ }
50
+
51
+ // src/render-to-string.ts
52
+ var VOID_ELEMENTS = /* @__PURE__ */ new Set([
53
+ "area",
54
+ "base",
55
+ "br",
56
+ "col",
57
+ "embed",
58
+ "hr",
59
+ "img",
60
+ "input",
61
+ "link",
62
+ "meta",
63
+ "param",
64
+ "source",
65
+ "track",
66
+ "wbr"
67
+ ]);
68
+ function escapeHtml(str) {
69
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
70
+ }
71
+ function escapeAttr(str) {
72
+ return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
73
+ }
74
+ function escapeComment(str) {
75
+ return str.replace(/--/g, "-\u200B-");
76
+ }
77
+ function serializeVNode(node) {
78
+ switch (node.type) {
79
+ case 1:
80
+ return serializeElement(node);
81
+ case 2:
82
+ return escapeHtml(node.text);
83
+ case 3:
84
+ return `<!--${escapeComment(node.text)}-->`;
85
+ }
86
+ }
87
+ function serializeElement(el) {
88
+ const tag = el.tag;
89
+ let html = `<${tag}`;
90
+ for (const [name, value] of Object.entries(el.attrs)) {
91
+ if (value === "") {
92
+ html += ` ${name}`;
93
+ } else {
94
+ html += ` ${name}="${escapeAttr(value)}"`;
95
+ }
96
+ }
97
+ if (VOID_ELEMENTS.has(tag.toLowerCase())) {
98
+ html += ">";
99
+ return html;
100
+ }
101
+ html += ">";
102
+ for (const child of el.children) {
103
+ html += serializeVNode(child);
104
+ }
105
+ html += `</${tag}>`;
106
+ return html;
107
+ }
108
+ function renderToString(component, props) {
109
+ flushStyles();
110
+ const vnode = createComponent(component, props);
111
+ const html = serializeVNode(vnode);
112
+ const styles = flushStyles();
113
+ const css = styles.join("\n");
114
+ return { html, css };
115
+ }
116
+
117
+ // src/render-to-stream.ts
118
+ var import_node_stream = require("stream");
119
+ var VOID_ELEMENTS2 = /* @__PURE__ */ new Set([
120
+ "area",
121
+ "base",
122
+ "br",
123
+ "col",
124
+ "embed",
125
+ "hr",
126
+ "img",
127
+ "input",
128
+ "link",
129
+ "meta",
130
+ "param",
131
+ "source",
132
+ "track",
133
+ "wbr"
134
+ ]);
135
+ function escapeHtml2(str) {
136
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
137
+ }
138
+ function escapeAttr2(str) {
139
+ return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
140
+ }
141
+ function escapeComment2(str) {
142
+ return str.replace(/--/g, "-\u200B-");
143
+ }
144
+ function renderToStream(component, props) {
145
+ flushStyles();
146
+ const vnode = createComponent(component, props);
147
+ const styles = flushStyles();
148
+ return new import_node_stream.Readable({
149
+ read() {
150
+ if (styles.length > 0) {
151
+ this.push(`<style>${styles.join("\n")}</style>`);
152
+ }
153
+ pushVNode(this, vnode);
154
+ this.push(null);
155
+ }
156
+ });
157
+ }
158
+ function pushVNode(stream, node) {
159
+ switch (node.type) {
160
+ case 1:
161
+ pushElement(stream, node);
162
+ break;
163
+ case 2:
164
+ stream.push(escapeHtml2(node.text));
165
+ break;
166
+ case 3:
167
+ stream.push(`<!--${escapeComment2(node.text)}-->`);
168
+ break;
169
+ }
170
+ }
171
+ function pushElement(stream, el) {
172
+ let open = `<${el.tag}`;
173
+ for (const [name, value] of Object.entries(el.attrs)) {
174
+ if (value === "") {
175
+ open += ` ${name}`;
176
+ } else {
177
+ open += ` ${name}="${escapeAttr2(value)}"`;
178
+ }
179
+ }
180
+ open += ">";
181
+ stream.push(open);
182
+ if (VOID_ELEMENTS2.has(el.tag.toLowerCase())) {
183
+ return;
184
+ }
185
+ for (const child of el.children) {
186
+ pushVNode(stream, child);
187
+ }
188
+ stream.push(`</${el.tag}>`);
189
+ }
190
+
191
+ // src/server-router.ts
192
+ var import_utopia_router = require("@matthesketh/utopia-router");
193
+ function createServerRouter(routes, url) {
194
+ const fullUrl = new URL(url, "http://localhost");
195
+ return (0, import_utopia_router.matchRoute)(fullUrl, routes);
196
+ }
197
+
198
+ // src/handler.ts
199
+ function createHandler(options) {
200
+ const { template, render } = options;
201
+ return async (req, res) => {
202
+ const url = req.url ?? "/";
203
+ try {
204
+ const { html, css } = await render(url);
205
+ const headInject = css ? `<style>${css}</style>` : "";
206
+ let page = template;
207
+ page = page.replace("<!--ssr-head-->", headInject);
208
+ page = page.replace("<!--ssr-outlet-->", html);
209
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
210
+ res.end(page);
211
+ } catch (err) {
212
+ console.error("[utopia] SSR render error:", err);
213
+ res.writeHead(500, { "Content-Type": "text/plain" });
214
+ res.end("Internal Server Error");
215
+ }
216
+ };
217
+ }
218
+ // Annotate the CommonJS export names for ESM import in node:
219
+ 0 && (module.exports = {
220
+ createHandler,
221
+ createServerRouter,
222
+ renderToStream,
223
+ renderToString
224
+ });
@@ -0,0 +1,61 @@
1
+ import { C as ComponentDefinition } from './ssr-runtime-DRHVHO7Q.cjs';
2
+ export { V as VComment, a as VElement, b as VNode, c as VText } from './ssr-runtime-DRHVHO7Q.cjs';
3
+ import { Readable } from 'node:stream';
4
+ import { Route, RouteMatch } from '@matthesketh/utopia-router';
5
+ import { IncomingMessage, ServerResponse } from 'node:http';
6
+ import '@matthesketh/utopia-core';
7
+
8
+ /**
9
+ * Render a component to an HTML string.
10
+ *
11
+ * @returns An object with `html` (the rendered markup) and `css` (all
12
+ * scoped styles collected during rendering).
13
+ */
14
+ declare function renderToString(component: ComponentDefinition, props?: Record<string, any>): {
15
+ html: string;
16
+ css: string;
17
+ };
18
+
19
+ /**
20
+ * Render a component to a Node.js Readable stream.
21
+ *
22
+ * The stream yields HTML chunks as the VNode tree is walked. This
23
+ * allows the server to begin flushing output before the full tree
24
+ * is serialized, reducing TTFB for large pages.
25
+ */
26
+ declare function renderToStream(component: ComponentDefinition, props?: Record<string, any>): Readable;
27
+
28
+ /**
29
+ * Match a URL string against a route table on the server.
30
+ *
31
+ * @param routes - The compiled route table
32
+ * @param url - The URL string to match (e.g. '/blog/my-post')
33
+ * @returns The matched route with params, or null
34
+ */
35
+ declare function createServerRouter(routes: Route[], url: string): RouteMatch | null;
36
+
37
+ interface HandlerOptions {
38
+ /** The HTML template with <!--ssr-outlet--> and <!--ssr-head--> markers. */
39
+ template: string;
40
+ /** Render function that produces HTML + CSS for a given URL. */
41
+ render: (url: string) => Promise<{
42
+ html: string;
43
+ css: string;
44
+ }>;
45
+ }
46
+ /**
47
+ * Create a Node.js HTTP request handler for SSR.
48
+ *
49
+ * The handler renders the component for the incoming URL and injects the
50
+ * result into the HTML template at the marker positions:
51
+ *
52
+ * - `<!--ssr-head-->` — replaced with `<style>` tags for collected CSS
53
+ * - `<!--ssr-outlet-->` — replaced with the rendered HTML
54
+ *
55
+ * @param options - Handler configuration
56
+ * @returns An `(req, res) => void` function suitable for Node's `http.createServer`
57
+ * or as Express middleware.
58
+ */
59
+ declare function createHandler(options: HandlerOptions): (req: IncomingMessage, res: ServerResponse) => void;
60
+
61
+ export { createHandler, createServerRouter, renderToStream, renderToString };
@@ -0,0 +1,61 @@
1
+ import { C as ComponentDefinition } from './ssr-runtime-DRHVHO7Q.js';
2
+ export { V as VComment, a as VElement, b as VNode, c as VText } from './ssr-runtime-DRHVHO7Q.js';
3
+ import { Readable } from 'node:stream';
4
+ import { Route, RouteMatch } from '@matthesketh/utopia-router';
5
+ import { IncomingMessage, ServerResponse } from 'node:http';
6
+ import '@matthesketh/utopia-core';
7
+
8
+ /**
9
+ * Render a component to an HTML string.
10
+ *
11
+ * @returns An object with `html` (the rendered markup) and `css` (all
12
+ * scoped styles collected during rendering).
13
+ */
14
+ declare function renderToString(component: ComponentDefinition, props?: Record<string, any>): {
15
+ html: string;
16
+ css: string;
17
+ };
18
+
19
+ /**
20
+ * Render a component to a Node.js Readable stream.
21
+ *
22
+ * The stream yields HTML chunks as the VNode tree is walked. This
23
+ * allows the server to begin flushing output before the full tree
24
+ * is serialized, reducing TTFB for large pages.
25
+ */
26
+ declare function renderToStream(component: ComponentDefinition, props?: Record<string, any>): Readable;
27
+
28
+ /**
29
+ * Match a URL string against a route table on the server.
30
+ *
31
+ * @param routes - The compiled route table
32
+ * @param url - The URL string to match (e.g. '/blog/my-post')
33
+ * @returns The matched route with params, or null
34
+ */
35
+ declare function createServerRouter(routes: Route[], url: string): RouteMatch | null;
36
+
37
+ interface HandlerOptions {
38
+ /** The HTML template with <!--ssr-outlet--> and <!--ssr-head--> markers. */
39
+ template: string;
40
+ /** Render function that produces HTML + CSS for a given URL. */
41
+ render: (url: string) => Promise<{
42
+ html: string;
43
+ css: string;
44
+ }>;
45
+ }
46
+ /**
47
+ * Create a Node.js HTTP request handler for SSR.
48
+ *
49
+ * The handler renders the component for the incoming URL and injects the
50
+ * result into the HTML template at the marker positions:
51
+ *
52
+ * - `<!--ssr-head-->` — replaced with `<style>` tags for collected CSS
53
+ * - `<!--ssr-outlet-->` — replaced with the rendered HTML
54
+ *
55
+ * @param options - Handler configuration
56
+ * @returns An `(req, res) => void` function suitable for Node's `http.createServer`
57
+ * or as Express middleware.
58
+ */
59
+ declare function createHandler(options: HandlerOptions): (req: IncomingMessage, res: ServerResponse) => void;
60
+
61
+ export { createHandler, createServerRouter, renderToStream, renderToString };
package/dist/index.js ADDED
@@ -0,0 +1,178 @@
1
+ import {
2
+ createComponent,
3
+ flushStyles
4
+ } from "./chunk-DV7AV4JO.js";
5
+
6
+ // src/render-to-string.ts
7
+ var VOID_ELEMENTS = /* @__PURE__ */ new Set([
8
+ "area",
9
+ "base",
10
+ "br",
11
+ "col",
12
+ "embed",
13
+ "hr",
14
+ "img",
15
+ "input",
16
+ "link",
17
+ "meta",
18
+ "param",
19
+ "source",
20
+ "track",
21
+ "wbr"
22
+ ]);
23
+ function escapeHtml(str) {
24
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
25
+ }
26
+ function escapeAttr(str) {
27
+ return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
28
+ }
29
+ function escapeComment(str) {
30
+ return str.replace(/--/g, "-\u200B-");
31
+ }
32
+ function serializeVNode(node) {
33
+ switch (node.type) {
34
+ case 1:
35
+ return serializeElement(node);
36
+ case 2:
37
+ return escapeHtml(node.text);
38
+ case 3:
39
+ return `<!--${escapeComment(node.text)}-->`;
40
+ }
41
+ }
42
+ function serializeElement(el) {
43
+ const tag = el.tag;
44
+ let html = `<${tag}`;
45
+ for (const [name, value] of Object.entries(el.attrs)) {
46
+ if (value === "") {
47
+ html += ` ${name}`;
48
+ } else {
49
+ html += ` ${name}="${escapeAttr(value)}"`;
50
+ }
51
+ }
52
+ if (VOID_ELEMENTS.has(tag.toLowerCase())) {
53
+ html += ">";
54
+ return html;
55
+ }
56
+ html += ">";
57
+ for (const child of el.children) {
58
+ html += serializeVNode(child);
59
+ }
60
+ html += `</${tag}>`;
61
+ return html;
62
+ }
63
+ function renderToString(component, props) {
64
+ flushStyles();
65
+ const vnode = createComponent(component, props);
66
+ const html = serializeVNode(vnode);
67
+ const styles = flushStyles();
68
+ const css = styles.join("\n");
69
+ return { html, css };
70
+ }
71
+
72
+ // src/render-to-stream.ts
73
+ import { Readable } from "stream";
74
+ var VOID_ELEMENTS2 = /* @__PURE__ */ new Set([
75
+ "area",
76
+ "base",
77
+ "br",
78
+ "col",
79
+ "embed",
80
+ "hr",
81
+ "img",
82
+ "input",
83
+ "link",
84
+ "meta",
85
+ "param",
86
+ "source",
87
+ "track",
88
+ "wbr"
89
+ ]);
90
+ function escapeHtml2(str) {
91
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
92
+ }
93
+ function escapeAttr2(str) {
94
+ return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
95
+ }
96
+ function escapeComment2(str) {
97
+ return str.replace(/--/g, "-\u200B-");
98
+ }
99
+ function renderToStream(component, props) {
100
+ flushStyles();
101
+ const vnode = createComponent(component, props);
102
+ const styles = flushStyles();
103
+ return new Readable({
104
+ read() {
105
+ if (styles.length > 0) {
106
+ this.push(`<style>${styles.join("\n")}</style>`);
107
+ }
108
+ pushVNode(this, vnode);
109
+ this.push(null);
110
+ }
111
+ });
112
+ }
113
+ function pushVNode(stream, node) {
114
+ switch (node.type) {
115
+ case 1:
116
+ pushElement(stream, node);
117
+ break;
118
+ case 2:
119
+ stream.push(escapeHtml2(node.text));
120
+ break;
121
+ case 3:
122
+ stream.push(`<!--${escapeComment2(node.text)}-->`);
123
+ break;
124
+ }
125
+ }
126
+ function pushElement(stream, el) {
127
+ let open = `<${el.tag}`;
128
+ for (const [name, value] of Object.entries(el.attrs)) {
129
+ if (value === "") {
130
+ open += ` ${name}`;
131
+ } else {
132
+ open += ` ${name}="${escapeAttr2(value)}"`;
133
+ }
134
+ }
135
+ open += ">";
136
+ stream.push(open);
137
+ if (VOID_ELEMENTS2.has(el.tag.toLowerCase())) {
138
+ return;
139
+ }
140
+ for (const child of el.children) {
141
+ pushVNode(stream, child);
142
+ }
143
+ stream.push(`</${el.tag}>`);
144
+ }
145
+
146
+ // src/server-router.ts
147
+ import { matchRoute } from "@matthesketh/utopia-router";
148
+ function createServerRouter(routes, url) {
149
+ const fullUrl = new URL(url, "http://localhost");
150
+ return matchRoute(fullUrl, routes);
151
+ }
152
+
153
+ // src/handler.ts
154
+ function createHandler(options) {
155
+ const { template, render } = options;
156
+ return async (req, res) => {
157
+ const url = req.url ?? "/";
158
+ try {
159
+ const { html, css } = await render(url);
160
+ const headInject = css ? `<style>${css}</style>` : "";
161
+ let page = template;
162
+ page = page.replace("<!--ssr-head-->", headInject);
163
+ page = page.replace("<!--ssr-outlet-->", html);
164
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
165
+ res.end(page);
166
+ } catch (err) {
167
+ console.error("[utopia] SSR render error:", err);
168
+ res.writeHead(500, { "Content-Type": "text/plain" });
169
+ res.end("Internal Server Error");
170
+ }
171
+ };
172
+ }
173
+ export {
174
+ createHandler,
175
+ createServerRouter,
176
+ renderToStream,
177
+ renderToString
178
+ };
@@ -0,0 +1,60 @@
1
+ import '@matthesketh/utopia-core';
2
+
3
+ interface VElement {
4
+ type: 1;
5
+ tag: string;
6
+ attrs: Record<string, string>;
7
+ children: VNode[];
8
+ _parent?: VElement;
9
+ }
10
+ interface VText {
11
+ type: 2;
12
+ text: string;
13
+ _parent?: VElement;
14
+ }
15
+ interface VComment {
16
+ type: 3;
17
+ text: string;
18
+ _parent?: VElement;
19
+ }
20
+ type VNode = VElement | VText | VComment;
21
+
22
+ /** Reset and return all collected styles. */
23
+ declare function flushStyles(): string[];
24
+ declare function createElement(tag: string): VElement;
25
+ declare function createTextNode(text: string): VText;
26
+ declare function createComment(text: string): VComment;
27
+ declare function setText(node: VText, value: any): void;
28
+ declare function setAttr(el: VElement, name: string, value: any): void;
29
+ declare function addEventListener(_el: VElement, _event: string, _handler: any): () => void;
30
+ declare function appendChild(parent: VElement, child: VNode): void;
31
+ declare function insertBefore(parent: VElement, node: VNode, anchor: VNode | null): void;
32
+ declare function removeNode(node: VNode): void;
33
+ declare function effect(fn: () => void | (() => void)): () => void;
34
+ declare function createEffect(fn: () => void | (() => void)): () => void;
35
+ declare function createIf(anchor: VComment, condition: () => any, renderTrue: () => VNode, renderFalse?: () => VNode): () => void;
36
+ declare function createFor<T>(anchor: VComment, list: () => T[], renderItem: (item: T, index: number) => VNode): () => void;
37
+ interface ComponentDefinition {
38
+ setup?: (props: Record<string, any>) => Record<string, any>;
39
+ render: (ctx: Record<string, any>) => VNode;
40
+ styles?: string;
41
+ }
42
+ declare function createComponent(Component: ComponentDefinition, props?: Record<string, any>, children?: Record<string, () => VNode>): VNode;
43
+ declare function createComponentInstance(definition: ComponentDefinition, props?: Record<string, any>): {
44
+ el: VNode | null;
45
+ props: Record<string, any>;
46
+ slots: Record<string, () => VNode>;
47
+ mount(_target: any): void;
48
+ unmount(): void;
49
+ };
50
+ declare function mount(component: ComponentDefinition, _target: any): {
51
+ el: VNode | null;
52
+ props: Record<string, any>;
53
+ slots: Record<string, () => VNode>;
54
+ mount(_target: any): void;
55
+ unmount(): void;
56
+ };
57
+ declare function queueJob(_fn: () => void): void;
58
+ declare function nextTick(): Promise<void>;
59
+
60
+ export { type ComponentDefinition as C, type VComment as V, type VElement as a, type VNode as b, type VText as c, addEventListener as d, appendChild as e, createComment as f, createComponent as g, createComponentInstance as h, createEffect as i, createElement as j, createFor as k, createIf as l, createTextNode as m, effect as n, flushStyles as o, insertBefore as p, mount as q, nextTick as r, queueJob as s, removeNode as t, setAttr as u, setText as v };
@@ -0,0 +1,60 @@
1
+ import '@matthesketh/utopia-core';
2
+
3
+ interface VElement {
4
+ type: 1;
5
+ tag: string;
6
+ attrs: Record<string, string>;
7
+ children: VNode[];
8
+ _parent?: VElement;
9
+ }
10
+ interface VText {
11
+ type: 2;
12
+ text: string;
13
+ _parent?: VElement;
14
+ }
15
+ interface VComment {
16
+ type: 3;
17
+ text: string;
18
+ _parent?: VElement;
19
+ }
20
+ type VNode = VElement | VText | VComment;
21
+
22
+ /** Reset and return all collected styles. */
23
+ declare function flushStyles(): string[];
24
+ declare function createElement(tag: string): VElement;
25
+ declare function createTextNode(text: string): VText;
26
+ declare function createComment(text: string): VComment;
27
+ declare function setText(node: VText, value: any): void;
28
+ declare function setAttr(el: VElement, name: string, value: any): void;
29
+ declare function addEventListener(_el: VElement, _event: string, _handler: any): () => void;
30
+ declare function appendChild(parent: VElement, child: VNode): void;
31
+ declare function insertBefore(parent: VElement, node: VNode, anchor: VNode | null): void;
32
+ declare function removeNode(node: VNode): void;
33
+ declare function effect(fn: () => void | (() => void)): () => void;
34
+ declare function createEffect(fn: () => void | (() => void)): () => void;
35
+ declare function createIf(anchor: VComment, condition: () => any, renderTrue: () => VNode, renderFalse?: () => VNode): () => void;
36
+ declare function createFor<T>(anchor: VComment, list: () => T[], renderItem: (item: T, index: number) => VNode): () => void;
37
+ interface ComponentDefinition {
38
+ setup?: (props: Record<string, any>) => Record<string, any>;
39
+ render: (ctx: Record<string, any>) => VNode;
40
+ styles?: string;
41
+ }
42
+ declare function createComponent(Component: ComponentDefinition, props?: Record<string, any>, children?: Record<string, () => VNode>): VNode;
43
+ declare function createComponentInstance(definition: ComponentDefinition, props?: Record<string, any>): {
44
+ el: VNode | null;
45
+ props: Record<string, any>;
46
+ slots: Record<string, () => VNode>;
47
+ mount(_target: any): void;
48
+ unmount(): void;
49
+ };
50
+ declare function mount(component: ComponentDefinition, _target: any): {
51
+ el: VNode | null;
52
+ props: Record<string, any>;
53
+ slots: Record<string, () => VNode>;
54
+ mount(_target: any): void;
55
+ unmount(): void;
56
+ };
57
+ declare function queueJob(_fn: () => void): void;
58
+ declare function nextTick(): Promise<void>;
59
+
60
+ export { type ComponentDefinition as C, type VComment as V, type VElement as a, type VNode as b, type VText as c, addEventListener as d, appendChild as e, createComment as f, createComponent as g, createComponentInstance as h, createEffect as i, createElement as j, createFor as k, createIf as l, createTextNode as m, effect as n, flushStyles as o, insertBefore as p, mount as q, nextTick as r, queueJob as s, removeNode as t, setAttr as u, setText as v };