sygnal 7.0.0 → 7.2.0-preview.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/CHANGELOG.md +632 -0
- package/dist/agent-ui.cjs.js +592 -0
- package/dist/agent-ui.cjs.js.map +1 -0
- package/dist/agent-ui.esm.js +582 -0
- package/dist/agent-ui.esm.js.map +1 -0
- package/dist/api.cjs.js +63 -0
- package/dist/api.cjs.js.map +1 -0
- package/dist/api.esm.js +2 -0
- package/dist/api.esm.js.map +1 -0
- package/dist/astro/index.cjs.js +968 -4
- package/dist/astro/index.cjs.js.map +1 -1
- package/dist/astro/index.mjs +968 -4
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/server.cjs.js +73 -45
- package/dist/astro/server.cjs.js.map +1 -1
- package/dist/astro/server.mjs +73 -45
- package/dist/astro/server.mjs.map +1 -1
- package/dist/canvas.cjs.js +2919 -0
- package/dist/canvas.cjs.js.map +1 -0
- package/dist/canvas.esm.js +2866 -0
- package/dist/canvas.esm.js.map +1 -0
- package/dist/devtools.cjs.js +38 -6
- package/dist/devtools.cjs.js.map +1 -1
- package/dist/devtools.esm.js +38 -6
- package/dist/devtools.esm.js.map +1 -1
- package/dist/diagnostics.cjs.js +224 -20
- package/dist/diagnostics.cjs.js.map +1 -1
- package/dist/diagnostics.esm.js +224 -20
- package/dist/diagnostics.esm.js.map +1 -1
- package/dist/guide/accessibility.md +1 -1
- package/dist/guide/ai-compose.md +150 -0
- package/dist/guide/behaviors.md +2 -1
- package/dist/guide/collaborative-state.md +265 -0
- package/dist/guide/element-commands.md +36 -2
- package/dist/guide/forms-reference.md +5 -5
- package/dist/guide/forms.md +3 -2
- package/dist/guide/http.md +28 -1
- package/dist/guide/islands.md +240 -0
- package/dist/guide/recipes/code-editor.md +1 -1
- package/dist/guide/renderers/agent-ui.md +138 -0
- package/dist/guide/renderers/custom-targets.md +126 -0
- package/dist/guide/renderers/overview.md +120 -0
- package/dist/guide/renderers/react-native.md +128 -0
- package/dist/guide/renderers/terminal.md +306 -0
- package/dist/guide/renderers/three.md +332 -0
- package/dist/guide/renderers/write-once.md +137 -0
- package/dist/guide/resources.md +2 -0
- package/dist/guide/sandboxed-components.md +223 -0
- package/dist/guide/timers.md +32 -5
- package/dist/guide/typed-apis.md +442 -0
- package/dist/guide/ui/accordion.md +11 -0
- package/dist/guide/ui/combobox.md +112 -8
- package/dist/guide/ui/dialog.md +96 -20
- package/dist/guide/ui/menu.md +57 -5
- package/dist/guide/ui/overview.md +8 -4
- package/dist/guide/ui/popover.md +69 -9
- package/dist/guide/ui/select.md +54 -4
- package/dist/guide/ui/tabs.md +1 -1
- package/dist/guide/ui/tooltip.md +7 -5
- package/dist/guide/virtual-collections.md +3 -0
- package/dist/guide/widgets.md +90 -1
- package/dist/host.cjs.js +2181 -0
- package/dist/host.cjs.js.map +1 -0
- package/dist/host.esm.js +2146 -0
- package/dist/host.esm.js.map +1 -0
- package/dist/index.cjs.js +3948 -586
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +584 -44
- package/dist/index.esm.js +3918 -586
- package/dist/index.esm.js.map +1 -1
- package/dist/primitives.cjs.js +143 -0
- package/dist/primitives.cjs.js.map +1 -0
- package/dist/primitives.esm.js +133 -0
- package/dist/primitives.esm.js.map +1 -0
- package/dist/react-native.cjs.js +248 -0
- package/dist/react-native.cjs.js.map +1 -0
- package/dist/react-native.esm.js +244 -0
- package/dist/react-native.esm.js.map +1 -0
- package/dist/replay.cjs.js +39 -0
- package/dist/replay.cjs.js.map +1 -0
- package/dist/replay.esm.js +2 -0
- package/dist/replay.esm.js.map +1 -0
- package/dist/sandbox-build.cjs.js +140 -0
- package/dist/sandbox-build.cjs.js.map +1 -0
- package/dist/sandbox-build.esm.js +137 -0
- package/dist/sandbox-build.esm.js.map +1 -0
- package/dist/sandbox-kernel.esm.js +212 -0
- package/dist/sandbox-kernel.esm.js.map +1 -0
- package/dist/sandbox-worker.cjs.js +857 -0
- package/dist/sandbox-worker.cjs.js.map +1 -0
- package/dist/sandbox-worker.esm.js +854 -0
- package/dist/sandbox-worker.esm.js.map +1 -0
- package/dist/sandbox.cjs.js +1425 -0
- package/dist/sandbox.cjs.js.map +1 -0
- package/dist/sandbox.esm.js +1406 -0
- package/dist/sandbox.esm.js.map +1 -0
- package/dist/sygnal.min.js +1 -1
- package/dist/sygnal.min.js.map +1 -1
- package/dist/terminal.cjs.js +1314 -0
- package/dist/terminal.cjs.js.map +1 -0
- package/dist/terminal.esm.js +1304 -0
- package/dist/terminal.esm.js.map +1 -0
- package/dist/three.cjs.js +1111 -0
- package/dist/three.cjs.js.map +1 -0
- package/dist/three.esm.js +1079 -0
- package/dist/three.esm.js.map +1 -0
- package/dist/ui-combobox.cjs.js +256 -18
- package/dist/ui-combobox.cjs.js.map +1 -1
- package/dist/ui-combobox.esm.js +256 -18
- package/dist/ui-combobox.esm.js.map +1 -1
- package/dist/ui-menu.cjs.js +150 -16
- package/dist/ui-menu.cjs.js.map +1 -1
- package/dist/ui-menu.esm.js +151 -17
- package/dist/ui-menu.esm.js.map +1 -1
- package/dist/ui-select.cjs.js +95 -9
- package/dist/ui-select.cjs.js.map +1 -1
- package/dist/ui-select.esm.js +95 -9
- package/dist/ui-select.esm.js.map +1 -1
- package/dist/ui.cjs.js +679 -173
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.esm.js +679 -175
- package/dist/ui.esm.js.map +1 -1
- package/dist/vike/config/package.json +1 -1
- package/dist/vite/plugin.cjs.js +968 -4
- package/dist/vite/plugin.cjs.js.map +1 -1
- package/dist/vite/plugin.mjs +968 -4
- package/dist/vite/plugin.mjs.map +1 -1
- package/dist/worker-page.cjs.js +669 -0
- package/dist/worker-page.cjs.js.map +1 -0
- package/dist/worker-page.esm.js +665 -0
- package/dist/worker-page.esm.js.map +1 -0
- package/dist/worker.cjs.js +377 -0
- package/dist/worker.cjs.js.map +1 -0
- package/dist/worker.esm.js +374 -0
- package/dist/worker.esm.js.map +1 -0
- package/dist/yjs-testing.cjs.js +98 -0
- package/dist/yjs-testing.cjs.js.map +1 -0
- package/dist/yjs-testing.esm.js +77 -0
- package/dist/yjs-testing.esm.js.map +1 -0
- package/dist/yjs.cjs.js +923 -0
- package/dist/yjs.cjs.js.map +1 -0
- package/dist/yjs.esm.js +900 -0
- package/dist/yjs.esm.js.map +1 -0
- package/dist/zag.cjs.js +11 -1
- package/dist/zag.cjs.js.map +1 -1
- package/dist/zag.esm.js +11 -1
- package/dist/zag.esm.js.map +1 -1
- package/llms/ai.md +65 -0
- package/llms/collaboration.md +5 -0
- package/llms/graphics.md +10 -0
- package/llms/renderers.md +7 -0
- package/llms/replay.md +5 -0
- package/llms/sandbox.md +5 -0
- package/llms/typed-apis.md +5 -0
- package/llms/ui.md +10 -0
- package/llms-full.txt +444 -0
- package/llms.txt +37 -35
- package/package.json +139 -3
- package/src/agent-ui/mcp.ts +152 -0
- package/src/agent-ui/snapshot.ts +212 -0
- package/src/agent-ui.d.ts +106 -0
- package/src/agent-ui.ts +249 -0
- package/src/ai.d.ts +95 -2
- package/src/api.d.ts +303 -0
- package/src/api.ts +9 -0
- package/src/canvas/Canvas.ts +585 -0
- package/src/canvas/backend.ts +627 -0
- package/src/canvas/geometry.ts +187 -0
- package/src/canvas/gesture.ts +23 -0
- package/src/canvas/image.ts +197 -0
- package/src/canvas/kit.ts +130 -0
- package/src/canvas/paint.ts +260 -0
- package/src/canvas/pointer.ts +25 -0
- package/src/canvas/snap.ts +68 -0
- package/src/canvas/svg.ts +99 -0
- package/src/canvas.d.ts +373 -0
- package/src/canvas.ts +46 -0
- package/src/core/actions.ts +14 -3
- package/src/core/cell.ts +12 -4
- package/src/core/debug.ts +8 -3
- package/src/core/hooks.ts +16 -2
- package/src/core/hosts/collection.ts +1 -1
- package/src/core/hosts/switchable.ts +26 -8
- package/src/core/instance.ts +98 -45
- package/src/core/markers/portal.ts +4 -0
- package/src/core/registry.ts +4 -0
- package/src/core/runtime.ts +34 -25
- package/src/core/statics.ts +5 -5
- package/src/cycle/dom/EventDelegator.ts +37 -33
- package/src/cycle/dom/MainDOMSource.ts +16 -14
- package/src/cycle/dom/enrichEventStream.ts +13 -9
- package/src/cycle/dom/fromEvent.ts +6 -10
- package/src/cycle/dom/index.ts +11 -7
- package/src/cycle/dom/isolate.ts +13 -6
- package/src/cycle/dom/makeDOMDriver.ts +6 -2
- package/src/cycle/dom/utils.ts +9 -2
- package/src/cycle/run/adapt.ts +4 -12
- package/src/devtools.d.ts +9 -0
- package/src/devtools.ts +2 -1
- package/src/extra/ai/compose/catalog.ts +2 -1
- package/src/extra/ai/compose/decisions.ts +1 -2
- package/src/extra/ai/compose/generated.ts +234 -0
- package/src/extra/ai/compose/index.ts +6 -2
- package/src/extra/ai/compose/layout.ts +3 -1
- package/src/extra/ai/compose/llm.ts +7 -3
- package/src/extra/ai/compose/types.ts +2 -2
- package/src/extra/ai/transports/shared.ts +3 -1
- package/src/extra/api/contract.ts +485 -0
- package/src/extra/api/index.ts +26 -0
- package/src/extra/behaviors.ts +3 -3
- package/src/extra/controlled.ts +44 -0
- package/src/extra/copyAsTest.ts +22 -0
- package/src/extra/devtools.ts +5 -3
- package/src/extra/devtoolsActions.ts +8 -0
- package/src/extra/devtoolsNext.ts +1 -1
- package/src/extra/diagnostics/checks/actionLog.ts +8 -3
- package/src/extra/diagnostics/checks/behaviors.ts +25 -0
- package/src/extra/diagnostics/checks/elementCommands.ts +17 -5
- package/src/extra/diagnostics/checks/index.ts +1 -1
- package/src/extra/diagnostics/checks/next.ts +78 -4
- package/src/extra/diagnostics/checks/props.ts +6 -1
- package/src/extra/diagnostics/checks/replies.ts +11 -7
- package/src/extra/diagnostics/checks/timers.ts +8 -2
- package/src/extra/diagnostics/checks/virtual.ts +11 -0
- package/src/extra/diagnostics/codes.ts +51 -1
- package/src/extra/elementCommands.ts +20 -4
- package/src/extra/fetchDriver.ts +4 -1
- package/src/extra/fetchEventSource.ts +6 -2
- package/src/extra/field.ts +29 -0
- package/src/extra/form.ts +42 -16
- package/src/extra/frame.ts +54 -0
- package/src/extra/keymap.ts +41 -0
- package/src/extra/pager.ts +2 -0
- package/src/extra/persist.ts +2 -1
- package/src/extra/pointer.ts +262 -0
- package/src/extra/processForm.ts +34 -1
- package/src/extra/replay/address.ts +49 -0
- package/src/extra/replay/entropy.ts +99 -0
- package/src/extra/replay/format.ts +263 -0
- package/src/extra/replay/index.ts +8 -0
- package/src/extra/replay/inert.ts +22 -0
- package/src/extra/replay/recorder.ts +247 -0
- package/src/extra/replay/replayer.ts +234 -0
- package/src/extra/replay/report.ts +126 -0
- package/src/extra/replay/schema.ts +52 -0
- package/src/extra/replay/version.ts +3 -0
- package/src/extra/router.ts +7 -3
- package/src/extra/selection.ts +2 -0
- package/src/extra/socketDriver.ts +51 -6
- package/src/extra/ssr.ts +128 -42
- package/src/extra/testing.ts +295 -39
- package/src/extra/timers.ts +96 -7
- package/src/extra/undo.ts +2 -0
- package/src/extra/virtual.ts +25 -2
- package/src/extra/widget.ts +106 -17
- package/src/host/actions.ts +383 -0
- package/src/host/delegation.ts +101 -0
- package/src/host/dom.ts +553 -0
- package/src/host/driver.ts +185 -0
- package/src/host/selector.ts +119 -0
- package/src/host/style.ts +51 -0
- package/src/host.d.ts +298 -0
- package/src/host.ts +46 -0
- package/src/index.d.ts +302 -38
- package/src/index.ts +15 -3
- package/src/pragma/blocks.ts +211 -0
- package/src/pragma/index.ts +44 -10
- package/src/primitives.d.ts +54 -0
- package/src/primitives.ts +136 -0
- package/src/react-native.d.ts +57 -0
- package/src/react-native.ts +285 -0
- package/src/react-peers.d.ts +21 -3
- package/src/replay.d.ts +185 -0
- package/src/replay.ts +6 -0
- package/src/sandbox/build.ts +119 -0
- package/src/sandbox/create.ts +187 -0
- package/src/sandbox/engine.ts +267 -0
- package/src/sandbox/generated.ts +195 -0
- package/src/sandbox/kernel.ts +180 -0
- package/src/sandbox/mirror.ts +269 -0
- package/src/sandbox/protocol.ts +128 -0
- package/src/sandbox/quickjs.ts +74 -0
- package/src/sandbox/ssr.ts +41 -0
- package/src/sandbox/widget.ts +60 -0
- package/src/sandbox/worker-entry.ts +59 -0
- package/src/sandbox/worker.ts +137 -0
- package/src/sandbox-build.d.ts +12 -0
- package/src/sandbox-build.ts +6 -0
- package/src/sandbox.d.ts +299 -0
- package/src/sandbox.ts +25 -0
- package/src/shared.ts +12 -0
- package/src/terminal/paint.ts +712 -0
- package/src/terminal.d.ts +167 -0
- package/src/terminal.ts +530 -0
- package/src/three/assets.ts +170 -0
- package/src/three/host.ts +36 -0
- package/src/three/scene.ts +217 -0
- package/src/three/target.ts +252 -0
- package/src/three.d.ts +221 -0
- package/src/three.ts +30 -0
- package/src/ui/accordion.ts +21 -7
- package/src/ui/dialog.ts +192 -90
- package/src/ui/disclosure.ts +2 -0
- package/src/ui/dom.ts +30 -0
- package/src/ui/layers.ts +132 -0
- package/src/ui/popover.ts +120 -21
- package/src/ui/shared.ts +98 -12
- package/src/ui/stack.ts +18 -0
- package/src/ui/tabs.ts +2 -0
- package/src/ui/toaster.ts +16 -15
- package/src/ui/tooltip.ts +24 -8
- package/src/ui/tooltips.ts +26 -14
- package/src/ui/zag/combobox.ts +180 -13
- package/src/ui/zag/menu.ts +97 -17
- package/src/ui/zag/select.ts +15 -4
- package/src/ui/zag/shared.ts +60 -8
- package/src/ui-combobox.d.ts +16 -1
- package/src/ui-menu.d.ts +22 -7
- package/src/ui-zag-types.d.ts +13 -5
- package/src/ui.d.ts +62 -7
- package/src/ui.ts +2 -2
- package/src/vite/api.ts +186 -0
- package/src/vite/compile.ts +280 -0
- package/src/vite/plugin.d.ts +34 -0
- package/src/vite/plugin.ts +78 -4
- package/src/vite/sandbox.ts +16 -0
- package/src/worker/page.ts +396 -0
- package/src/worker/protocol.ts +48 -0
- package/src/worker/target.ts +282 -0
- package/src/worker-page.d.ts +42 -0
- package/src/worker-page.ts +12 -0
- package/src/worker.d.ts +65 -0
- package/src/worker.ts +16 -0
- package/src/yjs/driver.ts +253 -0
- package/src/yjs/mapping.ts +389 -0
- package/src/yjs/shared.ts +138 -0
- package/src/yjs/testing.ts +91 -0
- package/src/yjs-testing.d.ts +34 -0
- package/src/yjs-testing.ts +7 -0
- package/src/yjs.d.ts +109 -0
- package/src/yjs.ts +18 -0
- package/src/zag.d.ts +2 -0
- package/src/zag.ts +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { VNode, VNodeData } from 'snabbdom/build/vnode.js';
|
|
|
4
4
|
import { Module } from 'snabbdom/build/modules/module.js';
|
|
5
5
|
import xsDefault, { Stream, MemoryStream } from 'xstream';
|
|
6
6
|
export { MemoryStream, Stream } from 'xstream';
|
|
7
|
-
import { FieldErrors as FieldErrors$1, BehaviorTarget as BehaviorTarget$1, Behavior as Behavior$1, RenderResult as RenderResult$1, FetchRequest as FetchRequest$1 } from 'sygnal';
|
|
7
|
+
import { FieldErrors as FieldErrors$1, BehaviorTarget as BehaviorTarget$1, Behavior as Behavior$1, StandardSchemaLike as StandardSchemaLike$1, RenderResult as RenderResult$1, FetchRequest as FetchRequest$1 } from 'sygnal';
|
|
8
8
|
export { h } from 'snabbdom/build/h.js';
|
|
9
9
|
export { default as debounce } from 'xstream/extra/debounce.js';
|
|
10
10
|
export { default as throttle } from 'xstream/extra/throttle.js';
|
|
@@ -148,6 +148,11 @@ declare class MainDOMSource {
|
|
|
148
148
|
private _eventDelegator;
|
|
149
149
|
private _name;
|
|
150
150
|
constructor(_rootElement$: Stream<Element>, _sanitation$: Stream<null>, _namespace: Array<Scope$1>, _isolateModule: IsolateModule, _eventDelegator: EventDelegator, _name: string);
|
|
151
|
+
isolateSource(source: MainDOMSource, scope: string): MainDOMSource;
|
|
152
|
+
private _is?;
|
|
153
|
+
private _iv?;
|
|
154
|
+
get isolateSink(): IsolateSink<VNode>;
|
|
155
|
+
get isolateValue(): (node: any, scope: string, memo?: any) => any;
|
|
151
156
|
private _elements;
|
|
152
157
|
elements(): MemoryStream<Array<Element>>;
|
|
153
158
|
element(): MemoryStream<Element>;
|
|
@@ -157,9 +162,6 @@ declare class MainDOMSource {
|
|
|
157
162
|
events<K extends keyof HTMLElementEventMap>(eventType: K, options?: EventsFnOptions, bubbles?: boolean): EnrichedEventStream<HTMLElementEventMap[K]>;
|
|
158
163
|
events(eventType: string, options?: EventsFnOptions, bubbles?: boolean): EnrichedEventStream<Event>;
|
|
159
164
|
dispose(): void;
|
|
160
|
-
isolateSource: (source: MainDOMSource, scope: string) => MainDOMSource;
|
|
161
|
-
isolateSink: IsolateSink<VNode>;
|
|
162
|
-
isolateValue: (node: any, scope: string) => any;
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
interface DOMDriverOptions {
|
|
@@ -1456,7 +1458,7 @@ type CatalogParam =
|
|
|
1456
1458
|
/** a number (LLM: a number; decisions: a bin, which names the vague words it covers) */
|
|
1457
1459
|
| { type: 'number'; min?: number; max?: number; default?: number; bins?: Record<string | number, string>; label?: string }
|
|
1458
1460
|
/** free text: LLM only (a decision model keeps the default; `required` with no default makes the part LLM-only) */
|
|
1459
|
-
| { type: 'text'; maxLength?: number; default?: string; required?: boolean; label?: string }
|
|
1461
|
+
| { type: 'text'; maxLength?: number; default?: string; required?: boolean; label?: string; /** source code (a generated part's): the prompt says so, and asked_for items keep their own length */ format?: 'code' }
|
|
1460
1462
|
/** a list of short texts: LLM only */
|
|
1461
1463
|
| { type: 'list'; items?: { maxLength?: number }; min?: number; max?: number; required?: boolean; default?: readonly string[]; label?: string }
|
|
1462
1464
|
/** a record: one node per record (at most one per part) */
|
|
@@ -1795,6 +1797,99 @@ declare const compose: {
|
|
|
1795
1797
|
action<K extends string = 'page'>(key?: K, options?: { description?: string; timeout?: number }): Record<`${K}.COMPOSE`, AgentAction<any, { prompt: string; fresh?: boolean }>>
|
|
1796
1798
|
/** PLAN-9 C-2: a composition as an agent's `read` shows it: its status, the layout as a tree, the error */
|
|
1797
1799
|
summary(slice: ComposeState | null | undefined): { status: ComposeStatus; page: ComposeTree; error?: string } | undefined
|
|
1800
|
+
/**
|
|
1801
|
+
* EXPERIMENTAL (outside semver): a part whose component the model writes, run in sygnal/sandbox.
|
|
1802
|
+
* `runtime` is `generatedRuntime({ kernel, compile })` from 'sygnal/sandbox'. Add `gen.part` to the
|
|
1803
|
+
* catalogs that may have one (never a default), `gen.instructions` to compose.llm's instructions,
|
|
1804
|
+
* `fix: gen.repair()` to the host's `uses`, and read events with `gen.events(CHILD, type)`.
|
|
1805
|
+
*/
|
|
1806
|
+
generated<STATE = any, const D extends Record<string, GeneratedData<STATE>> = {}, const E extends Record<string, GeneratedEmit> = {}>(
|
|
1807
|
+
runtime: { readonly Box: any },
|
|
1808
|
+
options?: ComposeGeneratedOptions<STATE, D, E>
|
|
1809
|
+
): ComposeGenerated<D, E>
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
// ---- compose.generated (experimental, outside semver) -------------------------------------------
|
|
1813
|
+
|
|
1814
|
+
/** A data key a generated part may read: its value is `from(state)`, as JSON, when the node lists the key in `reads` */
|
|
1815
|
+
interface GeneratedData<STATE = any> {
|
|
1816
|
+
/** what the prompt says it is */
|
|
1817
|
+
description: string
|
|
1818
|
+
/** its shape for the prompt (never the data): '[{ id: number, name: string }]' */
|
|
1819
|
+
shape?: string
|
|
1820
|
+
from: (state: STATE) => unknown
|
|
1821
|
+
}
|
|
1822
|
+
/** An event type a generated part may send: its data passes `schema` (its output reaches the host), anything else is dropped */
|
|
1823
|
+
interface GeneratedEmit<S extends StandardSchemaLike$1 = StandardSchemaLike$1> {
|
|
1824
|
+
description?: string
|
|
1825
|
+
/** a Standard Schema (zod 4's JSON Schema export goes into the prompt) */
|
|
1826
|
+
schema: S
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
interface ComposeGeneratedOptions<STATE = any, D = {}, E = {}> {
|
|
1830
|
+
/** what the code may read (default none) */
|
|
1831
|
+
data?: D & Record<string, GeneratedData<STATE>>
|
|
1832
|
+
/** what the code may send (default none: the part only displays) */
|
|
1833
|
+
emits?: E & Record<string, GeneratedEmit>
|
|
1834
|
+
/** the part id the prompt names (default 'custom'; use it as the catalog key) */
|
|
1835
|
+
id?: string
|
|
1836
|
+
/** characters of code (default 4000; the schema caps `code` at maxCode + 1) */
|
|
1837
|
+
maxCode?: number
|
|
1838
|
+
/** generated parts per page (default 3) */
|
|
1839
|
+
maxUses?: number
|
|
1840
|
+
/** default 'worker' (QuickJS in a Worker with a watchdog); 'thread' is the opt-in */
|
|
1841
|
+
isolation?: 'worker' | 'thread'
|
|
1842
|
+
/** over the runtime's limits */
|
|
1843
|
+
limits?: Record<string, number>
|
|
1844
|
+
policy?: Record<string, unknown>
|
|
1845
|
+
/** none by default (e.g. `{ fetch: { allow: [...] } }`) */
|
|
1846
|
+
capabilities?: Record<string, unknown>
|
|
1847
|
+
/** the check before mount (default true) */
|
|
1848
|
+
check?: boolean
|
|
1849
|
+
/** the class names the prompt offers */
|
|
1850
|
+
classes?: string
|
|
1851
|
+
/** the part's description in the catalog */
|
|
1852
|
+
description?: string
|
|
1853
|
+
/** what a part the model couldn't fix shows (default "This part couldn't be built.") */
|
|
1854
|
+
fallback?: string
|
|
1855
|
+
/** the host key of `gen.repair()` (default 'fix') */
|
|
1856
|
+
repairKey?: string
|
|
1857
|
+
/** the repair requests' sink (default 'LLM') */
|
|
1858
|
+
sink?: string
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
/** A generated part's event as the host's intent reads it */
|
|
1862
|
+
type GeneratedEvent<E, K extends keyof E> = { node: string } & (E[K] extends { schema: infer S } ? SchemaOutput<S> : unknown)
|
|
1863
|
+
|
|
1864
|
+
/** gen.repair()'s slice (`state.fix`): the overlay of fixed code and each chain's status */
|
|
1865
|
+
interface GeneratedRepairState {
|
|
1866
|
+
/** hash(failing code) → fixed code */
|
|
1867
|
+
patches: Record<string, string>
|
|
1868
|
+
parents: Record<string, string>
|
|
1869
|
+
attempts: Record<string, number>
|
|
1870
|
+
status: Record<string, 'repairing' | 'patched' | 'fixed' | 'gave-up'>
|
|
1871
|
+
pending: Record<string, string>
|
|
1872
|
+
log: Array<{ node: string; root: string; attempt: number; kind: string; reason?: string; message: string; gaveUp?: true }>
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
interface ComposeGenerated<D = {}, E = {}> {
|
|
1876
|
+
readonly id: string
|
|
1877
|
+
/** the catalog part: `defineCatalog({ parts: { custom: gen.part } })` */
|
|
1878
|
+
readonly part: CatalogPartDecl
|
|
1879
|
+
/** the part as a chat card's result part: the code's `type` event is the card's answer (render_component) */
|
|
1880
|
+
card(type: keyof E & string): CatalogPartDecl
|
|
1881
|
+
/** the part's component (CHILD.select(gen.Host) hears its reports) */
|
|
1882
|
+
readonly Host: any
|
|
1883
|
+
/** the prompt rules: compose.llm({ instructions: gen.instructions }) */
|
|
1884
|
+
readonly instructions: string
|
|
1885
|
+
/** the repair requests' instructions */
|
|
1886
|
+
readonly repairInstructions: string
|
|
1887
|
+
/** the host's intent: one declared event type of every generated part, validated */
|
|
1888
|
+
events<K extends keyof E & string>(CHILD: any, type: K): Stream<GeneratedEvent<E, K>>
|
|
1889
|
+
/** the repair loop: `uses = { fix: gen.repair({ maxAttempts: 2, model }) }` */
|
|
1890
|
+
repair(options?: { maxAttempts?: number; model?: string }): Behavior$1<GeneratedRepairState, { REPLY: any; FAILED: any }>
|
|
1891
|
+
readonly schemas: { [K in keyof E]: E[K] extends { schema: infer S } ? S : never }
|
|
1892
|
+
readonly repairKey: string
|
|
1798
1893
|
}
|
|
1799
1894
|
|
|
1800
1895
|
/**
|
|
@@ -2459,6 +2554,192 @@ declare class MockedDOMSource {
|
|
|
2459
2554
|
}
|
|
2460
2555
|
declare function mockDOMSource(mockConfig: MockConfig, hub?: MockEventHub, onEvents?: MockOnEvents): MockedDOMSource;
|
|
2461
2556
|
|
|
2557
|
+
// Types for 'sygnal/replay' (7.2 dev preview). The implementation lives in src/extra/replay/;
|
|
2558
|
+
// the main entry re-exports these (replay() sits next to renderComponent).
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
/** An action's cause in a recording: inputs i intent, r reply, n next, a simulateAction, B behavior, g agent, S setState; consequences b built-in, p parent */
|
|
2562
|
+
type RecordedCause = 'i' | 'r' | 'n' | 'a' | 'B' | 'g' | 'S' | 'b' | 'p'
|
|
2563
|
+
|
|
2564
|
+
/** One action of a recording (RECORDING_SCHEMA has the details) */
|
|
2565
|
+
interface RecordedAction {
|
|
2566
|
+
/** sequence number */
|
|
2567
|
+
s: number
|
|
2568
|
+
/** ms since the previous action kept (at enqueue) */
|
|
2569
|
+
t: number
|
|
2570
|
+
/** index into the recording's addresses (`p`) */
|
|
2571
|
+
p: number
|
|
2572
|
+
/** the action type */
|
|
2573
|
+
y: string
|
|
2574
|
+
c: RecordedCause
|
|
2575
|
+
/** a reply's source (driver name) */
|
|
2576
|
+
r?: string
|
|
2577
|
+
/** the data (inputs only; events and elements as stubs) */
|
|
2578
|
+
d?: unknown
|
|
2579
|
+
/** the clock and randomness its handlers read, in order: ['now' | 'random' | 'uuid' | 'perf', value] */
|
|
2580
|
+
e?: Array<[string, unknown]>
|
|
2581
|
+
/** hash of the instance's new state, when its STATE changed */
|
|
2582
|
+
h?: string
|
|
2583
|
+
/** [sink, hash] of the values its other sinks produced */
|
|
2584
|
+
f?: Array<[string, string]>
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
/** A recording, format version 1: plain JSON (save it with JSON.stringify) */
|
|
2588
|
+
interface Recording {
|
|
2589
|
+
kind: 'sygnal-recording'
|
|
2590
|
+
version: 1
|
|
2591
|
+
/** the Sygnal version that recorded it (a replay on another version warns) */
|
|
2592
|
+
sygnal: string
|
|
2593
|
+
/** the root component's name */
|
|
2594
|
+
app: string
|
|
2595
|
+
/** ISO time the recording started */
|
|
2596
|
+
recorded: string
|
|
2597
|
+
/** typed text, server data and setState values pseudonymized; checkpoints masked */
|
|
2598
|
+
redacted: boolean
|
|
2599
|
+
/** component name -> the action names its model handled (a replay against code without one warns) */
|
|
2600
|
+
components: Record<string, string[]>
|
|
2601
|
+
/** the app's own sources: 'resources' (makeFetchDriver), 'timers' (makeTimerDriver), 'other' (an inert driver in the replay) */
|
|
2602
|
+
sources: Record<string, 'resources' | 'timers' | 'other'>
|
|
2603
|
+
/** the root state when the app started */
|
|
2604
|
+
init: unknown
|
|
2605
|
+
/** instance addresses: `App`, `App/Lane[lane-2]` (a Collection item), `App/Header:0` */
|
|
2606
|
+
p: string[]
|
|
2607
|
+
a: RecordedAction[]
|
|
2608
|
+
/** checkpoints, one per patch: the last action's sequence number, the view's hash, the root state's diff */
|
|
2609
|
+
k: Array<{ s: number; v: string; o?: unknown[]; html?: string }>
|
|
2610
|
+
/** declaration statics sent to drivers: [seq, sink, hash] */
|
|
2611
|
+
fx: Array<[number, string, string]>
|
|
2612
|
+
end?: { s: number; ms: number; dropped: number; o?: unknown[] }
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
interface RecordOptions {
|
|
2616
|
+
/**
|
|
2617
|
+
* Default true. `true` or `{ keep, also }`: the strings of typed input (intent actions
|
|
2618
|
+
* dispatched while a text-entry DOM event was delivered, and later actions of those types),
|
|
2619
|
+
* server replies, setState values and the types in `also` are pseudonymized (same shape, equal
|
|
2620
|
+
* strings stay equal); never the types in `keep`, nor next() data. Checkpoints are masked.
|
|
2621
|
+
* A redacted string the model branches on makes the replay diverge there: add it to `keep`.
|
|
2622
|
+
* `false`: nothing redacted.
|
|
2623
|
+
*/
|
|
2624
|
+
redact?: boolean | { keep?: string[]; also?: string[] }
|
|
2625
|
+
/** Default true: leave out inputs that changed nothing (an idle timer's ticks) */
|
|
2626
|
+
dropNoops?: boolean
|
|
2627
|
+
/** 'hash' (default), or 'html': checkpoints also keep the view's markup (for reports) */
|
|
2628
|
+
vnodes?: 'hash' | 'html'
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
interface Recorder {
|
|
2632
|
+
/** stop recording; the recording (undefined when no app started) */
|
|
2633
|
+
stop(): Recording | undefined
|
|
2634
|
+
/** the recording so far (the recording goes on) */
|
|
2635
|
+
log(): Recording | undefined
|
|
2636
|
+
/** an app is being recorded */
|
|
2637
|
+
active(): boolean
|
|
2638
|
+
/** a replay test for the recording so far: the test file, the recording's JSON and its file name */
|
|
2639
|
+
test(options?: ReplayTestOptions): { code: string; recording: string; file: string }
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
/**
|
|
2643
|
+
* Record the next app started (run() or renderComponent()) as a log of its input actions, the
|
|
2644
|
+
* clock and randomness its handlers read, and a checkpoint per patch. Dev only: an app that never
|
|
2645
|
+
* imports 'sygnal/replay' pays nothing.
|
|
2646
|
+
*/
|
|
2647
|
+
declare function startRecording(options?: RecordOptions): Recorder
|
|
2648
|
+
|
|
2649
|
+
interface ReplayOptions {
|
|
2650
|
+
/** drivers to use instead of the inert ones (by source name) */
|
|
2651
|
+
drivers?: Record<string, any>
|
|
2652
|
+
/** more renderComponent options */
|
|
2653
|
+
render?: Record<string, any>
|
|
2654
|
+
/** stop after this many checkpoints */
|
|
2655
|
+
stopAt?: number
|
|
2656
|
+
/** false: handlers read the real clock and randomness */
|
|
2657
|
+
entropy?: boolean
|
|
2658
|
+
/** false: no console.warn for version / name mismatches (they are in `warnings`) */
|
|
2659
|
+
warn?: boolean
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
/** Where a replay first differs from the recording */
|
|
2663
|
+
interface ReplayDivergence {
|
|
2664
|
+
s: number
|
|
2665
|
+
type?: string
|
|
2666
|
+
/** the instance's address */
|
|
2667
|
+
path?: string
|
|
2668
|
+
cause?: string
|
|
2669
|
+
data?: unknown
|
|
2670
|
+
reason: string
|
|
2671
|
+
/** the checkpoint whose root state differs */
|
|
2672
|
+
checkpoint?: number | 'end'
|
|
2673
|
+
/** the root state's differences at that checkpoint: recorded (expected) vs now (actual) */
|
|
2674
|
+
diff?: Array<{ path: string; expected: unknown; actual?: unknown; deleted?: true }>
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
interface ReplayResult<STATE = any> {
|
|
2678
|
+
/** no divergence, view change, effect change, unresolved input or unhandled action */
|
|
2679
|
+
ok: boolean
|
|
2680
|
+
divergence: ReplayDivergence | null
|
|
2681
|
+
/** the first checkpoint whose view differs while the state matches (a view-only change) */
|
|
2682
|
+
view: { checkpoint: number; s: number; expected: string; actual: string; html: string; expectedHtml?: string } | null
|
|
2683
|
+
/** actions whose sink values (requests, EVENTS, ...) differ: hashes, and the values sent now */
|
|
2684
|
+
effects: Array<{ s: number; type: string; path: string; expected: Array<[string, string]>; actual: Array<[string, string]>; values: Array<[string, unknown]> }>
|
|
2685
|
+
/** action types the code no longer handles */
|
|
2686
|
+
unhandled: string[]
|
|
2687
|
+
/** inputs whose instance never appeared */
|
|
2688
|
+
unresolved: Array<{ s: number; type: string; path: string }>
|
|
2689
|
+
/** recorded actions that didn't run, and actions that ran but weren't recorded */
|
|
2690
|
+
missing: Array<{ s: number; type: string; path: string }>
|
|
2691
|
+
extra: Array<{ type: string; path: string; cause: string }>
|
|
2692
|
+
/** clock / randomness reads the replay had no recorded value for */
|
|
2693
|
+
misses: string[]
|
|
2694
|
+
/** Sygnal version, component or action names that differ from the recording's */
|
|
2695
|
+
warnings: string[]
|
|
2696
|
+
checkpoints: number
|
|
2697
|
+
actions: number
|
|
2698
|
+
/** the final root state */
|
|
2699
|
+
final: STATE
|
|
2700
|
+
/** the renderComponent handle (dispose it) */
|
|
2701
|
+
t: RenderResult$1<STATE>
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* Replay a recording (the object, or its JSON) on `Component` in renderComponent: the recorded
|
|
2706
|
+
* inputs go to the same instances in the same order, every handler gets the clock and randomness
|
|
2707
|
+
* it read, and each action and checkpoint is compared with the recording.
|
|
2708
|
+
*/
|
|
2709
|
+
declare function replay<STATE = any>(Component: any, recording: Recording | string, options?: ReplayOptions): Promise<ReplayResult<STATE>>
|
|
2710
|
+
|
|
2711
|
+
interface ReplayTestOptions {
|
|
2712
|
+
/** the import line for the component (default `import <App> from './<App>.js'`) */
|
|
2713
|
+
componentImport?: string
|
|
2714
|
+
componentName?: string
|
|
2715
|
+
/** the recording's path relative to the test (default `./<App>.recording.json`) */
|
|
2716
|
+
logFile?: string
|
|
2717
|
+
/** default 'sygnal/replay' */
|
|
2718
|
+
replayImport?: string
|
|
2719
|
+
/** more replay() options as source code: "drivers: { DND: myDriver }" */
|
|
2720
|
+
replayOptions?: string
|
|
2721
|
+
testName?: string
|
|
2722
|
+
environment?: string
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
/** A Vitest file that replays the recording and asserts no divergence and the final state */
|
|
2726
|
+
declare function replayTest(recording: Recording, options?: ReplayTestOptions): string
|
|
2727
|
+
|
|
2728
|
+
/** Markdown for a bug report: the timeline, what the replay found, how to reproduce */
|
|
2729
|
+
declare function bugReport(recording: Recording, result?: ReplayResult, options?: { title?: string; logName?: string; expected?: string }): string
|
|
2730
|
+
|
|
2731
|
+
/** One line per recorded input: time, instance, type, cause, data */
|
|
2732
|
+
declare function timeline(recording: Recording, options?: { max?: number }): string[]
|
|
2733
|
+
|
|
2734
|
+
/** The final root state the recording holds */
|
|
2735
|
+
declare function finalState(recording: Recording): unknown
|
|
2736
|
+
|
|
2737
|
+
/** The recording format (version 1) as a JSON Schema */
|
|
2738
|
+
declare const RECORDING_SCHEMA: Record<string, unknown>
|
|
2739
|
+
|
|
2740
|
+
/** A driver whose source accepts any call chain and never emits (a replay's stand-in for a recorded app's own drivers) */
|
|
2741
|
+
declare function inertDriver(): (sink$: any) => any
|
|
2742
|
+
|
|
2462
2743
|
declare const ABORT: unique symbol
|
|
2463
2744
|
type ABORT = typeof ABORT
|
|
2464
2745
|
/**
|
|
@@ -2525,8 +2806,11 @@ type StateProp = string | Lense<any, any>
|
|
|
2525
2806
|
*/
|
|
2526
2807
|
type ElementProps<PROPS> =
|
|
2527
2808
|
0 extends (1 & PROPS) ? PROPS
|
|
2528
|
-
: '
|
|
2529
|
-
: PROPS
|
|
2809
|
+
// PLAN-13 F-3: Switchable's own `state` (a per-page map too) is kept as it declares it
|
|
2810
|
+
: PROPS extends { of: Record<string, any>; current: string } ? PROPS
|
|
2811
|
+
: WithStateProp<PROPS>
|
|
2812
|
+
|
|
2813
|
+
type WithStateProp<PROPS> = 'state' extends keyof PROPS ? WithoutViewOnlyProps<PROPS> & { state?: StateProp; resetState?: boolean } : PROPS
|
|
2530
2814
|
|
|
2531
2815
|
/** PROPS without `state`, `context`, `slots` and `uid` (keeps optionality and index signatures, unlike Omit). */
|
|
2532
2816
|
type WithoutViewOnlyProps<PROPS> = {
|
|
@@ -2547,7 +2831,21 @@ type NextFunction<ACTIONS = any> = ACTIONS extends object
|
|
|
2547
2831
|
* `state` (and as its 1st argument), with the state from before the action as `previousState`
|
|
2548
2832
|
* (in a STATE reducer both are the old state)
|
|
2549
2833
|
*/
|
|
2550
|
-
|
|
2834
|
+
/**
|
|
2835
|
+
* 7.2: the clock and randomness on a handler's 4th argument, the canonical form for reading them
|
|
2836
|
+
* (instead of Date.now(), Math.random(), crypto.randomUUID(): SYG258 / SYG509). renderComponent
|
|
2837
|
+
* can fix them (`now`, `random`, `uuid` options) and a replay supplies the recorded values. A
|
|
2838
|
+
* component prop of the same name wins.
|
|
2839
|
+
*/
|
|
2840
|
+
interface HandlerEntropy {
|
|
2841
|
+
/** Date.now() */
|
|
2842
|
+
now(): number
|
|
2843
|
+
/** Math.random() */
|
|
2844
|
+
random(): number
|
|
2845
|
+
/** crypto.randomUUID() */
|
|
2846
|
+
uuid(): string
|
|
2847
|
+
}
|
|
2848
|
+
type ReducerExtras<PROPS, CONTEXT, STATE = any> = Omit<HandlerEntropy, keyof PROPS> & PROPS & { state: STATE; previousState: STATE; context: CONTEXT; children?: JSX.Element | JSX.Element[]; slots?: Record<string, JSX.Element[]>; uid: UidFunction }
|
|
2551
2849
|
|
|
2552
2850
|
type Reducer<STATE, PROPS, ACTIONS = any, DATA = any, RETURN = any, CONTEXT = {}> = (
|
|
2553
2851
|
state: STATE,
|
|
@@ -2803,7 +3101,8 @@ type ChildSource = {
|
|
|
2803
3101
|
/**
|
|
2804
3102
|
* `DOM.<event>(selector)` shorthands for the standard DOM events, typed like
|
|
2805
3103
|
* `DOM.select(selector).events('<event>')`: `DOM.keydown('.x')` is a stream of KeyboardEvent,
|
|
2806
|
-
* `DOM.click('.x')` of MouseEvent (PointerEvent in newer DOM typings), and so on.
|
|
3104
|
+
* `DOM.click('.x')` of MouseEvent (PointerEvent in newer DOM typings), and so on. A second argument
|
|
3105
|
+
* is the events() options: `DOM.submit('form', { preventDefault: true })`.
|
|
2807
3106
|
*/
|
|
2808
3107
|
type DOMEventShorthands = {
|
|
2809
3108
|
[EVENT in Exclude<keyof HTMLElementEventMap, keyof MainDOMSource>]: DOMEventShorthand<HTMLElementEventMap[EVENT]>
|
|
@@ -2814,9 +3113,9 @@ type DOMEventShorthands = {
|
|
|
2814
3113
|
* the event with `currentTarget` (and `ownerTarget`) typed as the control's element.
|
|
2815
3114
|
*/
|
|
2816
3115
|
interface DOMEventShorthand<EVENT> {
|
|
2817
|
-
<CONTROL extends AnyControl>(control: CONTROL): EnrichedEventStream<ControlEvent<EVENT, ControlElementOf<CONTROL>>>
|
|
3116
|
+
<CONTROL extends AnyControl>(control: CONTROL, options?: EventsFnOptions): EnrichedEventStream<ControlEvent<EVENT, ControlElementOf<CONTROL>>>
|
|
2818
3117
|
// last, so ReturnType<SygnalDOMSource['click']> stays the selector form
|
|
2819
|
-
(selector: string): EnrichedEventStream<EVENT>
|
|
3118
|
+
(selector: string, options?: EventsFnOptions): EnrichedEventStream<EVENT>
|
|
2820
3119
|
}
|
|
2821
3120
|
|
|
2822
3121
|
/**
|
|
@@ -3055,8 +3354,60 @@ type WidgetEmit<EV extends string = string> = WidgetDispatch<EV>
|
|
|
3055
3354
|
interface WidgetDefinition<P = {}, I = unknown, EV extends string = string, TAG extends string = 'div'> {
|
|
3056
3355
|
/** A name for diagnostics and inspect() (`'DatePicker'`); the host tag stands in without one */
|
|
3057
3356
|
name?: string;
|
|
3058
|
-
/** The host element (default `'div'`).
|
|
3357
|
+
/** The host element (default `'div'`). Without `children`, it has no children of its own: the widget owns its content. */
|
|
3059
3358
|
tag?: TAG;
|
|
3359
|
+
/**
|
|
3360
|
+
* Declarative children (an "island": a WebGL scene's objects, a map's markers, a chart's
|
|
3361
|
+
* series). The tag's JSX children are rendered by the app's DOM driver into a container in
|
|
3362
|
+
* the host (`[data-widget-children]`), as ordinary elements: components, `<Collection>`,
|
|
3363
|
+
* isolation and intents work inside. `sync` gets them; the widget paints them its own way and
|
|
3364
|
+
* dispatches DOM events on them. `true`: the container is visually hidden but in the
|
|
3365
|
+
* accessibility tree (Enter / Space on a focused child is its `click`; `focus` is told);
|
|
3366
|
+
* `'hidden'`: hidden from everything.
|
|
3367
|
+
*/
|
|
3368
|
+
children?: true | 'hidden';
|
|
3369
|
+
/**
|
|
3370
|
+
* With `children`: called after mount and after each patch in which the children's vnodes
|
|
3371
|
+
* changed, with the children container's patched vnode (each child's props as the view wrote
|
|
3372
|
+
* them, in `data.props` / `data.attrs`, and its element in `.elm`).
|
|
3373
|
+
*/
|
|
3374
|
+
sync?(instance: I, children: VNode, el: WidgetElementOf<TAG>): void;
|
|
3375
|
+
/** With `children`: a child got keyboard focus (`null`: none has it); draw a focus ring where it is */
|
|
3376
|
+
focus?(instance: I, child: Element | null, el: WidgetElementOf<TAG>): void;
|
|
3377
|
+
/**
|
|
3378
|
+
* Tags of the widget's children vocabulary that are SVG tags to the JSX pragma (`marker`,
|
|
3379
|
+
* `line`, `text`): they become plain elements app-wide (props stay props). Children of a
|
|
3380
|
+
* literal `<svg>` in the same template are still SVG.
|
|
3381
|
+
*/
|
|
3382
|
+
tags?: readonly string[];
|
|
3383
|
+
/**
|
|
3384
|
+
* Experimental (7.2): the widget carries a value both the app and the user change (an
|
|
3385
|
+
* editor's text, a camera, a map's viewport). The `value` prop is controlled: `write` is
|
|
3386
|
+
* called only when the app changed it to something the widget didn't report itself (no echo
|
|
3387
|
+
* loops, no stale writes); the widget reports its own changes with `dispatch(event, value)`
|
|
3388
|
+
* (`event` default `'change'`). With `strict` (here, or the `strict` prop), an edit the model
|
|
3389
|
+
* didn't take (the prop never moved) is written back after the app's turn. `read` makes the
|
|
3390
|
+
* host's `value` the widget's (`.value()` in intents). `update` is not called for `value` alone.
|
|
3391
|
+
*/
|
|
3392
|
+
value?: {
|
|
3393
|
+
write(instance: I, value: any, el: WidgetElementOf<TAG>): void;
|
|
3394
|
+
read?(instance: I, el: WidgetElementOf<TAG>): any;
|
|
3395
|
+
equals?(a: any, b: any): boolean;
|
|
3396
|
+
event?: NoInfer<EV>;
|
|
3397
|
+
strict?: boolean;
|
|
3398
|
+
};
|
|
3399
|
+
/**
|
|
3400
|
+
* The widget is a form field named by its `name` prop (the widget field contract): when it
|
|
3401
|
+
* dispatches `event` (default: `value.event`, else `'change'`), its host also fires a bubbling
|
|
3402
|
+
* `input` event, which the `form` behavior reads as the field's new value (the event's detail);
|
|
3403
|
+
* the focus leaving the host marks the field touched; processForm entries get `read()` (default:
|
|
3404
|
+
* the last value dispatched, else the `value` prop). Its own nameless controls' `input` events
|
|
3405
|
+
* don't count. `true`: the defaults.
|
|
3406
|
+
*/
|
|
3407
|
+
field?: true | {
|
|
3408
|
+
event?: NoInfer<EV>;
|
|
3409
|
+
read?(instance: I, el: WidgetElementOf<TAG>): any;
|
|
3410
|
+
};
|
|
3060
3411
|
/**
|
|
3061
3412
|
* Called once the host is in the document (or on the first client patch after SSR) with the
|
|
3062
3413
|
* props the view passed. Returns the instance that `update`, `unmount` and `commands` get.
|
|
@@ -3090,7 +3441,8 @@ interface WidgetDefinition<P = {}, I = unknown, EV extends string = string, TAG
|
|
|
3090
3441
|
* (`controls({ Due: DatePicker })`, the alternative form).
|
|
3091
3442
|
*/
|
|
3092
3443
|
interface Widget<P = {}, I = unknown, EV extends string = string, TAG extends string = string> extends ControlSpecObject<P & WidgetHostProps> {
|
|
3093
|
-
(
|
|
3444
|
+
/** (JSX children: rendered for a widget with `children`, ignored otherwise) */
|
|
3445
|
+
(props: P & WidgetHostProps & { children?: unknown }): JSX.Element;
|
|
3094
3446
|
readonly kind: 'widget';
|
|
3095
3447
|
/** The declared events */
|
|
3096
3448
|
readonly events: readonly EV[];
|
|
@@ -3123,6 +3475,22 @@ interface Widget<P = {}, I = unknown, EV extends string = string, TAG extends st
|
|
|
3123
3475
|
*/
|
|
3124
3476
|
declare function defineWidget<P = {}, I = unknown, const EV extends string = string, const TAG extends string = 'div'>(definition: WidgetDefinition<P, I, EV, TAG>): Widget<P, I, EV, TAG>
|
|
3125
3477
|
|
|
3478
|
+
/**
|
|
3479
|
+
* Keyboard shortcuts as named action streams (7.2):
|
|
3480
|
+
*
|
|
3481
|
+
* App.intent = ({ DOM }) => ({ ...keymap(DOM, { 'mod+z': 'UNDO', 'shift+mod+z': 'REDO', delete: 'DELETE', left: ['NUDGE', { dx: -1 }] }) })
|
|
3482
|
+
*
|
|
3483
|
+
* A combo is modifiers (`mod` = ⌘ or Ctrl, `ctrl`, `meta`, `shift`, `alt`) then a key (`e.key`
|
|
3484
|
+
* lower-cased; `left` `right` `up` `down` `del` `esc` `space` aliases; digits by `e.code`), and
|
|
3485
|
+
* matches only its own modifiers. A value is an action name (its stream emits `undefined`) or
|
|
3486
|
+
* `[name, data]`. Matched keys are default-prevented; nothing fires while typing in a field.
|
|
3487
|
+
*/
|
|
3488
|
+
declare function keymap<const T extends Record<string, string | readonly [string, any]>>(
|
|
3489
|
+
DOM: { select(selector: string): any },
|
|
3490
|
+
table: T,
|
|
3491
|
+
options?: { on?: string },
|
|
3492
|
+
): { [K in T[keyof T] extends infer V ? V extends readonly [infer N extends string, any] ? N : V extends string ? V : never : never]: Stream<any> }
|
|
3493
|
+
|
|
3126
3494
|
/**
|
|
3127
3495
|
* The target of an element command: a control, or a selector. It is looked up in the view of the
|
|
3128
3496
|
* component instance that sends the command (a child's elements are isolated from its parent; a
|
|
@@ -3255,6 +3623,11 @@ interface BehaviorDefinition<SLICE = any, ACTIONS = {}, CALCULATED = {}, OPTIONS
|
|
|
3255
3623
|
* name is sent to the host as written. They join the host's own `timers`.
|
|
3256
3624
|
*/
|
|
3257
3625
|
timers?: (slice: SLICE, options: OPTIONS, key: string) => Timers;
|
|
3626
|
+
/**
|
|
3627
|
+
* ui-sweep R1: the option each action's trigger is built from (`{ TOGGLE: 'toggle' }`). Dev
|
|
3628
|
+
* only: SYG118 when a host intent action of that name replaces it while the host passes the option.
|
|
3629
|
+
*/
|
|
3630
|
+
triggers?: { [A in keyof ACTIONS]?: keyof OPTIONS & string };
|
|
3258
3631
|
/** `false`: the slice is UI state (sortable's drag): a root's `persist()` neither saves nor restores it (the root's own `uses` only: a sub-component's or Collection item's slice is saved with its data) */
|
|
3259
3632
|
persist?: false;
|
|
3260
3633
|
/**
|
|
@@ -3473,7 +3846,8 @@ interface FormOptions<V = any, OUT = any> {
|
|
|
3473
3846
|
* function of the schema's output and the host's state (`(data, state) => ({ url: '/api/items/' + state.id, method: 'PUT' })`;
|
|
3474
3847
|
* `ABORT` / falsy sends nothing and leaves the submit pending). The form adds the body
|
|
3475
3848
|
* (`multipart: data` when a top-level value is a File or files, else `json: data`, unless the
|
|
3476
|
-
* request sets `json`, `multipart` or `body`), `progress: 'form.PROGRESS'`
|
|
3849
|
+
* request sets `json`, `multipart` or `body`), `progress: 'form.PROGRESS'` for a multipart submit or
|
|
3850
|
+
* `progress: true` (a JSON submit stays on fetch: progress goes over XMLHttpRequest) and its own
|
|
3477
3851
|
* `ok: 'form.DONE'`, `error: 'form.ERRORS'`
|
|
3478
3852
|
*/
|
|
3479
3853
|
request?: FormRequest<OUT>;
|
|
@@ -3517,8 +3891,8 @@ type FormServerErrors =
|
|
|
3517
3891
|
| { status?: number; body?: any; error?: any; request?: any }
|
|
3518
3892
|
|
|
3519
3893
|
interface FormActions<V = any> {
|
|
3520
|
-
/** A field changed (the form element's input events): `{ name, value }`; a checkbox gives `checked` as `value` and its own value as `item` (on an array field: added or removed); a file input its File (`multiple`: File[]; none: null) */
|
|
3521
|
-
CHANGE: { name: string; value: any; item?: any; file?: boolean };
|
|
3894
|
+
/** A field changed (the form element's input events): `{ name, value }`; a checkbox gives `checked` as `value` and its own value as `item` (on an array field: added or removed, kept in document order: 7.2) and as `order` its group's values as rendered; a file input its File (`multiple`: File[]; none: null) */
|
|
3895
|
+
CHANGE: { name: string; value: any; item?: any; order?: ReadonlyArray<string>; file?: boolean };
|
|
3522
3896
|
/**
|
|
3523
3897
|
* Several fields at once, by field name (`{ values: { name: 'Dana', 'addresses.7.city': 'Hilo' } }`),
|
|
3524
3898
|
* as if typed: one validation, `touched` as for CHANGE, their server errors and check results
|
|
@@ -4016,10 +4390,12 @@ type Component<
|
|
|
4016
4390
|
* actions on this instance; send with `{ to: 'room', json }` from a model entry (a connection
|
|
4017
4391
|
* the same action opens or changes is declared first). Dispose closes them.
|
|
4018
4392
|
*/
|
|
4019
|
-
connections?: (state: STATE & CALCULATED) => Connections;
|
|
4393
|
+
connections?: (state: STATE & CALCULATED, context: CONTEXT) => Connections;
|
|
4020
4394
|
/**
|
|
4021
4395
|
* PLAN-3: declarative reads (`makeFetchDriver()`). Each entry derives a
|
|
4022
|
-
* request from state
|
|
4396
|
+
* request from state (and, PLAN-13 F-1, the context as its second argument, as every
|
|
4397
|
+
* declaration static: `(state, { route }) => '/api/items/' + route.params.id`; re-run when the
|
|
4398
|
+
* context changes); falsy means idle:
|
|
4023
4399
|
* `Quote.resources = { quote: (state) => state.id && '/api/quotes/' + state.id }`.
|
|
4024
4400
|
* `state.quote` is a `Resource`: `{ status: 'idle' | 'loading' | 'success' | 'error', data,
|
|
4025
4401
|
* error, refreshing }`, written by the built-in RESOURCE action (idle until the first request).
|
|
@@ -4029,7 +4405,7 @@ type Component<
|
|
|
4029
4405
|
* `data`, `error` and `status` and sets `refreshing: true` (D78). `ok` / `error` on the
|
|
4030
4406
|
* request also dispatch those actions after the write.
|
|
4031
4407
|
*/
|
|
4032
|
-
resources?: { [name: string]: (state: STATE & CALCULATED) => ResourceRequest | false | null | undefined | '' | 0 };
|
|
4408
|
+
resources?: { [name: string]: (state: STATE & CALCULATED, context: CONTEXT) => ResourceRequest | false | null | undefined | '' | 0 };
|
|
4033
4409
|
/**
|
|
4034
4410
|
* The router's reply action (`makeRouter()`): `App.route = 'ROUTE'`. The driver sends this
|
|
4035
4411
|
* instance ROUTE with the `Route` (`{ name, params, query, hash, path }`) once declared and on
|
|
@@ -4051,7 +4427,7 @@ type Component<
|
|
|
4051
4427
|
* `renderToString(App, { head: list })` for SSR (`renderHead(list)`). Like every declaration
|
|
4052
4428
|
* static, it is sent with or without a model; a root needs `initialState` (SYG132).
|
|
4053
4429
|
*/
|
|
4054
|
-
head?: (state: STATE & CALCULATED) => HeadValue | false | null | undefined;
|
|
4430
|
+
head?: (state: STATE & CALCULATED, context: CONTEXT) => HeadValue | false | null | undefined;
|
|
4055
4431
|
/**
|
|
4056
4432
|
* PLAN-4 GS-1: behaviors this component uses, each under its state key:
|
|
4057
4433
|
* `TaskList.uses = { pager: pager({ pageSize: 10, next: Newer, prev: Older }) }` gives
|
|
@@ -4068,7 +4444,7 @@ type Component<
|
|
|
4068
4444
|
* fires once (`{ t }`), `frame` runs every animation frame (`{ t, dt }`). A hidden Switchable
|
|
4069
4445
|
* page's timers stop unless `background: true`; dispose stops them; nothing runs during SSR.
|
|
4070
4446
|
*/
|
|
4071
|
-
timers?: (state: STATE & CALCULATED) => Timers<ActionNameOf<ACTIONS>>;
|
|
4447
|
+
timers?: (state: STATE & CALCULATED, context: CONTEXT) => Timers<ActionNameOf<ACTIONS>>;
|
|
4072
4448
|
/**
|
|
4073
4449
|
* PLAN-5 B-3: browser sources derived from state, run by `makeBrowserDriver()` (registered:
|
|
4074
4450
|
* `run(App, { BROWSER: makeBrowserDriver() })`; renderComponent provides a fake, `t.browser`)
|
|
@@ -4078,7 +4454,7 @@ type Component<
|
|
|
4078
4454
|
* restarts. A hidden Switchable page's sources stop unless `background: true`; dispose stops
|
|
4079
4455
|
* them; nothing runs during SSR.
|
|
4080
4456
|
*/
|
|
4081
|
-
browser?: (state: STATE & CALCULATED) => BrowserSources<ActionNameOf<ACTIONS>>;
|
|
4457
|
+
browser?: (state: STATE & CALCULATED, context: CONTEXT) => BrowserSources<ActionNameOf<ACTIONS>>;
|
|
4082
4458
|
/**
|
|
4083
4459
|
* PLAN-4 GS-5: save this root component's state and restore it at startup:
|
|
4084
4460
|
* `TodoApp.persist = persist({ key: 'todo-app', pick: ['todos', 'filter'] })`. `pick` / `omit`
|
|
@@ -4201,8 +4577,8 @@ type VirtualCollectionProps<PROPS = any, STATE = any> = {
|
|
|
4201
4577
|
/** Where `scrollToIndex` / `scrollToId` put the row: 'auto' (default) scrolls only when it isn't in view */
|
|
4202
4578
|
type ScrollToAlign = 'auto' | 'start' | 'center' | 'end'
|
|
4203
4579
|
|
|
4204
|
-
type SwitchableProps<PROPS = any> = {
|
|
4205
|
-
of:
|
|
4580
|
+
type SwitchableProps<PROPS = any, OF extends Record<string, AnyComponent> = Record<string, AnyComponent>> = {
|
|
4581
|
+
of: OF;
|
|
4206
4582
|
current: string;
|
|
4207
4583
|
/**
|
|
4208
4584
|
* The current page's instance key. When it changes, the current page is disposed and created
|
|
@@ -4210,7 +4586,14 @@ type SwitchableProps<PROPS = any> = {
|
|
|
4210
4586
|
* show. Switching `current` alone keeps pages alive. Router recipe: `instance={state.route.path}`
|
|
4211
4587
|
*/
|
|
4212
4588
|
instance?: string | number;
|
|
4213
|
-
|
|
4589
|
+
/**
|
|
4590
|
+
* The pages' state: a key or path (`'pages'`), a lens, or (PLAN-13 F-3) a map from page names to
|
|
4591
|
+
* those (`{ projects: 'pages.projects', settings: byId('teams', state.teamId) }`): each listed
|
|
4592
|
+
* page binds its own target with a tag child's lifetime rules (another key or id makes that page
|
|
4593
|
+
* again, a deleted target disposes it), and the pages not listed share the owner's state. A key
|
|
4594
|
+
* that names no page is SYG429
|
|
4595
|
+
*/
|
|
4596
|
+
state?: string | Lense | { [PAGE in keyof NoInfer<OF>]?: string | Lense };
|
|
4214
4597
|
} & Omit<PROPS, 'of' | 'state' | 'current' | 'instance'>
|
|
4215
4598
|
|
|
4216
4599
|
type PortalProps = {
|
|
@@ -4554,7 +4937,12 @@ type FormSource = {
|
|
|
4554
4937
|
events(eventName: string, ...args: any[]): Stream<any>
|
|
4555
4938
|
}
|
|
4556
4939
|
|
|
4557
|
-
|
|
4940
|
+
/**
|
|
4941
|
+
* processForm's entries: a field's string (a file input: its File); a `<select multiple>`, checkboxes
|
|
4942
|
+
* sharing a name (7.2) and a multiple widget field an array of their values; declare those in
|
|
4943
|
+
* FIELDS: `{ tags: string[] }`
|
|
4944
|
+
*/
|
|
4945
|
+
type FormData<FIELDS extends Record<string, any> = Record<string, string>> = FIELDS & {
|
|
4558
4946
|
event: globalThis.Event;
|
|
4559
4947
|
eventType: string;
|
|
4560
4948
|
}
|
|
@@ -4578,7 +4966,7 @@ type ProcessFormOptions = {
|
|
|
4578
4966
|
* // form$ is Stream<FormData<{ username: string; email: string }>>
|
|
4579
4967
|
* // form$.username is typed as string ✓
|
|
4580
4968
|
*/
|
|
4581
|
-
declare function processForm<FIELDS extends Record<string,
|
|
4969
|
+
declare function processForm<FIELDS extends Record<string, any> = Record<string, string>>(
|
|
4582
4970
|
target: FormSource,
|
|
4583
4971
|
options?: ProcessFormOptions
|
|
4584
4972
|
): Stream<FormData<FIELDS>>
|
|
@@ -4692,7 +5080,7 @@ declare function Collection<PROPS extends { [prop: string]: any }, STATE = any>(
|
|
|
4692
5080
|
* <VirtualCollection of={Row} from="rows" className="rows" estimateSize={32} />
|
|
4693
5081
|
*/
|
|
4694
5082
|
declare function VirtualCollection<PROPS extends { [prop: string]: any }, STATE = any>(props: VirtualCollectionProps<PROPS, STATE>): JSX.Element
|
|
4695
|
-
declare function Switchable<PROPS extends { [prop: string]: any }>(props: SwitchableProps<PROPS>): JSX.Element
|
|
5083
|
+
declare function Switchable<PROPS extends { [prop: string]: any }, OF extends Record<string, AnyComponent> = Record<string, AnyComponent>>(props: SwitchableProps<PROPS, OF>): JSX.Element
|
|
4696
5084
|
declare function Portal(props: PortalProps): JSX.Element
|
|
4697
5085
|
declare function Transition(props: TransitionProps): JSX.Element
|
|
4698
5086
|
declare function Suspense(props: SuspenseProps): JSX.Element
|
|
@@ -4753,6 +5141,48 @@ type ReplyRequest = {
|
|
|
4753
5141
|
catch?: never;
|
|
4754
5142
|
}
|
|
4755
5143
|
|
|
5144
|
+
declare const replySenderBrand: unique symbol
|
|
5145
|
+
/**
|
|
5146
|
+
* The component instance that sent a request to a driver (opaque). `senderOf(request)` reads it;
|
|
5147
|
+
* pass it to `reply()` to answer that instance with one of its actions.
|
|
5148
|
+
*/
|
|
5149
|
+
type ReplySender = { readonly [replySenderBrand]: true }
|
|
5150
|
+
|
|
5151
|
+
/** What makeReplies() returns: the source part that marks the driver, and the way to answer */
|
|
5152
|
+
type ReplyChannel = {
|
|
5153
|
+
/**
|
|
5154
|
+
* Spread into the driver's source (`return { ...replies, select }`): the core then stamps each
|
|
5155
|
+
* request a component sends with its sender and delivers `reply()`s as that instance's actions.
|
|
5156
|
+
*/
|
|
5157
|
+
replies: { readonly __sygnalReplies: true; replies(sender: ReplySender): Stream<{ type: string; data: any }> };
|
|
5158
|
+
/** Dispatch `type` with `data` on the sender (dropped when it is gone). Call it as often as needed */
|
|
5159
|
+
reply(sender: ReplySender, type: string, data?: any): void;
|
|
5160
|
+
/** Whether the sender is still mounted (a reply would reach it) */
|
|
5161
|
+
listening(sender: ReplySender): boolean;
|
|
5162
|
+
}
|
|
5163
|
+
|
|
5164
|
+
/**
|
|
5165
|
+
* PLAN-13 D-1: reply actions for a driver you write (the protocol makeFetchDriver,
|
|
5166
|
+
* driverFromAsync and the socket driver use). `onStop(sender)` runs when a sender is disposed:
|
|
5167
|
+
* abort what it still has in flight.
|
|
5168
|
+
*
|
|
5169
|
+
* const { replies, reply } = makeReplies((sender) => inflight.get(sender)?.abort())
|
|
5170
|
+
* sink$.addListener({ next: (req) => {
|
|
5171
|
+
* const sender = senderOf(req)
|
|
5172
|
+
* if (sender === undefined) return // not sent by a component
|
|
5173
|
+
* run(req, (f) => req.progress && reply(sender, req.progress, f))
|
|
5174
|
+
* .then((v) => req.ok && reply(sender, req.ok, v), (error) => req.error && reply(sender, req.error, { error, request: req }))
|
|
5175
|
+
* } })
|
|
5176
|
+
* return { ...replies }
|
|
5177
|
+
*
|
|
5178
|
+
* A name with no model entry on the sender is SYG112 in the dev entry (ok / error / progress
|
|
5179
|
+
* statically). Guide: https://sygnal.js.org/guide/custom-drivers/
|
|
5180
|
+
*/
|
|
5181
|
+
declare function makeReplies(onStop?: (sender: ReplySender) => void): ReplyChannel
|
|
5182
|
+
|
|
5183
|
+
/** The component instance that sent `request` to a driver with reply actions, or undefined (not sent by a component) */
|
|
5184
|
+
declare function senderOf(request: object): ReplySender | undefined
|
|
5185
|
+
|
|
4756
5186
|
/**
|
|
4757
5187
|
* A request to a driverFromAsync() sink: your own fields (`value`, the args, ...) plus the
|
|
4758
5188
|
* reply-action keys `ok` / `error`. Type the driver's sink with it: `{ QUOTE: { source:
|
|
@@ -5228,6 +5658,15 @@ type SocketActions = {
|
|
|
5228
5658
|
* hidden page's connections close, and open again as new ones when it is shown)
|
|
5229
5659
|
*/
|
|
5230
5660
|
background?: boolean;
|
|
5661
|
+
/**
|
|
5662
|
+
* PLAN-13 S-1: a connection that stays silent this long (ms) is taken as dead (a half-open
|
|
5663
|
+
* socket behind a proxy): it is closed as a drop, `close` gets `{ stale: true, willReconnect }`,
|
|
5664
|
+
* and the reconnect policy applies. Every event counts; over fetch (an `sse` with `headers`)
|
|
5665
|
+
* any bytes do, heartbeat comments (`: ping`) included, while the native EventSource needs a
|
|
5666
|
+
* real event (a `message`, or a named event listed in `events`). Set it above the server's
|
|
5667
|
+
* heartbeat interval
|
|
5668
|
+
*/
|
|
5669
|
+
staleAfterMs?: number;
|
|
5231
5670
|
/** Not allowed: a `then` key makes the value a thenable (SYG610). Use `message` / `open` */
|
|
5232
5671
|
then?: never;
|
|
5233
5672
|
catch?: never;
|
|
@@ -5254,6 +5693,29 @@ type SseConnection = SocketActions & {
|
|
|
5254
5693
|
headers?: Record<string, string>;
|
|
5255
5694
|
/** Named events → actions: `{ 'price-update': 'PRICE' }` (data JSON-parsed when it parses) */
|
|
5256
5695
|
events?: Record<string, string>;
|
|
5696
|
+
/**
|
|
5697
|
+
* PLAN-13 S-1: the `message` and `events` actions get `SseEvent` (`{ data, id, event }`: the
|
|
5698
|
+
* event id and type) instead of the data alone
|
|
5699
|
+
*/
|
|
5700
|
+
meta?: boolean;
|
|
5701
|
+
/**
|
|
5702
|
+
* PLAN-13 S-1: resume after a reconnect the driver makes (EventSource gave up: a proxy 502, a
|
|
5703
|
+
* non-2xx on the `headers` path) from the last event id. Over fetch (`headers`) it is sent as
|
|
5704
|
+
* `Last-Event-ID`; the native EventSource can't send it, so it goes on the URL:
|
|
5705
|
+
* `?lastEventId=<id>` (`true`) or `?<name>=<id>` (a parameter name). EventSource's own retries
|
|
5706
|
+
* send `Last-Event-ID` anyway
|
|
5707
|
+
*/
|
|
5708
|
+
resume?: true | string;
|
|
5709
|
+
}
|
|
5710
|
+
|
|
5711
|
+
/** PLAN-13 S-1: an SSE event as a `meta: true` connection's actions get it */
|
|
5712
|
+
type SseEvent<DATA = any> = {
|
|
5713
|
+
/** The data, JSON-parsed when it parses */
|
|
5714
|
+
data: DATA;
|
|
5715
|
+
/** The event's `id:` (the last one sent when this event has none; '' when there was none) */
|
|
5716
|
+
id: string;
|
|
5717
|
+
/** The event type: 'message', or the named event's name */
|
|
5718
|
+
event: string;
|
|
5257
5719
|
}
|
|
5258
5720
|
|
|
5259
5721
|
/**
|
|
@@ -5279,7 +5741,7 @@ type SocketRequest =
|
|
|
5279
5741
|
/** Data of a connection's `open` action */
|
|
5280
5742
|
type SocketOpen = { reconnected: boolean }
|
|
5281
5743
|
/** Data of a connection's `close` action (SSE: no code / reason) */
|
|
5282
|
-
type SocketClose = { code?: number; reason?: string; willReconnect: boolean }
|
|
5744
|
+
type SocketClose = { code?: number; reason?: string; willReconnect: boolean; /** PLAN-13 S-1: closed by staleAfterMs (nothing arrived) */ stale?: true }
|
|
5283
5745
|
/** Data of a connection's `error` action: the error Event (or the constructor's exception) */
|
|
5284
5746
|
type SocketError = { error: any }
|
|
5285
5747
|
|
|
@@ -5464,11 +5926,16 @@ declare function makeHeadDriver(options?: { titleTemplate?: string; document?: a
|
|
|
5464
5926
|
* `after`: once, after ms (0 or more); `frame`: every animation frame (requestAnimationFrame,
|
|
5465
5927
|
* else every 16 ms). `background: true` keeps it running while its Switchable page is hidden.
|
|
5466
5928
|
* An invalid spec is not started (SYG422 in dev).
|
|
5929
|
+
*
|
|
5930
|
+
* A `frame` timer for a game (canvas-game R2): `keys` samples the keyboard with each frame
|
|
5931
|
+
* (`{ left: ['ArrowLeft', 'KeyA'], jump: 'Space' }`, KeyboardEvent codes or keys; the data gets
|
|
5932
|
+
* `held`, `pressed`, `released`: TimerFrameInput), and `step` (ms) makes it a fixed timestep: one
|
|
5933
|
+
* action per whole step the frame time owes, at most `max` (default 5) a frame.
|
|
5467
5934
|
*/
|
|
5468
5935
|
type TimerSpec<ACTION extends string = string> =
|
|
5469
5936
|
| { every: number; action: ACTION; background?: boolean; after?: never; frame?: never }
|
|
5470
5937
|
| { after: number; action: ACTION; background?: boolean; every?: never; frame?: never }
|
|
5471
|
-
| { frame: ACTION; background?: boolean; every?: never; after?: never; action?: never }
|
|
5938
|
+
| { frame: ACTION; keys?: Record<string, string | readonly string[]>; step?: number; max?: number; background?: boolean; every?: never; after?: never; action?: never }
|
|
5472
5939
|
|
|
5473
5940
|
/** A component's whole set of timers, by name: a falsy entry (`state.running && { ... }`) is stopped */
|
|
5474
5941
|
type Timers<ACTION extends string = string> = { [name: string]: TimerSpec<ACTION> | false | null | undefined | 0 | '' }
|
|
@@ -5477,8 +5944,21 @@ type Timers<ACTION extends string = string> = { [name: string]: TimerSpec<ACTION
|
|
|
5477
5944
|
interface TimerTick { n: number; t: number }
|
|
5478
5945
|
/** The data of an `after` timer's action: Date.now() */
|
|
5479
5946
|
interface TimerAfter { t: number }
|
|
5480
|
-
/**
|
|
5481
|
-
|
|
5947
|
+
/**
|
|
5948
|
+
* The data of a `frame` timer's action: Date.now() and the ms since the previous frame (0 on the
|
|
5949
|
+
* first); with `step`, `dt` is the step and `steps` / `i` say how many steps this frame sends and
|
|
5950
|
+
* which one this is; with `keys`, the input (TimerFrameInput)
|
|
5951
|
+
*/
|
|
5952
|
+
interface TimerFrame<BUTTON extends string = string> extends Partial<TimerFrameInput<BUTTON>> { t: number; dt: number; steps?: number; i?: number }
|
|
5953
|
+
/**
|
|
5954
|
+
* A `frame` timer's sampled keys: `held` (every button, true while one of its keys is down; the
|
|
5955
|
+
* same object while nothing changed), `pressed` / `released` (the buttons that went down / up since
|
|
5956
|
+
* the last frame, so a tap shorter than a frame counts; with `step`, on the frame's first step).
|
|
5957
|
+
* Listened for on the document while the timer runs: the keys are default-prevented (repeats
|
|
5958
|
+
* ignored), not while a text field has the focus; the window losing focus or the page hiding
|
|
5959
|
+
* releases every button.
|
|
5960
|
+
*/
|
|
5961
|
+
interface TimerFrameInput<BUTTON extends string = string> { held: Record<BUTTON, boolean>; pressed: BUTTON[]; released: BUTTON[] }
|
|
5482
5962
|
|
|
5483
5963
|
/**
|
|
5484
5964
|
* PLAN-4 GS-7: runs the components' `timers` statics: `run(App, { TIMER: makeTimerDriver() })`.
|
|
@@ -5628,6 +6108,14 @@ interface InstallPrompt {
|
|
|
5628
6108
|
|
|
5629
6109
|
declare function createInstallPrompt(): InstallPrompt
|
|
5630
6110
|
|
|
6111
|
+
/** Which instance t.simulateAction() sends to (default: the rendered component) */
|
|
6112
|
+
interface SimulateActionOptions {
|
|
6113
|
+
/** The first rendered instance of this component (or its name) */
|
|
6114
|
+
component?: AnyComponent | string;
|
|
6115
|
+
/** Only an instance rendered inside the first element matching this selector or control (a Collection item) */
|
|
6116
|
+
within?: string | AnyControl;
|
|
6117
|
+
}
|
|
6118
|
+
|
|
5631
6119
|
interface SimulatedEventInit {
|
|
5632
6120
|
/** Merged into `event.target` (value, checked, dataset, ...) */
|
|
5633
6121
|
target?: Record<string, any>;
|
|
@@ -5641,6 +6129,12 @@ interface SimulatedEventInit {
|
|
|
5641
6129
|
data?: Record<string, any>;
|
|
5642
6130
|
/** Keyboard key (e.key) */
|
|
5643
6131
|
key?: string;
|
|
6132
|
+
/**
|
|
6133
|
+
* Shorthand for target.files: the files a file input holds. The target gets them as a FileList
|
|
6134
|
+
* (with `dom: 'real'` a real one where the environment has DataTransfer, else defined on the
|
|
6135
|
+
* element): `t.simulateEvent('[name="avatar"]', 'input', { files: [new File(['…'], 'me.png')] })`
|
|
6136
|
+
*/
|
|
6137
|
+
files?: ArrayLike<File> | File[];
|
|
5644
6138
|
/**
|
|
5645
6139
|
* Don't fail when the selector matches no rendered element: wait up to 300ms for it, then
|
|
5646
6140
|
* drop the event with SYG103 (info). Not copied onto the event.
|
|
@@ -5739,6 +6233,23 @@ interface RenderOptions {
|
|
|
5739
6233
|
timingAudit?: boolean;
|
|
5740
6234
|
/** Override initial state (defaults to component's .initialState) */
|
|
5741
6235
|
initialState?: any;
|
|
6236
|
+
/**
|
|
6237
|
+
* 7.2: what handlers' `now()` (4th argument) returns: a number fixes the clock at that time (ms
|
|
6238
|
+
* since the epoch, or a Date), a function is called each time. Default: Date.now() (fake timers
|
|
6239
|
+
* apply)
|
|
6240
|
+
*/
|
|
6241
|
+
now?: number | Date | (() => number);
|
|
6242
|
+
/**
|
|
6243
|
+
* 7.2: what handlers' `random()` returns: a number seeds a deterministic generator (the same
|
|
6244
|
+
* sequence on every run), a function is called each time. Default: Math.random()
|
|
6245
|
+
*/
|
|
6246
|
+
random?: number | (() => number);
|
|
6247
|
+
/**
|
|
6248
|
+
* 7.2: what handlers' `uuid()` returns: `true` gives deterministic UUID-shaped ids in order
|
|
6249
|
+
* (`00000000-0000-4000-8000-000000000001`, `…002`, ...), a function is called each time.
|
|
6250
|
+
* Default: crypto.randomUUID()
|
|
6251
|
+
*/
|
|
6252
|
+
uuid?: true | (() => string);
|
|
5742
6253
|
/**
|
|
5743
6254
|
* D214: context from the ancestors the rendered component would have, for testing a child
|
|
5744
6255
|
* alone: `renderComponent(Greeting, { context: { lang: 'fr' } })`. The view, reducers and
|
|
@@ -5957,16 +6468,32 @@ interface RenderResult<STATE = any> {
|
|
|
5957
6468
|
sinks: Record<string, any>;
|
|
5958
6469
|
/** All source objects by driver name */
|
|
5959
6470
|
sources: Record<string, any>;
|
|
5960
|
-
/**
|
|
5961
|
-
|
|
6471
|
+
/**
|
|
6472
|
+
* Push an action into the intent→model pipeline under its real name (all sinks of the entry run),
|
|
6473
|
+
* like the component's intent emitting it. It reaches one instance: the rendered component, or
|
|
6474
|
+
* with `{ component: Child }` the first rendered instance of `Child` (`within`: inside the first
|
|
6475
|
+
* element matching a selector or control, e.g. one Collection item). A name that instance has no
|
|
6476
|
+
* model entry for (nor a behavior action or a built-in) fails the test, naming the components
|
|
6477
|
+
* that handle it: `t.simulateAction('INFER_FILE', file, { component: Start })`. Awaitable:
|
|
6478
|
+
* resolves once the action is delivered and the tree has rendered it
|
|
6479
|
+
*/
|
|
6480
|
+
simulateAction: (actionName: string, data?: any, options?: SimulateActionOptions) => Promise<void>;
|
|
6481
|
+
/**
|
|
6482
|
+
* Wait for `n` frames (default 1) of the running `frame` timers: their actions reduced, the tree
|
|
6483
|
+
* rendered. Under fake timers it moves the clock frame by frame (deterministic: the same input,
|
|
6484
|
+
* the same frames); with real timers it waits for them. Rejects when no frame timer runs.
|
|
6485
|
+
* `settle()` doesn't wait on a frame loop: what a frame timer causes isn't activity.
|
|
6486
|
+
*/
|
|
6487
|
+
frames: (n?: number) => Promise<void>;
|
|
5962
6488
|
/**
|
|
5963
6489
|
* Dispatch a synthetic DOM event through the mock DOM source so the component's real intent
|
|
5964
6490
|
* streams fire (DOM.click('.x'), DOM.select('.x').events('click'), .value(), .data()).
|
|
5965
6491
|
* Targets the first rendered element matching `selector` and bubbles within its isolation scope.
|
|
5966
6492
|
* Selectors match the rendered tree like the real DOM: tag, .class, #id, [attr], [attr="v"]
|
|
5967
6493
|
* (^= $= *= ~=), :first-child, :last-child, :only-child, :nth-child(an+b|odd|even),
|
|
5968
|
-
* :nth-last-child(), :first/last/only/nth-of-type, :not(), descendant ' '
|
|
5969
|
-
* combinators, ',' lists. Other syntax (:has(),
|
|
6494
|
+
* :nth-last-child(), :first/last/only/nth-of-type, :not(), descendant ' ', child '>',
|
|
6495
|
+
* next-sibling '+' and later-sibling '~' combinators, ',' lists. Other syntax (:has(),
|
|
6496
|
+
* pseudo-elements...) throws.
|
|
5970
6497
|
* If nothing matches yet, the event waits (up to 300ms, re-checked on every render) for a
|
|
5971
6498
|
* matching element, then targets the first one. If none renders, the test fails with an
|
|
5972
6499
|
* error naming the selector: it rejects the pending next()/waitForState()/settle(), or is
|
|
@@ -5977,8 +6504,15 @@ interface RenderResult<STATE = any> {
|
|
|
5977
6504
|
* `'document'` / `'body'` go to the DOM.select('document' | 'body') listeners.
|
|
5978
6505
|
* simulateAction/simulateEvent calls are delivered in call order; a waiting event holds the
|
|
5979
6506
|
* calls after it. Reports SYG104 (selector only matches inside a child component).
|
|
6507
|
+
*
|
|
6508
|
+
* The event is delivered later, not during the call, so `t.query()` / `t.html()` right after it
|
|
6509
|
+
* still show the old view. The returned promise resolves once the event is delivered and the
|
|
6510
|
+
* tree has rendered what it caused (the real DOM: patched): `await t.simulateEvent('.retry',
|
|
6511
|
+
* 'click')`, then `t.query('.skeleton')`. It never rejects (a selector that matches nothing still
|
|
6512
|
+
* fails the next wait), and awaiting it moves fake timers like the other waits; an un-awaited
|
|
6513
|
+
* call doesn't. A `t.next(pred)` after it waits for a further state.
|
|
5980
6514
|
*/
|
|
5981
|
-
simulateEvent: (selector: string | AnyControl, eventType: string, eventInit?: SimulatedEventInit) => void
|
|
6515
|
+
simulateEvent: (selector: string | AnyControl, eventType: string, eventInit?: SimulatedEventInit) => Promise<void>;
|
|
5982
6516
|
/**
|
|
5983
6517
|
* Resolves once the component is subscribed (earlier simulate* calls are buffered and replayed).
|
|
5984
6518
|
* Also a cursor: the first next() after `await t.ready()` also matches the states the replayed
|
|
@@ -6101,9 +6635,10 @@ interface RenderResult<STATE = any> {
|
|
|
6101
6635
|
open: (sinkName: string, target?: FakeConnectionTarget) => Promise<void>;
|
|
6102
6636
|
/**
|
|
6103
6637
|
* The server sends `data` (objects as JSON text) on open connection(s): `message` fires with
|
|
6104
|
-
* the data, JSON-parsed when it parses. `{ event, connection? }` sends an SSE named event
|
|
6638
|
+
* the data, JSON-parsed when it parses. `{ event, connection? }` sends an SSE named event;
|
|
6639
|
+
* `{ id }` gives an SSE event its id (what `meta: true` reports and `resume` resumes from).
|
|
6105
6640
|
*/
|
|
6106
|
-
push: (sinkName: string, data: any, target?: FakeConnectionTarget | { event?: string; connection?: FakeConnectionTarget }) => Promise<void>;
|
|
6641
|
+
push: (sinkName: string, data: any, target?: FakeConnectionTarget | { event?: string; id?: string | number; connection?: FakeConnectionTarget }) => Promise<void>;
|
|
6107
6642
|
/**
|
|
6108
6643
|
* Connection(s) close without the app closing them: `close` fires with `{ code, reason,
|
|
6109
6644
|
* willReconnect }` (default `{ code: 1006, reason: '' }`; a connecting one fails to open: `error`
|
|
@@ -6196,16 +6731,21 @@ interface RenderResult<STATE = any> {
|
|
|
6196
6731
|
* null: `expect(t.query('input[name="plan"]:checked').value).toBe('team')`. With `dom: 'real'`
|
|
6197
6732
|
* a real element (any CSS selector); with the mock DOM a read-only snapshot of what the view
|
|
6198
6733
|
* rendered (simulateEvent's selectors plus `:checked`/`:disabled`/`:enabled`; textContent,
|
|
6199
|
-
* value, checked, disabled, getAttribute, classList, dataset, querySelector, closest
|
|
6200
|
-
* focus()). Throws before the first render (`await t.ready()`
|
|
6201
|
-
* `await t.next(pred)` / `waitForState` / `settle()` / `ready()`
|
|
6734
|
+
* value, checked, disabled, getAttribute, classList, dataset, querySelector, closest,
|
|
6735
|
+
* next/previousElementSibling...; no focus()). Throws before the first render (`await t.ready()`
|
|
6736
|
+
* first). Right after `await t.next(pred)` / `waitForState` / `settle()` / `ready()` /
|
|
6737
|
+
* `simulateEvent()` it shows the state the wait resolved with.
|
|
6202
6738
|
*/
|
|
6203
6739
|
query: {
|
|
6204
6740
|
<E extends Element = Element>(selector: string): E | null;
|
|
6205
6741
|
/** A control's element (`t.query(Draft)` is an HTMLInputElement for an 'input' control), or null */
|
|
6206
6742
|
<CONTROL extends AnyControl>(control: CONTROL): ControlElementOf<CONTROL> | null;
|
|
6207
6743
|
};
|
|
6208
|
-
/**
|
|
6744
|
+
/**
|
|
6745
|
+
* Every element matching a selector (or a control) in the rendered tree (Portals included), as
|
|
6746
|
+
* query(), in document order, also for a ',' list: `t.queryAll('.empty, .filters')` lists
|
|
6747
|
+
* whichever comes first first (an order check)
|
|
6748
|
+
*/
|
|
6209
6749
|
queryAll: {
|
|
6210
6750
|
<E extends Element = Element>(selector: string): E[];
|
|
6211
6751
|
<CONTROL extends AnyControl>(control: CONTROL): Array<ControlElementOf<CONTROL>>;
|
|
@@ -6374,4 +6914,4 @@ declare global {
|
|
|
6374
6914
|
*/
|
|
6375
6915
|
declare function byId<T = any, S = any>(field: string, id: unknown, idKey?: string): { get(state: S): T | undefined; set(state: S, value: T): S }
|
|
6376
6916
|
|
|
6377
|
-
export { ABORT, type ActionCause, type ActionsOf, type ActiveTimer, type AgentAction, type AgentConfirm, type AgentConfirmInfo, type AgentDeclaration, type AgentIssue, type AgentQuery, type AgentQueryResult, type AgentResult, type AgentSchema, type AgentTool, type AgentToolSet, type AgentToolsOptions, type AguiOptions, type AnswerPick, type AnswerPicks, type AnthropicMessagesOptions, type AnyComponentModule, type AnyControl, type AppErrorHook, type AppErrorInfo, type AppErrorPhase, type ArrayKeysOf, type ArrayPathsOf, type AsyncDriverError, type AsyncDriverFromFunction, type AsyncRequest, type Behavior, type BehaviorDefinition, type BehaviorFactory, type BehaviorHandler, type BehaviorModelEntry, type BehaviorProps, type BehaviorSources, type BehaviorState, type BehaviorTarget, type BrowserCommand, type BrowserFake, type BrowserFakeOptions, type BrowserIntersection, type BrowserPosition, type BrowserResize, type BrowserSource, type BrowserSources, type BrowserSpec, type Catalog, type CatalogContainer, type CatalogContainerDecl, type CatalogDecl, type CatalogOption, type CatalogParam, type CatalogParamValue, type CatalogParamsOf, type CatalogPart, type CatalogPartDecl, type CatalogRecord, type CatalogTree, type CatalogTreeNode, type ChatAbort, type ChatActions, type ChatAskOptions, type ChatCall, type ChatCard, type ChatCardStatus, type ChatClientTool, type ChatCompletionsOptions, type ChatDelta, type ChatDone, type ChatDriverOptions, type ChatError, type ChatEvent, type ChatOk, type ChatOptions, type ChatOutputOf, type ChatOutputSchema, type ChatRequest, type ChatSource, type ChatState, type ChatStatus, type ChatTool, type ChatToolCall, type ChatToolPart, type ChatTransport, type ChatUsage, type ChromePromptOptions, type ChromePromptStatus, type ChromePromptTransport, type ClassesType, Collection, type CollectionFrom, type CollectionProps, type Command, type CommandBarActions, type CommandBarOptions, type CommandBarResult, type CommandBarState, type CommandBarStatus, type CommandBarUnsure, type CommandSource, type Component, type ComposeActions, type ComposeAnswer, type ComposeBackend, type ComposeNames, type ComposeOptions, type ComposeRenderOptions, type ComposeRenderable, type ComposeState, type ComposeStatus, type ComposeTree, Composed, type ComposedProps, type Connections, type ContainerView, type Control, type ControlCommonProps, type ControlDOMSource, type ControlElementOf, type ControlEvent, type ControlH, type ControlPropsOf, type ControlSpec, type ControlSpecObject, type ControlsOf, type ConvertedSchema, type CycleDOMEvent, type CycleDriver, type DOMDriverOptions, type DOMEventShorthand, type DOMEventShorthands, type DOMSource, type DefaultDrivers, type DefineComponentOptions, type DevToolsActionCause, type DevToolsCopyAsTestOptions, type DevToolsSessionRecording, type Diagnostic, type DiagnosticCode, type DiagnosticSeverity, type DiagnosticsMode, type DiagnosticsOptions, type DragDriverCategory, type DragDriverRegistration, type DragDriverSource, type DragSource, type DragStartPayload, type DriverFactories, type DriverFromAsyncOptions, type DriverSpec, type DriverSpecs, type DropPayload, type ElementCommand, type ElementCommandRegistry, type ElementCommands, type ElementProps, type ElementTarget, type EmittedEvent, type EnrichedEventStream, type Event$1 as Event, type EventName, type EventPayload, type EventPayloadFunction, type EventSink, type EventsFnOptions, type EventsSource, type ExactShape, type ExplainedAction, type ExposeWebMcpOptions, type FakeCacheEntry, type FakeChatChunk, type FakeConnection, type FakeConnectionTarget, type FakeReplyOptions, type FetchCacheOptions, type FetchDriverOptions, type FetchError, type FetchFailure, type FetchInit, type FetchInvalidate, type FetchProgress, type FetchRequest, type FetchResponse, type FetchRetry, type FetchSource, type FieldErrors, type Filter, type FixDrivers, type FormActions, type FormBehavior, type FormCalculated, type FormData, type FormField, type FormFieldCheck, type FormFields, type FormOptions, type FormOutput, type FormRequest, type FormServerErrors, type FormSource, type FormState, type FormTool, type FormToolHandle, type FormToolResult, type FromAISDKOptions, type HeadValue, type HotModuleAPI, type HttpTransportOptions, type InspectAction, type InspectActionTrigger, type InspectChild, type InspectChildSelect, type InspectCommand, type InspectComponent, type InspectDiagnostic, type InspectFix, type InspectGraph, type InspectLocation, type InspectRecentAction, type InspectRelatedLocation, type InspectSelector, type InspectTextEdit, type InspectTimer, type InstallPrompt, type IntentSources, type IntrinsicControlProps, type JsonSchemaObject, type Layout, type LayoutNode, type LazyComponent, type LazyOptions, type Lens, type Lense, MainDOMSource, type McpAppDisplayMode, type McpAppDriverOptions, type McpAppError, type McpAppRequest, type McpAppSource, type McpContentBlock, type McpDownloadItem, type McpHostContext, type McpHostInfo, type McpLogLevel, type McpResourceContents, type McpSamplingRequest, type McpToolResult, type MockConfig, MockedDOMSource, type MultipartValue, type NonStateSinkReturns, type OpenResponsesEvent, type OpenResponsesOptions, type PagerActions, type PagerCalculated, type PagerOptions, type PagerState, type ParamNames, type ParentPayloadOf, type Persist, type PersistOptions, type PersistOptionsFor, type PersistStorage, type PersistedEntry, Portal, type PortalProps, type ProcessFormOptions, type QueryCache, type QueryCacheSnapshot, type QueryCacheSnapshotEntry, type Ref, type Ref$, type RegisteredEvent, type RenderOptions, type RenderResult, type RenderToStringOptions, type RenderableComponent, type ReplyRequest, type Resource, type ResourceRequest, type RootComponent, type Route, type RouteName, type RouteParamsArg, type RouteQuery, type Router, type RouterBlocked, type RouterCommand, type RouterOptions, type RouterSource, type RunOptions, type SchemaInput, type SchemaOutput, type ScrollToAlign, type SelectedDOMSource, type SelectionActions, type SelectionCalculated, type SelectionOptions, type SelectionState, type ServiceWorkerCommand, type ServiceWorkerOptions, type ServiceWorkerSource, type SimulatedEventInit, Slot, type SlotProps, type SocketActions, type SocketClose, type SocketConnection, type SocketDriverOptions, type SocketError, type SocketEvent, type SocketOpen, type SocketReconnect, type SocketRequest, type SocketSource, type SortFunction, type SortObject, type SortSpec, type SortableActions, type SortableDropped, type SortableOptions, type SortableState, type SseConnection, type StandardSchemaLike, type StateProp, type StrictDialect, type StrictSchemas, Suspense, type SuspenseProps, Switchable, type SwitchableProps, type SygnalApp, type SygnalBodyDOMSource, type SygnalDOMSource, type SygnalDevTools, type SygnalDocumentDOMSource, type SygnalEvents, type SygnalSinks, type TestAction, type Thunk, type ThunkData, type TimerAfter, type TimerFrame, type TimerSpec, type TimerTick, type Timers, Transition, type TransitionProps, type UIMessageStreamOptions, type UidFunction, type UndoBehaviorOptions, type UndoHistory, type UndoOptions, type UsesActions, type UsesState, type ViewProps, VirtualCollection, type VirtualCollectionProps, type WebMcpHandle, type Widget, type WidgetDefinition, type WidgetDispatch, type WidgetElementOf, type WidgetEmit, type WidgetHandle, type WidgetHostProps, type WithinTarget, abort, agentTools, agui, answers, anthropicMessages, askCard, byId, chat, chatCompletions, checkForm, choice, chromePrompt, classes, clearDiagnostics, clipboardSource, commandBar, compose, composeWith, controls, createCommand, createInstallPrompt, createRef, createRef$, decide, defineBehavior, defineCatalog, defineComponent, defineWidget, driverFromAsync, emit, enableHMR, encodeOpenResponses, event, exactState, experimentalExposeWebMcp, fieldName, fieldNames, focusInvalid, focusWithin, form, formErrors, formTool, fromAISDK, fromTree, geolocationSource, getDevTools, getDiagnostics, getField, hasField, intersectionSource, isSelected, jsonSchema, lazy, makeBrowserDriver, makeBrowserDriverWith, makeChatDriver, makeDOMDriver, makeDragDriver, makeFetchDriver, makeHeadDriver, makeMcpAppDriver, makeRouter, makeRouterDriver, makeServiceWorkerDriver, makeSocketDriver, makeTimerDriver, makeViewTransitionDOMDriver, mediaSource, messageText, mockDOMSource, noul, onDiagnostic, onlineSource, onlineStatus$, openResponses, openToolCalls, outputJsonSchema, pager, parseInput, persist, portal, processDrag, processForm, queryCache, removeNode, renderComponent, renderHead, renderToString, replyErrors, resizeSource, run, score, selection, set, setField, sortable, storageSource, strictSchemas, thunk, toJsonSchema, toTree, toggle, uiMessageStream, undo, undoable, visibilitySource, withToolResults, xs };
|
|
6917
|
+
export { ABORT, type ActionCause, type ActionsOf, type ActiveTimer, type AgentAction, type AgentConfirm, type AgentConfirmInfo, type AgentDeclaration, type AgentIssue, type AgentQuery, type AgentQueryResult, type AgentResult, type AgentSchema, type AgentTool, type AgentToolSet, type AgentToolsOptions, type AguiOptions, type AnswerPick, type AnswerPicks, type AnthropicMessagesOptions, type AnyComponentModule, type AnyControl, type AppErrorHook, type AppErrorInfo, type AppErrorPhase, type ArrayKeysOf, type ArrayPathsOf, type AsyncDriverError, type AsyncDriverFromFunction, type AsyncRequest, type Behavior, type BehaviorDefinition, type BehaviorFactory, type BehaviorHandler, type BehaviorModelEntry, type BehaviorProps, type BehaviorSources, type BehaviorState, type BehaviorTarget, type BrowserCommand, type BrowserFake, type BrowserFakeOptions, type BrowserIntersection, type BrowserPosition, type BrowserResize, type BrowserSource, type BrowserSources, type BrowserSpec, type Catalog, type CatalogContainer, type CatalogContainerDecl, type CatalogDecl, type CatalogOption, type CatalogParam, type CatalogParamValue, type CatalogParamsOf, type CatalogPart, type CatalogPartDecl, type CatalogRecord, type CatalogTree, type CatalogTreeNode, type ChatAbort, type ChatActions, type ChatAskOptions, type ChatCall, type ChatCard, type ChatCardStatus, type ChatClientTool, type ChatCompletionsOptions, type ChatDelta, type ChatDone, type ChatDriverOptions, type ChatError, type ChatEvent, type ChatOk, type ChatOptions, type ChatOutputOf, type ChatOutputSchema, type ChatRequest, type ChatSource, type ChatState, type ChatStatus, type ChatTool, type ChatToolCall, type ChatToolPart, type ChatTransport, type ChatUsage, type ChromePromptOptions, type ChromePromptStatus, type ChromePromptTransport, type ClassesType, Collection, type CollectionFrom, type CollectionProps, type Command, type CommandBarActions, type CommandBarOptions, type CommandBarResult, type CommandBarState, type CommandBarStatus, type CommandBarUnsure, type CommandSource, type Component, type ComposeActions, type ComposeAnswer, type ComposeBackend, type ComposeGenerated, type ComposeGeneratedOptions, type ComposeNames, type ComposeOptions, type ComposeRenderOptions, type ComposeRenderable, type ComposeState, type ComposeStatus, type ComposeTree, Composed, type ComposedProps, type Connections, type ContainerView, type Control, type ControlCommonProps, type ControlDOMSource, type ControlElementOf, type ControlEvent, type ControlH, type ControlPropsOf, type ControlSpec, type ControlSpecObject, type ControlsOf, type ConvertedSchema, type CycleDOMEvent, type CycleDriver, type DOMDriverOptions, type DOMEventShorthand, type DOMEventShorthands, type DOMSource, type DefaultDrivers, type DefineComponentOptions, type DevToolsActionCause, type DevToolsCopyAsTestOptions, type DevToolsSessionRecording, type Diagnostic, type DiagnosticCode, type DiagnosticSeverity, type DiagnosticsMode, type DiagnosticsOptions, type DragDriverCategory, type DragDriverRegistration, type DragDriverSource, type DragSource, type DragStartPayload, type DriverFactories, type DriverFromAsyncOptions, type DriverSpec, type DriverSpecs, type DropPayload, type ElementCommand, type ElementCommandRegistry, type ElementCommands, type ElementProps, type ElementTarget, type EmittedEvent, type EnrichedEventStream, type Event$1 as Event, type EventName, type EventPayload, type EventPayloadFunction, type EventSink, type EventsFnOptions, type EventsSource, type ExactShape, type ExplainedAction, type ExposeWebMcpOptions, type FakeCacheEntry, type FakeChatChunk, type FakeConnection, type FakeConnectionTarget, type FakeReplyOptions, type FetchCacheOptions, type FetchDriverOptions, type FetchError, type FetchFailure, type FetchInit, type FetchInvalidate, type FetchProgress, type FetchRequest, type FetchResponse, type FetchRetry, type FetchSource, type FieldErrors, type Filter, type FixDrivers, type FormActions, type FormBehavior, type FormCalculated, type FormData, type FormField, type FormFieldCheck, type FormFields, type FormOptions, type FormOutput, type FormRequest, type FormServerErrors, type FormSource, type FormState, type FormTool, type FormToolHandle, type FormToolResult, type FromAISDKOptions, type GeneratedData, type GeneratedEmit, type GeneratedEvent, type GeneratedRepairState, type HandlerEntropy, type HeadValue, type HotModuleAPI, type HttpTransportOptions, type InspectAction, type InspectActionTrigger, type InspectChild, type InspectChildSelect, type InspectCommand, type InspectComponent, type InspectDiagnostic, type InspectFix, type InspectGraph, type InspectLocation, type InspectRecentAction, type InspectRelatedLocation, type InspectSelector, type InspectTextEdit, type InspectTimer, type InstallPrompt, type IntentSources, type IntrinsicControlProps, type JsonSchemaObject, type Layout, type LayoutNode, type LazyComponent, type LazyOptions, type Lens, type Lense, MainDOMSource, type McpAppDisplayMode, type McpAppDriverOptions, type McpAppError, type McpAppRequest, type McpAppSource, type McpContentBlock, type McpDownloadItem, type McpHostContext, type McpHostInfo, type McpLogLevel, type McpResourceContents, type McpSamplingRequest, type McpToolResult, type MockConfig, MockedDOMSource, type MultipartValue, type NonStateSinkReturns, type OpenResponsesEvent, type OpenResponsesOptions, type PagerActions, type PagerCalculated, type PagerOptions, type PagerState, type ParamNames, type ParentPayloadOf, type Persist, type PersistOptions, type PersistOptionsFor, type PersistStorage, type PersistedEntry, Portal, type PortalProps, type ProcessFormOptions, type QueryCache, type QueryCacheSnapshot, type QueryCacheSnapshotEntry, RECORDING_SCHEMA, type RecordOptions, type RecordedAction, type RecordedCause, type Recorder, type Recording, type Ref, type Ref$, type RegisteredEvent, type RenderOptions, type RenderResult, type RenderToStringOptions, type RenderableComponent, type ReplayDivergence, type ReplayOptions, type ReplayResult, type ReplayTestOptions, type ReplyChannel, type ReplyRequest, type ReplySender, type Resource, type ResourceRequest, type RootComponent, type Route, type RouteName, type RouteParamsArg, type RouteQuery, type Router, type RouterBlocked, type RouterCommand, type RouterOptions, type RouterSource, type RunOptions, type SchemaInput, type SchemaOutput, type ScrollToAlign, type SelectedDOMSource, type SelectionActions, type SelectionCalculated, type SelectionOptions, type SelectionState, type ServiceWorkerCommand, type ServiceWorkerOptions, type ServiceWorkerSource, type SimulateActionOptions, type SimulatedEventInit, Slot, type SlotProps, type SocketActions, type SocketClose, type SocketConnection, type SocketDriverOptions, type SocketError, type SocketEvent, type SocketOpen, type SocketReconnect, type SocketRequest, type SocketSource, type SortFunction, type SortObject, type SortSpec, type SortableActions, type SortableDropped, type SortableOptions, type SortableState, type SseConnection, type SseEvent, type StandardSchemaLike, type StateProp, type StrictDialect, type StrictSchemas, Suspense, type SuspenseProps, Switchable, type SwitchableProps, type SygnalApp, type SygnalBodyDOMSource, type SygnalDOMSource, type SygnalDevTools, type SygnalDocumentDOMSource, type SygnalEvents, type SygnalSinks, type TestAction, type Thunk, type ThunkData, type TimerAfter, type TimerFrame, type TimerFrameInput, type TimerSpec, type TimerTick, type Timers, Transition, type TransitionProps, type UIMessageStreamOptions, type UidFunction, type UndoBehaviorOptions, type UndoHistory, type UndoOptions, type UsesActions, type UsesState, type ViewProps, VirtualCollection, type VirtualCollectionProps, type WebMcpHandle, type Widget, type WidgetDefinition, type WidgetDispatch, type WidgetElementOf, type WidgetEmit, type WidgetHandle, type WidgetHostProps, type WithinTarget, abort, agentTools, agui, answers, anthropicMessages, askCard, bugReport, byId, chat, chatCompletions, checkForm, choice, chromePrompt, classes, clearDiagnostics, clipboardSource, commandBar, compose, composeWith, controls, createCommand, createInstallPrompt, createRef, createRef$, decide, defineBehavior, defineCatalog, defineComponent, defineWidget, driverFromAsync, emit, enableHMR, encodeOpenResponses, event, exactState, experimentalExposeWebMcp, fieldName, fieldNames, finalState, focusInvalid, focusWithin, form, formErrors, formTool, fromAISDK, fromTree, geolocationSource, getDevTools, getDiagnostics, getField, hasField, inertDriver, intersectionSource, isSelected, jsonSchema, keymap, lazy, makeBrowserDriver, makeBrowserDriverWith, makeChatDriver, makeDOMDriver, makeDragDriver, makeFetchDriver, makeHeadDriver, makeMcpAppDriver, makeReplies, makeRouter, makeRouterDriver, makeServiceWorkerDriver, makeSocketDriver, makeTimerDriver, makeViewTransitionDOMDriver, mediaSource, messageText, mockDOMSource, noul, onDiagnostic, onlineSource, onlineStatus$, openResponses, openToolCalls, outputJsonSchema, pager, parseInput, persist, portal, processDrag, processForm, queryCache, removeNode, renderComponent, renderHead, renderToString, replay, replayTest, replyErrors, resizeSource, run, score, selection, senderOf, set, setField, sortable, startRecording, storageSource, strictSchemas, thunk, timeline, toJsonSchema, toTree, toggle, uiMessageStream, undo, undoable, visibilitySource, withToolResults, xs };
|