@vmz/core 0.0.3 → 0.1.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.
@@ -0,0 +1,78 @@
1
+ /**
2
+ * VMZ DOM SSR / hydrate / resume — precise patches, no VDOM diff.
3
+ * Imports client DOM primitives from ./dom-core.js for tree-shakeable browser entry.
4
+ */
5
+ /**
6
+ * @param {new (props?: object) => any} Component
7
+ * @param {object} [props]
8
+ */
9
+ export declare function renderToString(Component: any, props?: {}, opts?: {}): Promise<any>;
10
+ /**
11
+ * Stream SSR via the same Direct serialize schedule as `renderToString`.
12
+ * Yields HTML chunks (open tag → children → close). Joining chunks equals `renderToString`.
13
+ * Supports AbortSignal for cancel; consumers should respect backpressure (await between chunks).
14
+ * @param {new (props?: object) => any} Component
15
+ * @param {object} [props]
16
+ * @param {{ signal?: AbortSignal, slotHtml?: string }} [opts]
17
+ * @returns {AsyncGenerator<string, void, void>}
18
+ */
19
+ export declare function renderToStream(Component: any, props?: {}, opts?: {}): AsyncGenerator<any, void, unknown>;
20
+ /**
21
+ * Live-DOM counterpart: first default `<slot>` owned by this tree, not by a nested
22
+ * `[data-vmz]` component (Button/Link labels, etc.).
23
+ * @param {Element | null | undefined} root
24
+ * @returns {Element | null}
25
+ */
26
+ export declare function findOwnedDefaultSlot(root: any): any;
27
+ /**
28
+ * Hydrate/mount a file-route page inside an optional layout chain (outer → inner).
29
+ * Mirrors SSR `slotHtml` wrapping: each layout's owned default slot becomes the
30
+ * outlet for the next layout or the page. Retains layout instances on `container`
31
+ * so SPA transitions can dispose only the page host.
32
+ * @param {new (props?: object) => any} Page
33
+ * @param {Element} container
34
+ * @param {object} [props]
35
+ * @param {Array<new (props?: object) => any>} [layoutCtors] outer → inner
36
+ * @param {{ preserveState?: boolean | Record<string, unknown>, skipOnMount?: boolean }} [opts]
37
+ */
38
+ export declare function hydrateRoute(Page: any, container: any, props?: {}, layoutCtors?: any[], opts?: {}): Promise<any>;
39
+ /**
40
+ * SPA same-layout transition: dispose only the page host, keep layout instances.
41
+ * Callers must verify `data-vmz-layout` is unchanged before using this.
42
+ * @param {new (props?: object) => any} Page
43
+ * @param {Element} container `#app` that already has `__vmzPageHost` / `__vmzLayoutInsts`
44
+ * @param {object} [props]
45
+ * @param {{ preserveState?: boolean | Record<string, unknown>, skipOnMount?: boolean }} [opts]
46
+ */
47
+ export declare function hydrateRoutePage(Page: any, container: any, props?: {}, opts?: {}): Promise<any>;
48
+ /**
49
+ * resume: attach to existing Island DOM without re-running construct structure or onMount.
50
+ * Consumes ResumeEntry product (`data-vmz-resume`) derived from the same Execution Plan.
51
+ * @param {new (props?: object) => any} Component
52
+ * @param {HTMLElement} container
53
+ * @param {{ props?: object, state?: Record<string, unknown>, strategy?: string } | null} [slice]
54
+ */
55
+ export declare function resume(Component: any, container: any, slice?: any): Promise<any>;
56
+ /**
57
+ * Resume all `[data-vmz-island]` hosts (prefer ResumeEntry / EventEntry over mount).
58
+ * Event strategy islands wait for the DOM event before attach (lazy EventEntry).
59
+ * @param {ParentNode} [root]
60
+ */
61
+ export declare function resumeIslands(root?: Document): void;
62
+ /**
63
+ * EventEntry attach: only wire `client:event` / `client:event:*` islands.
64
+ * Idle/load/visible ResumeEntries are left alone (static shell can defer framework work).
65
+ * @param {ParentNode} [root]
66
+ */
67
+ export declare function attachEventEntries(root?: Document): void;
68
+ /**
69
+ * @param {new (props?: object) => any} Component
70
+ * @param {HTMLElement} container
71
+ * @param {object} [props]
72
+ * @param {{ preserveState?: boolean | Record<string, unknown>, skipOnMount?: boolean }} [opts]
73
+ */
74
+ export declare function hydrate(Component: any, container: any, props?: {}, opts?: {}): Promise<any>;
75
+ /**
76
+ * @param {ParentNode} [root]
77
+ */
78
+ export declare function hydrateIslands(root?: Document): void;