import { type ApprovalId, type Json, type ToolOutcome, type TreeNode, type UIPayload } from "../../core/index.js"; import { type ComponentType } from "react"; import type { ScreenInteractive } from "./screen-engine.js"; /** A press the guard sent to approval, announced through `onParked`. */ export interface ParkedPress { nodeId: string; approvalId: ApprovalId; } export interface TreeViewProps { tree: WalkTree; /** * Which app this tree belongs to — the `$state` and outcome namespace's * identity. A caller that can render a DIFFERENT app in the same position * passes it; see {@link TreeView} for what it buys. */ appId?: string; components: Record; data?: Record; onAction(req: { nodeId: string; action: string; payload?: Json; }): Promise; /** * Fires the instant a press is PARKED on an approval. The tree resolves the * approval on its own (parked-approvals.ts) and repaints when it lands; this * is the seam for a surface that wants to put the decision in front of the * person instead of leaving them to go find it. */ onParked?: (parked: ParkedPress) => void; /** * A component screen's live half: the compiled source and the query results it * was painted against. `tree` is that screen's FIRST paint and renders on its * own; supplying this additionally boots the screen behind it, so its * `{$handler}` props become real callbacks (use-screen.ts). Absent — every * payload before component screens — nothing boots and nothing changes. */ interactive?: ScreenInteractive; /** * The wall a live screen's dates and money resolve against: a locale, and an * IANA zone. The screen engine carries no ICU, so both are answered by the * host's real `Intl` against these two — and unset they are `"en-US"` and * `"UTC"`, which is a server's wall. A surface that wants the VIEWER's says so: * `timeZone={Intl.DateTimeFormat().resolvedOptions().timeZone}`. */ locale?: string; timeZone?: string; } export interface PayloadRendererProps { payload: UIPayload; /** As {@link TreeViewProps.appId}. */ appId?: string; components: Record; data?: Record; onAction(req: { nodeId: string; action: string; payload?: Json; }): Promise; /** As {@link TreeViewProps.onParked}. */ onParked?: (parked: ParkedPress) => void; /** As {@link TreeViewProps.locale} and {@link TreeViewProps.timeZone}. */ locale?: string; timeZone?: string; } /** * The walk's input: the shared render mechanics' tree shape (nodes, * path-keyed resolved queries, grafted components, payload extras). * convert-payload converts the canonical tree into this shape (named * queries → "/" + name pointers). */ export interface WalkTree { root: string; nodes: TreeNode[]; data?: Record; queries?: Array<{ path: string; tool: string; input?: Record; }>; components?: Record; } /** Dispatch is exclusively by the payload tag. */ export declare function PayloadView(props: PayloadRendererProps): import("react").JSX.Element; interface ActionBinding { $action: string; payload?: Json; } /** 08-ui §5 — renderer-owned additive binding; action names stay opaque. */ export declare function isActionBinding(value: unknown): value is ActionBinding; interface HandlerBinding { $handler: string; } /** `isActionBinding`'s sibling: a component screen's event props name one of the * screen's own handlers. Handler ids stay as opaque as action names — the * renderer routes `"h3"` to the live screen and never reads it. */ export declare function isHandlerBinding(value: unknown): value is HandlerBinding; /** * A new app owns a fresh `$state` and outcome namespace. * * The identity is `appId`. It cannot be the tree: the compiler roots EVERY * compiled app at the same synthetic `root` node (core/genui/wire/compile.ts), * so keying on `tree.root` reused one instance across two different apps and * app B rendered app A's `$state`. Nor can it be the tree's contents — a * streaming tree changes on every chunk, and wiping `$state` mid-stream would * throw away what the user just typed. * * Without `appId` the key falls back to `tree.root`, which is exactly the * behavior every existing caller already had. */ export declare function TreeView(props: TreeViewProps): import("react").JSX.Element; export {};