import { z } from 'zod'; /** * Mounts a serializable UI model into a DOM element and returns its complete * imperative lifecycle. This API is safe to bind with wasm-bindgen. */ export declare function createMiniAppUiRoot(container: Element, initialModel: unknown, dispatch: MiniAppUiDispatch, options?: MiniAppUiRootOptions): MiniAppUiRoot; /** Serializable action delivered to Rust/WASM. */ export declare type MiniAppUiAction = z.output; /** A serializable UI action with replay and stale-model metadata. */ export declare const miniAppUiActionSchema: z.ZodObject<{ eventId: z.ZodString; revision: z.ZodNumber; controlId: z.ZodString; entityId: z.ZodOptional; action: z.ZodString; event: z.ZodEnum<{ activate: "activate"; "open-change": "open-change"; "selection-change": "selection-change"; "value-change": "value-change"; }>; value: z.ZodOptional>; }, z.core.$strict>; /** Synchronous or asynchronous action handler implemented by the mini-app. */ export declare type MiniAppUiDispatch = (action: MiniAppUiAction) => void | Promise; /** Explicit error surfaced by the imperative UI lifecycle. */ export declare class MiniAppUiError extends Error { readonly code: MiniAppUiErrorCode; readonly cause?: unknown; constructor(code: MiniAppUiErrorCode, message: string, cause?: unknown); } /** Stable error codes exposed to JavaScript and wasm-bindgen consumers. */ export declare type MiniAppUiErrorCode = 'cleanup-failed' | 'dispatch-failed' | 'focus-target-missing' | 'invalid-model' | 'render-failed' | 'root-unmounted' | 'stale-action' | 'stale-model'; /** Supported action event names. */ export declare type MiniAppUiEventKind = z.output; /** Event kinds emitted over the serializable ABI. */ export declare const miniAppUiEventKindSchema: z.ZodEnum<{ activate: "activate"; "open-change": "open-change"; "selection-change": "selection-change"; "value-change": "value-change"; }>; /** Complete, validated UI state supplied by a WASM mini-app. */ export declare type MiniAppUiModel = z.output; /** * Runtime validator for the complete model. It enforces a bounded, acyclic * tree with unique stable identifiers and no unreachable nodes. */ export declare const miniAppUiModelSchema: z.ZodObject<{ revision: z.ZodNumber; state: z.ZodDefault>; rootIds: z.ZodArray; nodes: z.ZodArray; id: z.ZodString; children: z.ZodArray; gap: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"row">; id: z.ZodString; children: z.ZodArray; gap: z.ZodDefault>; wrap: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"toolbar">; id: z.ZodString; label: z.ZodString; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"status-bar">; id: z.ZodString; text: z.ZodString; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"heading">; id: z.ZodString; level: z.ZodNumber; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"text">; id: z.ZodString; text: z.ZodString; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; type: z.ZodLiteral<"button">; id: z.ZodString; label: z.ZodString; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; type: z.ZodLiteral<"icon-button">; id: z.ZodString; label: z.ZodString; icon: z.ZodEnum<{ add: "add"; check: "check"; close: "close"; delete: "delete"; help: "help"; info: "info"; refresh: "refresh"; search: "search"; settings: "settings"; }>; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"button-group">; id: z.ZodString; label: z.ZodString; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"badge">; id: z.ZodString; text: z.ZodString; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"card">; id: z.ZodString; title: z.ZodOptional; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"item">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"tabs">; id: z.ZodString; value: z.ZodString; action: z.ZodString; entityId: z.ZodOptional; disabled: z.ZodDefault; tabs: z.ZodArray; disabled: z.ZodDefault; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"alert">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"empty">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"loading">; id: z.ZodString; label: z.ZodString; rows: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"input">; id: z.ZodString; value: z.ZodString; inputType: z.ZodDefault>; placeholder: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"textarea">; id: z.ZodString; value: z.ZodString; placeholder: z.ZodOptional; rows: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"select">; id: z.ZodString; value: z.ZodString; options: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"checkbox">; id: z.ZodString; checked: z.ZodBoolean; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"progress">; id: z.ZodString; label: z.ZodString; value: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"tooltip">; id: z.ZodString; label: z.ZodString; child: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"dialog">; id: z.ZodString; entityId: z.ZodOptional; open: z.ZodBoolean; openChangeAction: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; actions: z.ZodArray>; disabled: z.ZodDefault; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"confirmation">; id: z.ZodString; entityId: z.ZodOptional; open: z.ZodBoolean; openChangeAction: z.ZodString; title: z.ZodString; description: z.ZodString; confirm: z.ZodObject<{ id: z.ZodString; label: z.ZodString; action: z.ZodString; variant: z.ZodDefault>; disabled: z.ZodDefault; }, z.core.$strict>; cancelLabel: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"separator">; id: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"metric">; id: z.ZodString; label: z.ZodString; value: z.ZodString; detail: z.ZodOptional; badge: z.ZodOptional; }, z.core.$strict>], "type">>; }, z.core.$strict>; /** A single validated node in a mini-app UI model. */ export declare type MiniAppUiNode = z.output; /** Runtime validator for every node accepted by the WASM UI bridge. */ export declare const miniAppUiNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"stack">; id: z.ZodString; children: z.ZodArray; gap: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"row">; id: z.ZodString; children: z.ZodArray; gap: z.ZodDefault>; wrap: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"toolbar">; id: z.ZodString; label: z.ZodString; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"status-bar">; id: z.ZodString; text: z.ZodString; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"heading">; id: z.ZodString; level: z.ZodNumber; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"text">; id: z.ZodString; text: z.ZodString; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; type: z.ZodLiteral<"button">; id: z.ZodString; label: z.ZodString; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; type: z.ZodLiteral<"icon-button">; id: z.ZodString; label: z.ZodString; icon: z.ZodEnum<{ add: "add"; check: "check"; close: "close"; delete: "delete"; help: "help"; info: "info"; refresh: "refresh"; search: "search"; settings: "settings"; }>; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"button-group">; id: z.ZodString; label: z.ZodString; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"badge">; id: z.ZodString; text: z.ZodString; variant: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"card">; id: z.ZodString; title: z.ZodOptional; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"item">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"tabs">; id: z.ZodString; value: z.ZodString; action: z.ZodString; entityId: z.ZodOptional; disabled: z.ZodDefault; tabs: z.ZodArray; disabled: z.ZodDefault; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"alert">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; tone: z.ZodDefault>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"empty">; id: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"loading">; id: z.ZodString; label: z.ZodString; rows: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"input">; id: z.ZodString; value: z.ZodString; inputType: z.ZodDefault>; placeholder: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"textarea">; id: z.ZodString; value: z.ZodString; placeholder: z.ZodOptional; rows: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"select">; id: z.ZodString; value: z.ZodString; options: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ disabled: z.ZodDefault; busy: z.ZodDefault; action: z.ZodString; entityId: z.ZodOptional; description: z.ZodOptional; error: z.ZodOptional; label: z.ZodString; required: z.ZodDefault; type: z.ZodLiteral<"checkbox">; id: z.ZodString; checked: z.ZodBoolean; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"progress">; id: z.ZodString; label: z.ZodString; value: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"tooltip">; id: z.ZodString; label: z.ZodString; child: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"dialog">; id: z.ZodString; entityId: z.ZodOptional; open: z.ZodBoolean; openChangeAction: z.ZodString; title: z.ZodString; description: z.ZodOptional; children: z.ZodArray; actions: z.ZodArray>; disabled: z.ZodDefault; }, z.core.$strict>>; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"confirmation">; id: z.ZodString; entityId: z.ZodOptional; open: z.ZodBoolean; openChangeAction: z.ZodString; title: z.ZodString; description: z.ZodString; confirm: z.ZodObject<{ id: z.ZodString; label: z.ZodString; action: z.ZodString; variant: z.ZodDefault>; disabled: z.ZodDefault; }, z.core.$strict>; cancelLabel: z.ZodDefault; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"separator">; id: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"metric">; id: z.ZodString; label: z.ZodString; value: z.ZodString; detail: z.ZodOptional; badge: z.ZodOptional; }, z.core.$strict>], "type">; /** Imperative UI root retained by JavaScript or Rust/WASM. */ export declare interface MiniAppUiRoot { readonly revision: number; /** Replaces controlled state. Reusing a revision is valid only for an identical model. */ update(model: unknown): void; /** Focuses an interactive control by its stable model identifier. */ focus(controlId: string): void; /** Publishes an accessible live-region announcement. */ announce(message: string, priority?: 'polite' | 'assertive'): void; /** Releases appearance listeners and the React root. Safe to call repeatedly. */ unmount(): void; } /** Optional lifecycle hooks for the imperative root. */ export declare interface MiniAppUiRootOptions { /** Receives render, dispatch, stale-action, and cleanup failures. */ onError?: (error: MiniAppUiError) => void; /** Overrides the URL search string used for initial theme and UI scale. */ appearanceSearch?: string | URLSearchParams; } export { }