what-core 0.14.0 → 0.15.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/LICENSE +21 -0
- package/README.md +64 -38
- package/a11y.d.ts +128 -0
- package/data.d.ts +294 -0
- package/dist/a11y.js +510 -0
- package/dist/a11y.min.js +413 -0
- package/dist/actions.js +158 -0
- package/dist/actions.min.js +112 -0
- package/dist/animation.js +481 -0
- package/dist/animation.min.js +295 -0
- package/dist/async.js +180 -0
- package/dist/async.min.js +134 -0
- package/dist/components.js +577 -0
- package/dist/components.min.js +413 -0
- package/dist/data.js +1212 -0
- package/dist/data.min.js +918 -0
- package/dist/diagnostics.js +187 -0
- package/dist/diagnostics.min.js +134 -0
- package/dist/dom.js +796 -0
- package/dist/dom.min.js +603 -0
- package/dist/entries/a11y.js +43 -0
- package/dist/entries/a11y.min.js +43 -0
- package/dist/entries/data.js +29 -0
- package/dist/entries/data.min.js +29 -0
- package/dist/entries/dom.js +45 -0
- package/dist/entries/dom.min.js +45 -0
- package/dist/entries/form.js +31 -0
- package/dist/entries/form.min.js +31 -0
- package/dist/entries/internal.js +123 -0
- package/dist/entries/internal.min.js +123 -0
- package/dist/entries/motion.js +23 -0
- package/dist/entries/motion.min.js +23 -0
- package/dist/entries/ui.js +25 -0
- package/dist/entries/ui.min.js +25 -0
- package/dist/env.js +5 -0
- package/dist/env.min.js +5 -0
- package/dist/errors.js +1518 -0
- package/dist/errors.min.js +548 -0
- package/dist/form.js +936 -0
- package/dist/form.min.js +703 -0
- package/dist/guardrails.js +84 -0
- package/dist/guardrails.min.js +55 -0
- package/dist/h.js +232 -0
- package/dist/h.min.js +171 -0
- package/dist/head.js +241 -0
- package/dist/head.min.js +207 -0
- package/dist/helpers.js +126 -0
- package/dist/helpers.min.js +98 -0
- package/dist/hooks.js +255 -0
- package/dist/hooks.min.js +153 -0
- package/dist/hot.js +215 -0
- package/dist/hot.min.js +24 -0
- package/dist/hydration-data.js +495 -0
- package/dist/hydration-data.min.js +371 -0
- package/dist/import-changes.js +273 -0
- package/dist/import-changes.min.js +272 -0
- package/dist/index.js +95 -0
- package/dist/index.min.js +95 -227
- package/dist/jsx-dev-runtime.js +10 -0
- package/dist/jsx-dev-runtime.min.js +10 -1
- package/dist/jsx-runtime.js +27 -0
- package/dist/jsx-runtime.min.js +15 -1
- package/dist/live.js +54 -0
- package/dist/live.min.js +49 -0
- package/dist/markup-rules.js +250 -0
- package/dist/markup-rules.min.js +213 -0
- package/dist/reactive.js +3334 -0
- package/dist/reactive.min.js +2033 -0
- package/dist/render.js +4746 -0
- package/dist/render.min.js +2797 -1
- package/dist/scheduler.js +225 -0
- package/dist/scheduler.min.js +162 -0
- package/dist/selector.js +11 -0
- package/dist/selector.min.js +10 -0
- package/dist/server-context.js +148 -0
- package/dist/server-context.min.js +121 -0
- package/dist/skeleton.js +342 -0
- package/dist/skeleton.min.js +310 -0
- package/dist/store.js +72 -0
- package/dist/store.min.js +50 -0
- package/dist/testing.js +720 -0
- package/dist/testing.min.js +458 -1
- package/dist/vnode-adoption.js +19 -0
- package/dist/vnode-adoption.min.js +19 -0
- package/dist/vnode-renderer.js +61 -0
- package/dist/vnode-renderer.min.js +47 -0
- package/dom.d.ts +44 -0
- package/form.d.ts +218 -0
- package/hot.d.ts +35 -0
- package/index.d.ts +421 -736
- package/internal.d.ts +284 -0
- package/jsx-runtime.d.ts +160 -137
- package/markup-rules.d.ts +83 -0
- package/motion.d.ts +156 -0
- package/package.json +117 -3
- package/render.d.ts +278 -29
- package/src/a11y.js +64 -59
- package/src/actions.js +226 -0
- package/src/animation.js +105 -57
- package/src/async.js +259 -0
- package/src/components.js +495 -144
- package/src/data.js +1410 -1159
- package/src/diagnostics.js +263 -0
- package/src/dom.js +1159 -872
- package/src/entries/a11y.js +24 -0
- package/src/entries/data.js +17 -0
- package/src/entries/dom.js +29 -0
- package/src/entries/form.js +16 -0
- package/src/entries/internal.js +63 -0
- package/src/entries/motion.js +13 -0
- package/src/entries/ui.js +13 -0
- package/src/env-development.js +12 -0
- package/src/env.js +33 -0
- package/src/errors.js +1144 -168
- package/src/form.js +723 -225
- package/src/guardrails.js +38 -126
- package/src/h.js +227 -152
- package/src/head.js +189 -19
- package/src/helpers.js +47 -75
- package/src/hooks.js +233 -248
- package/src/hot.js +316 -0
- package/src/hydration-data.js +859 -16
- package/src/import-changes.js +156 -0
- package/src/index.js +38 -188
- package/src/jsx-dev-runtime.js +7 -14
- package/src/jsx-runtime.js +25 -9
- package/src/live.js +80 -0
- package/src/markup-rules.js +387 -0
- package/src/reactive.js +4400 -862
- package/src/render.js +6502 -2570
- package/src/scheduler.js +56 -21
- package/src/selector.js +31 -0
- package/src/server-context.js +252 -22
- package/src/skeleton.js +22 -12
- package/src/store.js +17 -31
- package/src/testing.js +389 -63
- package/src/vnode-adoption.js +48 -0
- package/src/vnode-renderer.js +114 -0
- package/testing.d.ts +81 -1
- package/ui.d.ts +20 -0
- package/dist/chunk-6YOUZ6T4.min.js +0 -1
- package/dist/chunk-FN6HXME3.min.js +0 -11
- package/dist/chunk-VKZY7JPN.min.js +0 -1
- package/src/agent-context.js +0 -127
- package/src/warnings.js +0 -193
package/internal.d.ts
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
// what-core/internal: what what-core shares with its sibling packages and tools
|
|
2
|
+
// (what-server, what-devtools, what-devtools-mcp). Not for applications, and
|
|
3
|
+
// not covered by semver.
|
|
4
|
+
import type { DiagnosticEvent, DiagnosticSubject, ErrorCodeDefinition, ServerResponse, VNode, WhatError } from './index.js';
|
|
5
|
+
export { getDiagnostics, subscribeDiagnostics } from './index.js';
|
|
6
|
+
|
|
7
|
+
// --- Devtools ---
|
|
8
|
+
|
|
9
|
+
/** @internal Installs the devtools hooks the reactive engine calls in development. */
|
|
10
|
+
export function __setDevToolsHooks(hooks: Record<string, unknown> | null): void;
|
|
11
|
+
/** @internal Hands devtools what was created before they installed, then clears it. */
|
|
12
|
+
export function __drainPreinstallBuffer(): { signals: unknown[]; effects: unknown[]; components: unknown[]; dropped?: Record<string, number> };
|
|
13
|
+
/** @internal Emits a development action event. */
|
|
14
|
+
export function _devAction(data: { name: string; outcome: "ok" | "error"; invalidated: string[]; revalidated: string[] }): void;
|
|
15
|
+
/** @internal The sources a computation reads (development only; empty in production). */
|
|
16
|
+
export function __depsOf(node: unknown): unknown[];
|
|
17
|
+
/** @internal The computations that read a source (development only; empty in production). */
|
|
18
|
+
export function __subsOf(node: unknown): unknown[];
|
|
19
|
+
/** @internal The effect running now, or null (development only). */
|
|
20
|
+
export function __currentEffect(): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* @internal The owner of an effect or computed node (or computed function), of
|
|
23
|
+
* an owner, or of a DOM node: the component whose output holds it (development
|
|
24
|
+
* only; null in production).
|
|
25
|
+
*/
|
|
26
|
+
export function __ownerOf(node: unknown): unknown;
|
|
27
|
+
/**
|
|
28
|
+
* @internal The scopes holding `node`, root first: `'<App>'`, `'<TodoRow>'`,
|
|
29
|
+
* `'effect "sync"'`. `loc` is the innermost source location the compiler
|
|
30
|
+
* supplied, else null (development only; empty in production).
|
|
31
|
+
*/
|
|
32
|
+
export function __ownerPath(node: unknown): string[] & { loc: string | null };
|
|
33
|
+
/** @internal The query cache, for what-devtools-mcp's what_cache. */
|
|
34
|
+
export function __getCacheSnapshot(): Array<{
|
|
35
|
+
key: string;
|
|
36
|
+
kind: 'query' | 'infinite';
|
|
37
|
+
status: 'idle' | 'loading' | 'refreshing' | 'success' | 'error';
|
|
38
|
+
data: unknown;
|
|
39
|
+
error: string | null;
|
|
40
|
+
isValidating: boolean;
|
|
41
|
+
observers: number;
|
|
42
|
+
updatedAt: number | null;
|
|
43
|
+
fetches: number;
|
|
44
|
+
lastFetch: { at: number; ms: number; ok: boolean } | null;
|
|
45
|
+
version: number;
|
|
46
|
+
paths: string[];
|
|
47
|
+
}>;
|
|
48
|
+
/** @internal what_invalidate_cache: invalidate the entries under `key` (every entry when omitted); returns the keys matched. */
|
|
49
|
+
export function __invalidateFromDevtools(key?: string | readonly unknown[]): string[];
|
|
50
|
+
/** @internal what-server: the keys (`query:KEY`) of the landed entries render context `ctx`'s loader filled; that render's hooks show them. */
|
|
51
|
+
export function _loadedQueries(ctx: object): string[];
|
|
52
|
+
/** @internal what-router: run `fn`, tagging the entries its queries read with `path` for invalidatePath(path). */
|
|
53
|
+
export function _tagQueries<T>(path: string, fn: () => T): T;
|
|
54
|
+
/** @internal what-router: run `fn` outside the running transition, so what it writes shows at once. */
|
|
55
|
+
export function _urgent(fn: () => void): void;
|
|
56
|
+
/** @internal what-router: the transition whose function is running, or null. */
|
|
57
|
+
export function _currentTransition(): object | null;
|
|
58
|
+
/** @internal what-router: run `fn` inside transition `t`'s commit. */
|
|
59
|
+
export function _onCommit(t: object, fn: () => void): void;
|
|
60
|
+
/** @internal what-router: resolves once no query read on `path` is fetching its first value. */
|
|
61
|
+
export function _pathLoaded(path: string): Promise<void>;
|
|
62
|
+
/** @internal what-router: the context map of the nearest owner above the current one that provides `key` (with _provide), or null. */
|
|
63
|
+
export function _contextOf(key: unknown): Map<unknown, unknown> | null;
|
|
64
|
+
/** @internal what-router: provide `value` under `key` on the current owner, for what it owns to find with _contextOf. */
|
|
65
|
+
export function _provide(key: unknown, value: unknown): void;
|
|
66
|
+
/** @internal Whether this is a development build: false in a production bundle, where the branches it guards fold away. */
|
|
67
|
+
export const __DEV__: boolean;
|
|
68
|
+
/** @internal what-server's <Form>: the context its status is provided in. */
|
|
69
|
+
export function _formStatusContext(): any;
|
|
70
|
+
/** @internal what-server's <Form>: a form's status, with `submit(formData, run, reset)` running one submission as a transition, and `reset()` at its commit if the submission succeeded. */
|
|
71
|
+
export function _formStatus(method: string | null, action: unknown): import('./index.js').FormStatus & {
|
|
72
|
+
submit(formData: FormData, run: (formData: FormData) => unknown, reset: () => void): Promise<void>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export interface DiagnosticDetail {
|
|
76
|
+
data?: Record<string, any>;
|
|
77
|
+
subject?: DiagnosticSubject | null;
|
|
78
|
+
owner?: string[];
|
|
79
|
+
loc?: string | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Report a diagnostic by its ERR_* code. Call it only behind a development check. */
|
|
83
|
+
export function reportDiagnostic(code: string, detail?: DiagnosticDetail): DiagnosticEvent;
|
|
84
|
+
/**
|
|
85
|
+
* Development: the message of an error thrown with a catalogue code, in the
|
|
86
|
+
* shape the console prints a reported one: `[what] <code> <message>`, then the
|
|
87
|
+
* line naming its fix.
|
|
88
|
+
*/
|
|
89
|
+
export function _thrownMessage(code: string, message: string): string;
|
|
90
|
+
|
|
91
|
+
// --- Guardrails ---
|
|
92
|
+
|
|
93
|
+
export interface GuardrailConfig {
|
|
94
|
+
importValidation: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function configureGuardrails(overrides: Partial<GuardrailConfig>): void;
|
|
98
|
+
export function getGuardrailConfig(): GuardrailConfig;
|
|
99
|
+
|
|
100
|
+
export interface InvalidImport {
|
|
101
|
+
name: string;
|
|
102
|
+
message: string;
|
|
103
|
+
suggestion: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Report import names that are not valid exports of what-framework. Dev-mode only. */
|
|
107
|
+
export function validateImports(importNames: readonly string[]): InvalidImport[];
|
|
108
|
+
|
|
109
|
+
// --- Error catalogue ---
|
|
110
|
+
|
|
111
|
+
export const ERROR_CODES: Record<string, ErrorCodeDefinition>;
|
|
112
|
+
|
|
113
|
+
export function createWhatError(
|
|
114
|
+
errorCode: string | ErrorCodeDefinition,
|
|
115
|
+
context?: Record<string, any>,
|
|
116
|
+
): WhatError;
|
|
117
|
+
export function classifyError(err: unknown, context?: Record<string, any>): WhatError;
|
|
118
|
+
|
|
119
|
+
// --- Import changes ---
|
|
120
|
+
|
|
121
|
+
/** Where a name the root entry dropped in 0.15 went. `to` is null when it was removed. */
|
|
122
|
+
export interface ImportChange {
|
|
123
|
+
name: string;
|
|
124
|
+
to: string | null;
|
|
125
|
+
as?: string;
|
|
126
|
+
note: string;
|
|
127
|
+
/** What an import of `name` from the root entry is told: the note, then the import to write. */
|
|
128
|
+
answer: string;
|
|
129
|
+
/** A name the root entry exports again with React's meaning: only an import of `as` from it is answered. */
|
|
130
|
+
onRoot?: true;
|
|
131
|
+
/** An internal interface new in 0.15 that the root entry never exported. */
|
|
132
|
+
neverOnRoot?: true;
|
|
133
|
+
}
|
|
134
|
+
export const IMPORT_CHANGES: readonly ImportChange[];
|
|
135
|
+
/** Where each name a subpath exports, and the root entry never did, lives (`Router` in what-framework/router). */
|
|
136
|
+
export const SUBPATH_ONLY: readonly ImportChange[];
|
|
137
|
+
|
|
138
|
+
// --- Server context ---
|
|
139
|
+
|
|
140
|
+
/** Per-render head accumulator used by the SSR renderer. */
|
|
141
|
+
export interface HeadSink {
|
|
142
|
+
title: string | null;
|
|
143
|
+
metas: Map<string, Record<string, string>>;
|
|
144
|
+
links: Map<string, Record<string, string>>;
|
|
145
|
+
hoisted?: Map<string, string>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function beginHeadCollection(): HeadSink;
|
|
149
|
+
export function endHeadCollection(sink: HeadSink | null): string;
|
|
150
|
+
|
|
151
|
+
/** A resource's state in a render context: pending, settled with a value, or failed. */
|
|
152
|
+
export type ServerResourceEntry =
|
|
153
|
+
| { status: 'pending'; promise: Promise<void>; owner?: string }
|
|
154
|
+
| { status: 'ready'; value: unknown; owner?: string }
|
|
155
|
+
| { status: 'error'; error: unknown; owner?: string };
|
|
156
|
+
|
|
157
|
+
export interface ServerContext {
|
|
158
|
+
loaderData?: any;
|
|
159
|
+
head?: HeadSink;
|
|
160
|
+
/** Resources created with a `key`, by key. */
|
|
161
|
+
resources?: Map<string, ServerResourceEntry>;
|
|
162
|
+
/** Keyless resources, by owner key; `owner` names the component that made each. */
|
|
163
|
+
owned?: Map<string, ServerResourceEntry>;
|
|
164
|
+
/** Island stores of this render, by name. */
|
|
165
|
+
islandStores?: Map<string, any>;
|
|
166
|
+
/** Aborts when the render stops: the client went away or the stream's consumer stopped reading. */
|
|
167
|
+
signal?: AbortSignal;
|
|
168
|
+
request?: any;
|
|
169
|
+
response?: ServerResponse;
|
|
170
|
+
/** The path the render's app is served below ('/app'), or '': what-router renders below it when the app set no base of its own. */
|
|
171
|
+
base?: string;
|
|
172
|
+
/** The nonce of a Content Security Policy the render's scripts carry (the renderer's `nonce` option), which what-react writes on its form capture script. */
|
|
173
|
+
nonce?: string;
|
|
174
|
+
/** The reactive root that owns every effect and computed this render's components create. */
|
|
175
|
+
owner?: unknown;
|
|
176
|
+
[key: string]: any;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** The active render context, or null on the client / outside a render. */
|
|
180
|
+
export function getServerContext(): ServerContext | null;
|
|
181
|
+
/** Set the active context and return the previous one so callers can restore it. */
|
|
182
|
+
export function setServerContext(ctx: ServerContext | null): ServerContext | null;
|
|
183
|
+
export function runWithServerContext<T>(ctx: ServerContext, fn: () => T): T;
|
|
184
|
+
|
|
185
|
+
// --- Server rendering ---
|
|
186
|
+
// Underscore-prefixed names are declared even though `hygiene:types` skips them
|
|
187
|
+
// in its reverse direction, because what-server imports them across the package
|
|
188
|
+
// boundary, and an undeclared cross-package import is exactly the rename that
|
|
189
|
+
// ships broken.
|
|
190
|
+
|
|
191
|
+
/** @internal Used by what-server. True for `role` and `aria-*` attribute names. */
|
|
192
|
+
export function _isAriaAttr(name: string): boolean;
|
|
193
|
+
/** @internal Used by what-server. Makes an SSR component frame (an owner) current and returns it. */
|
|
194
|
+
export function _beginComponentSSR(...args: unknown[]): { _parentCtx: unknown; [key: string]: unknown };
|
|
195
|
+
/** @internal Used by what-server. Restores the owner that was current before `_beginComponentSSR`. */
|
|
196
|
+
export function _endComponentSSR(...args: unknown[]): unknown;
|
|
197
|
+
/** @internal Used by what-server. Runs one synchronous call with an SSR component frame as the owner. */
|
|
198
|
+
export function _runInComponentSSR(...args: unknown[]): unknown;
|
|
199
|
+
/** @internal Used by what-server. Escapes `& < > " '` for HTML text and attribute values. */
|
|
200
|
+
export function _escapeHtml(str: string): string;
|
|
201
|
+
/** @internal Used by what-server. Gives an SSR component frame its owner path (hydration keys); false for a built-in the compiler lowers away, which takes no step and no key. */
|
|
202
|
+
export function _assignOwnerPath(...args: unknown[]): boolean;
|
|
203
|
+
/** @internal Used by what-server. The object that counts a frame's child components and keyless resources (its parent's for a lowered built-in). */
|
|
204
|
+
export function _ownerCounter(frame: unknown, root: unknown): { _ownerChildren?: number; _ownerResources?: number; [key: string]: unknown };
|
|
205
|
+
/** @internal Used by what-server. The owner path of the component frame running now, or undefined. */
|
|
206
|
+
export function _currentOwnerPath(): string | undefined;
|
|
207
|
+
/** @internal Used by what-server. The async computed run behind `err` when `err` is what a read of a value that failed threw just now, else null. */
|
|
208
|
+
export function _errorSource(err: unknown): { node: unknown; run: number } | null;
|
|
209
|
+
/** @internal Used by what-server. A server error record (`{ message, code? }`) as the Error the client makes of it. */
|
|
210
|
+
export function _errorFromRecord(record: { message?: string; code?: string } | null | undefined): Error;
|
|
211
|
+
/** @internal Used by what-server. The identity of the server action's useActionState being made now, written under a salt: the keys of the keyed rows around it (as digests) and its place below the innermost, or its owner path and its place in the component when no keyed row is around it. The same on the server and while hydrating; null elsewhere. */
|
|
212
|
+
export function _actionStateKey(): (((salt: string | null) => string) & { salted: boolean }) | null;
|
|
213
|
+
/** @internal Used by what-server. The salt an action-state key was made under, or null. */
|
|
214
|
+
export function _actionKeySalt(key: unknown): string | null;
|
|
215
|
+
/** @internal Used by what-server's <Island>. The keyed rows around the component rendering now and its steps below them, under `salt`, or null. */
|
|
216
|
+
export function _currentRowPath(salt: string): string | null;
|
|
217
|
+
/** @internal Used by what-server's renderers. A keyed row begins in the output of `frame` (undefined: the current component; null: the root `root`), or with a null `list` and a number `key` the slot of that member of the children being walked; returns what _leaveRow puts back. */
|
|
218
|
+
export function _enterRow(frame: object | null | undefined, root: object, list: object | null, key: unknown, index?: number): unknown;
|
|
219
|
+
/** @internal Used by what-server's renderers. Whether keyed rows are installed: the renderers enter slots only then. */
|
|
220
|
+
export function _tracksRows(): boolean;
|
|
221
|
+
/** @internal Used by what-server's action(). Hydration enters keyed rows from now on, for useActionState keys. */
|
|
222
|
+
export function _installRowKeys(): void;
|
|
223
|
+
/** @internal Used by what-server's renderers. The row or slot _enterRow entered is done. */
|
|
224
|
+
export function _leaveRow(frame: object | null | undefined, root: object, saved: unknown): void;
|
|
225
|
+
/** @internal Used by what-server. The salt the render running now writes its keyed rows' digests under. */
|
|
226
|
+
export function _renderSalt(): string;
|
|
227
|
+
/** @internal Used by what-server. The hydration data merged from the page's data elements, or null. */
|
|
228
|
+
export function __readHydrationData(): Record<string, any> | null;
|
|
229
|
+
/** Whether a hydrate() walk is claiming the server's DOM now (what-framework/render's isHydrating). */
|
|
230
|
+
export function isHydrating(): boolean;
|
|
231
|
+
/** While hydrating: the server's region at the cursor, taken whole for another renderer ([open, close] markers), or null. */
|
|
232
|
+
export function _claimRegion(): [Comment, Comment] | null;
|
|
233
|
+
/** Run `fn` once the hydration walking now is done; false when none is. */
|
|
234
|
+
export function _afterWalk(fn: () => void): boolean;
|
|
235
|
+
/** @internal Used by what-react. The namespace compiled JSX placed the code running now in (an <svg> or <math> around a component call), or null. */
|
|
236
|
+
export function _placedNamespace(): string | null;
|
|
237
|
+
/** @internal Used by what-react. The tags only SVG has (`g`, `path`, `clipPath`, in any case). */
|
|
238
|
+
export const _svgOnlyTag: RegExp;
|
|
239
|
+
/** Development: the component running now holds state outside What's signals (what-react's islands), for ERR_REBUILT_COMPONENT. */
|
|
240
|
+
export function _devHoldsState(): void;
|
|
241
|
+
/** Development: the region running now shows something else than its last run did (what-router's next route), for ERR_REBUILT_COMPONENT. */
|
|
242
|
+
export function _devNewContent(): void;
|
|
243
|
+
/** Development: what made `sig` no longer holds it (what-router's replaced view), so devtools stop listing it; a later write lists it again. */
|
|
244
|
+
export function _devDropped(sig: () => unknown): void;
|
|
245
|
+
/** Development: what `render()` returns, built once and kept in `holder` under `key` across a hot update of what holds it (what-router's page inside an edited layout); `render()`'s value as it is without the dev server's hot runtime. */
|
|
246
|
+
export function _hotKeep(holder: object, key: unknown, render: () => unknown): unknown;
|
|
247
|
+
/**
|
|
248
|
+
* Whether `value` is a vnode made by h(), the JSX runtime or a boundary: the
|
|
249
|
+
* private brand those producers give it, which JSON, structuredClone and
|
|
250
|
+
* proxies cannot carry. Every renderer decides "element or text" by this.
|
|
251
|
+
*/
|
|
252
|
+
export function isVNode(value: unknown): value is VNode<any>;
|
|
253
|
+
/** @internal Development: a Symbol given as a child, which renders nothing (ERR_SYMBOL_CHILD), dropped on `path`. */
|
|
254
|
+
export function _symbolChild(value: symbol, path: 'client' | 'server' | 'hydration'): void;
|
|
255
|
+
/** @internal Used by what-server. The keyed-array mapping `<For>` compiles down to. */
|
|
256
|
+
export function _mapArrayToArray(...args: unknown[]): unknown;
|
|
257
|
+
/** @internal Used by what-server. A vnode whose key is a signal, as the reactive child every renderer renders it as: the vnode keyed by the key's value, which a region keeps as the one row of a keyed list, built again whenever the value changes. */
|
|
258
|
+
export function _signalKeyed(vnode: unknown): () => unknown;
|
|
259
|
+
/** @internal Used by what-server. A keyed list row key's digest under a render's salt, as the server writes it and hydrate() compares it; null for a key that is not a string or a finite number. */
|
|
260
|
+
export function _rowKeyDigest(key: unknown, salt: string): string | null;
|
|
261
|
+
/** @internal Used by what-server's <Form>. Resets a form as React 19 does after a successful action: uncontrolled fields to their defaults, controlled ones to what their props hold. */
|
|
262
|
+
export function _resetForm(form: HTMLFormElement, onError: (error: unknown) => void): void;
|
|
263
|
+
/** @internal Used by what-server. A form's member read from its prototype (a method bound to the form), so a control named after the member cannot stand in for it. */
|
|
264
|
+
export function _formMember<K extends keyof HTMLFormElement>(form: HTMLFormElement, name: K): HTMLFormElement[K];
|
|
265
|
+
/** @internal Used by what-react. The client renderer a '__portal' vnode carries as its `mount` prop: builds the vnode's children into `props.container` and returns the placeholder comment. */
|
|
266
|
+
export function _mountPortal(vnode: VNode<any>, parent?: Node): Comment;
|
|
267
|
+
/** @internal Used by what-server. Installs the AsyncLocalStorage backends: one carries a render's context past an `await`, the other an async component's frame. */
|
|
268
|
+
export function __installServerContextStorage(storage: unknown, frames?: unknown): void;
|
|
269
|
+
/** @internal Used by what-server. Calls a server component's function in its frame, so that its code after an `await` keeps the frame as its owner. */
|
|
270
|
+
export function _runComponentAsync<A, T>(frame: unknown, fn: (arg: A) => T, arg: A): T;
|
|
271
|
+
/** @internal Used by what-server. Calls a server component's function in its frame, synchronously (renderToString). */
|
|
272
|
+
export function _runComponentSync<A, T>(frame: unknown, fn: (arg: A) => T, arg: A): T;
|
|
273
|
+
/** @internal Used by what-server. Marks a process that renders on the server with no document: outside a render, the query cache shares nothing. */
|
|
274
|
+
export function __markServerProcess(): void;
|
|
275
|
+
/** @internal Used by what-router. Whether code outside a render runs on a server: a process what-server marked, unless it had a document then and has AsyncLocalStorage. */
|
|
276
|
+
export function _isServerProcess(): boolean;
|
|
277
|
+
/** @internal Used by what-server. Runs waiting effect re-runs with no render context visible. */
|
|
278
|
+
export function __flushOutsideServerContext(): void;
|
|
279
|
+
/** @internal Used by what-server. Runs `fn` with no render context visible and no reactive owner. */
|
|
280
|
+
export function __outsideServerContext<T>(fn: () => T): T;
|
|
281
|
+
/** @internal Used by what-server. This copy of what-core's engine: a render context's `rootFor(engine)` returns the render's root for the copy that made it, and a root of its own, disposed with the render, for any other copy. */
|
|
282
|
+
export const _engine: { root(): unknown; dispose(root: unknown): void };
|
|
283
|
+
/** @internal Used by what-server's tests. Drops the cached hydration payload. */
|
|
284
|
+
export function __resetHydrationData(): void;
|