import { App } from 'vue'; import { Component } from 'vue'; import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import { DefineComponent } from 'vue'; import { PublicProps } from 'vue'; import { Ref } from 'vue'; import { Signal } from '@preact/signals-core'; /** * Loads and renders a single component from the catalog using the supplied * `VueComponentNode`. The node is produced by the v0.9 processor (see * `MessageProcessor.buildVueNode`) and carries an absolute `dataContextPath` * for relative path resolution within the data model. */ declare type __VLS_Props = { surfaceId: string | null; component: VueComponentNode; }; /** * Renders the root component tree for a single A2UI surface. * * Resolves the underlying v0.9 `SurfaceModel` through the injected * `MessageProcessor` and rebuilds the root `VueComponentNode` whenever the * processor's internal `version` ref changes (component / data updates). */ declare type __VLS_Props_2 = { surfaceId: string | null; }; export declare type A2AServerPayload = Array | { error: string; }; export declare interface A2DataPayload { kind: 'data'; data: A2uiMessage; } export declare interface A2TextPayload { kind: 'text'; text: string; } export declare type A2uiClientAction = z.infer; /** * Reports a user-initiated action from a component. * Matches 'action' in specification/v0_9/json/client_to_server.json. */ declare const A2uiClientActionSchema: z.ZodObject<{ name: z.ZodString; surfaceId: z.ZodString; sourceComponentId: z.ZodString; timestamp: z.ZodString; context: z.ZodRecord; }, "strict", z.ZodTypeAny, { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }, { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }>; /** * The capabilities structure sent from the client to the server as part of transport metadata. */ export declare interface A2uiClientCapabilities { 'v0.9': { supportedCatalogIds: string[]; inlineCatalogs?: InlineCatalog[]; }; } export declare type A2uiClientMessage = z.infer; /** * A message sent from the A2UI client to the server. * Matches specification/v0_9/json/client_to_server.json. */ declare const A2uiClientMessageSchema: z.ZodIntersection; }, "strip", z.ZodTypeAny, { version: "v0.9"; }, { version: "v0.9"; }>, z.ZodUnion<[z.ZodObject<{ action: z.ZodObject<{ name: z.ZodString; surfaceId: z.ZodString; sourceComponentId: z.ZodString; timestamp: z.ZodString; context: z.ZodRecord; }, "strict", z.ZodTypeAny, { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }, { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }>; }, "strip", z.ZodTypeAny, { action: { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }; }, { action: { name: string; context: Record; surfaceId: string; sourceComponentId: string; timestamp: string; }; }>, z.ZodObject<{ error: z.ZodUnion<[z.ZodObject<{ code: z.ZodLiteral<"VALIDATION_FAILED">; surfaceId: z.ZodString; path: z.ZodString; message: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; code: "VALIDATION_FAILED"; message: string; surfaceId: string; }, { path: string; code: "VALIDATION_FAILED"; message: string; surfaceId: string; }>, z.ZodObject<{ code: z.ZodEffects; message: z.ZodString; surfaceId: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ code: z.ZodEffects; message: z.ZodString; surfaceId: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ code: z.ZodEffects; message: z.ZodString; surfaceId: z.ZodString; }, z.ZodTypeAny, "passthrough">>]>; }, "strip", z.ZodTypeAny, { error: { path: string; code: "VALIDATION_FAILED"; message: string; surfaceId: string; } | z.objectOutputType<{ code: z.ZodEffects; message: z.ZodString; surfaceId: z.ZodString; }, z.ZodTypeAny, "passthrough">; }, { error: { path: string; code: "VALIDATION_FAILED"; message: string; surfaceId: string; } | z.objectInputType<{ code: z.ZodEffects; message: z.ZodString; surfaceId: z.ZodString; }, z.ZodTypeAny, "passthrough">; }>]>>; export declare interface A2UIConfig { catalog: Catalog; theme: A2UITheme; /** Catalog identifier used when the agent issues `createSurface`. */ catalogId: string; /** Pre-built v0.9 `Catalog` derived from `catalog`. */ coreCatalog: Catalog_2; } /** A message sent from the A2UI server to the client. */ export declare type A2uiMessage = CreateSurfaceMessage | UpdateComponentsMessage | UpdateDataModelMessage | DeleteSurfaceMessage; export declare const A2UiRenderer: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; declare type A2uiReturnType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; export declare const A2UISurface: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; /** * Theme shape used by the Vue renderer. Mirrors the legacy v0.8 `Types.Theme` * structure but is now defined locally so the renderer no longer depends on * v0.8 protocol type imports. The shape is intentionally permissive — callers * may extend it via `additionalStyles` / per-component slots. */ export declare interface A2UITheme { additionalStyles?: Record; components: Record; elements?: Record; markdown?: Record; } /** Triggers a server-side event or a local client-side function. */ declare type Action = z.infer; declare const ActionSchema: z.ZodUnion<[z.ZodObject<{ event: z.ZodObject<{ name: z.ZodString; context: z.ZodOptional, z.ZodObject<{ path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }>, z.ZodObject<{ call: z.ZodString; args: z.ZodRecord; returnType: z.ZodDefault>; }, "strip", z.ZodTypeAny, { call: string; args: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }, { call: string; args: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }>]>>>; }, "strip", z.ZodTypeAny, { name: string; context?: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }> | undefined; }, { name: string; context?: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }> | undefined; }>; }, "strip", z.ZodTypeAny, { event: { name: string; context?: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }> | undefined; }; }, { event: { name: string; context?: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }> | undefined; }; }>, z.ZodObject<{ functionCall: z.ZodObject<{ call: z.ZodString; args: z.ZodRecord; returnType: z.ZodDefault>; }, "strip", z.ZodTypeAny, { call: string; args: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }, { call: string; args: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }>; }, "strip", z.ZodTypeAny, { functionCall: { call: string; args: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }; }, { functionCall: { call: string; args: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }; }>]>; declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void; declare type allKeys = T extends any ? keyof T : never; declare const anyType: (params?: RawCreateParams) => ZodAny; declare type AnyZodObject = ZodObject; declare type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null>; declare type ArrayCardinality = "many" | "atleastone"; declare type ArrayKeys = keyof any[]; declare type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; declare const arrayType: (schema: El, params?: RawCreateParams) => ZodArray; declare type AssertArray = T extends any[] ? T : never; declare type AsyncParseReturnType = Promise>; declare type baseObjectInputType = objectUtil.addQuestionMarks<{ [k in keyof Shape]: Shape[k]["_input"]; }>; declare type baseObjectOutputType = { [k in keyof Shape]: Shape[k]["_output"]; }; declare const bigIntType: (params?: RawCreateParams & { coerce?: boolean; }) => ZodBigInt; declare const booleanType: (params?: RawCreateParams & { coerce?: boolean; }) => ZodBoolean; declare const BRAND: unique symbol; declare type BRAND = { [BRAND]: { [k in T]: true; }; }; /** * Builds a v0.9 `Catalog` from the Vue-style plain map so it * can be handed to the v0.9 `MessageProcessor`. Every entry maps to a minimal * `ComponentApi` with a permissive schema (the renderer relies on the * agent-side validator for schema enforcement). */ export declare function buildCoreCatalog(catalog: Catalog, id?: string): Catalog_2; declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; /** * Vue-style catalog: a plain map from component-type name to its loader and * (optional) prop-extraction function. This is the user-facing catalog format * that has been part of vue-renderer's API since v0.8 and is intentionally * preserved for backwards compatibility. */ export declare interface Catalog { [key: string]: CatalogEntry; } /** * A collection of available components and functions. */ declare class Catalog_2 implements CatalogInterface { readonly id: string; /** * A map of available components. * This is readonly to encourage immutable extension patterns. */ readonly components: ReadonlyMap; /** * Map of functions provided by this catalog. */ readonly functions: ReadonlyMap; /** * The schema for theme parameters used by this catalog. */ readonly themeSchema?: z.ZodObject; /** * A ready-to-use FunctionInvoker callback that delegates to this catalog's functions. * Can be passed directly to a DataContext. */ readonly invoker: FunctionInvoker; constructor(id: string, components: T[], functions?: FunctionImplementation[], themeSchema?: z.ZodObject); } export declare type CatalogEntry = CatalogLoader | { type: CatalogLoader; props: (node: VueComponentNode) => Record; }; /** * Interface for Catalog to prevent property renaming in 1P (Closure Compiler). * * This must declare all publicly accessed properties of Catalog. */ declare interface CatalogInterface { readonly id: string; readonly components: ReadonlyMap; readonly functions: ReadonlyMap; readonly themeSchema?: z.ZodObject; readonly invoker: FunctionInvoker; } export declare type CatalogLoader = () => Promise> | Component | DefineComponent; declare type CatchallInput = ZodType extends T ? unknown : { [k: string]: T["_input"]; }; declare type CatchallOutput = ZodType extends T ? unknown : { [k: string]: T["_output"]; }; /** * Reference to a child component emitted by the binder for STRUCTURAL * (ChildList) properties: a component id plus the data-model base path that * scopes its relative bindings. */ export declare interface ChildRef { id: string; basePath: string; } declare abstract class Class { constructor(..._: any[]); } declare const coerce: { string: (typeof ZodString)["create"]; number: (typeof ZodNumber)["create"]; boolean: (typeof ZodBoolean)["create"]; bigint: (typeof ZodBigInt)["create"]; date: (typeof ZodDate)["create"]; }; /** * A definition of a UI component's API. * This interface defines the contract for a component's capabilities and properties, * independent of any specific rendering implementation. * * @template Schema the Zod schema type for the component's properties. */ declare interface ComponentApi { /** The name of the component as it appears in the A2UI JSON (e.g., 'Button'). */ name: string; /** * The Zod schema describing the **properties** of this component. * * - MUST include catalog-specific common properties (e.g. 'weight', 'accessibility'). * - MUST NOT include 'component' or 'id' as those are handled by the framework/envelope. */ readonly schema: Schema; } /** * Represents the state model for an individual UI component. */ declare class ComponentModel { readonly id: string; readonly type: string; private _properties; private readonly _onUpdated; /** * Fires whenever the component's properties are updated. */ readonly onUpdated: EventSource_2; /** * Creates a new component model. * * @param id The unique identifier for this component. * @param type The component type name. * @param initialProperties The initial properties for the component. */ constructor(id: string, type: string, initialProperties: Record); /** * The current properties of the component. */ get properties(): Record; set properties(newProperties: Record); /** * Disposes of the component and its resources. */ dispose(): void; /** * Returns a JSON representation of the component tree. */ get componentTree(): any; } declare interface CreateSurfaceMessage extends z.infer { version: 'v0.9'; createSurface: { surfaceId: string; catalogId: string; theme?: any; sendDataModel?: boolean; }; } declare const CreateSurfaceMessageSchema: z.ZodObject<{ version: z.ZodLiteral<"v0.9">; createSurface: z.ZodObject<{ surfaceId: z.ZodString; catalogId: z.ZodString; theme: z.ZodOptional; sendDataModel: z.ZodOptional; }, "strict", z.ZodTypeAny, { surfaceId: string; catalogId: string; theme?: any; sendDataModel?: boolean | undefined; }, { surfaceId: string; catalogId: string; theme?: any; sendDataModel?: boolean | undefined; }>; }, "strict", z.ZodTypeAny, { version: "v0.9"; createSurface: { surfaceId: string; catalogId: string; theme?: any; sendDataModel?: boolean | undefined; }; }, { version: "v0.9"; createSurface: { surfaceId: string; catalogId: string; theme?: any; sendDataModel?: boolean | undefined; }; }>; declare function createZodEnum>(values: T, params?: RawCreateParams): ZodEnum>; declare function createZodEnum(values: T, params?: RawCreateParams): ZodEnum; declare function custom(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams), /** * @deprecated * * Pass `fatal` into the params object instead: * * ```ts * z.string().custom((val) => val.length > 5, { fatal: false }) * ``` * */ fatal?: boolean): ZodType; declare type CustomErrorParams = Partial>; declare type CustomParams = CustomErrorParams & { fatal?: boolean; }; /** * A contextual view of the main DataModel, serving as the unified interface for resolving * DynamicValues (literals, data paths, function calls) within a specific scope. * * Components use `DataContext` instead of interacting with the `DataModel` directly. * It automatically handles resolving relative paths against the component's current scope * and provides tools for evaluating complex, reactive expressions. */ declare class DataContext { readonly surface: SurfaceModel; readonly path: string; /** The shared, global DataModel instance for the entire UI surface. */ readonly dataModel: DataModel; /** A callback for executing function calls defined in the A2UI component tree. */ readonly functionInvoker: FunctionInvoker; /** * Initializes a new DataContext. * * @param surface The surface model this context belongs to. * @param path The absolute path in the DataModel that this context is scoped to (its "current working directory"). */ constructor(surface: SurfaceModel, path: string); /** * Gets the locale for this context, inherited from the surface. */ get locale(): string | undefined; /** * Mutates the underlying DataModel at the specified path. * * This is the primary method for components to push state changes (e.g. user input) * back up to the global model. * * @param path A JSON pointer path. If relative, it is resolved against this context's `path`. * @param value The new value to store in the DataModel. */ set(path: string, value: any): void; /** * Synchronously evaluates a `DynamicValue` (a literal, a path binding, or a function call) * into its concrete runtime value. * * **Note:** This method evaluates the value *once* at the current moment in time. * It does not create any reactive subscriptions. If the underlying data changes later, * this result will not automatically update. Use `subscribeDynamicValue` for reactive updates. * * @param value The DynamicValue object from the A2UI JSON payload. * @returns The synchronously resolved value. */ resolveDynamicValue(value: DynamicValue): V; /** * Reactively listens to changes in a `DynamicValue`. * * This is the core reactive binding mechanism. Whenever the underlying data changes * (or if a function call's dependencies change), the `onChange` callback will be fired * with the freshly evaluated result. * * @template V The expected type of the resolved value. * @param value The DynamicValue to evaluate and observe. * @param onChange A callback fired whenever the evaluated result changes. * @returns A `DataSubscription` containing the initial synchronously-resolved value, along with an `unsubscribe` method to clean up the listener. */ subscribeDynamicValue(value: DynamicValue, onChange: (value: V | undefined) => void): DataSubscription; /** * Returns a Preact Signal representing the reactive dynamic value. * * This method recursively resolves any nested path bindings or function calls into a * single, reactive `Signal`. Any changes to the underlying data or function dependencies * will cause this signal's value to update. * * @param value The DynamicValue to evaluate and observe. * @returns A Preact Signal containing the reactive result of the evaluation. */ resolveSignal(value: DynamicValue): Signal; /** * Resolves an action by evaluating its top-level dynamic values. * * For event actions, it resolves each value in the context map. * For function call actions, it evaluates the call. * * This is non-recursive: it only resolves one level deep for the context record, * in accordance with the schema specification that requires values to be single * DynamicValue types and prevents arbitrary nesting. */ resolveAction(action: Action): any; private evaluateFunctionReactive; private dispatchExpressionError; /** * Creates a new, child `DataContext` scoped to a deeper path. * * This is used when a component (like a List or a Card) wants to provide a targeted * data scope for its children, so children can use relative paths like `./title`. * * @param relativePath The path relative to the *current* context's path. * @returns A new `DataContext` instance pointing to the resolved absolute path. */ nested(relativePath: string): DataContext; private resolvePath; } /** * A standalone, observable data store representing the client-side state. * It handles JSON Pointer path resolution and subscription management. */ declare class DataModel { private data; private readonly signals; private readonly subscriptions; /** * Creates a new data model. * * @param initialData The initial data for the model. Defaults to an empty object. */ constructor(initialData?: Record); /** * Retrieves a Preact Signal for a specific data path. * * This provides a reactive way to access a value. If the value at the path changes via `set()`, * the signal will automatically be updated. * * @param path The JSON pointer path to create or retrieve a signal for. * @returns A Preact Signal representing the value at the specified path. */ getSignal(path: string): Signal; /** * Updates the model at the specific path and notifies all relevant signals. * If path is '/' or empty, replaces the entire root. * * Note on `undefined` values: * - For objects: Setting a property to `undefined` removes the key from the object. * - For arrays: Setting an index to `undefined` sets that index to `undefined` but preserves the array length (sparse array). */ set(path: string, value: any): this; /** * Retrieves data at a specific JSON pointer path. * * @param path The JSON pointer path to read from. * @returns The value at the specified path, or undefined if not found. */ get(path: string): any; /** * Subscribes to changes at the specified data path. * * This is a backwards-compatible layer using Preact Signals internally. It allows * listeners to be notified whenever the value at the specified path (or any of its * ancestors/descendants) changes. * * @param path The JSON pointer path to observe. * @param onChange A callback fired whenever the value changes. * @returns A `DataSubscription` containing the initial value and an `unsubscribe` method. */ subscribe(path: string, onChange: (value: T | undefined) => void): DataSubscription; /** * Clears all internal subscriptions. */ dispose(): void; private normalizePath; private parsePath; private notifySignals; private updateSignal; private notifyAllSignals; private isDescendant; } /** * Represents a reactive connection to a specific path in the data model. */ declare interface DataSubscription extends Subscription { /** * The current value at the subscribed path. */ readonly value: T | undefined; } declare function datetimeRegex(args: { precision?: number | null; offset?: boolean; local?: boolean; }): RegExp; declare const dateType: (params?: RawCreateParams & { coerce?: boolean; }) => ZodDate; export declare const DEFAULT_CATALOG: Catalog; export declare const defaultTheme: A2UITheme; declare interface DeleteSurfaceMessage extends z.infer { version: 'v0.9'; deleteSurface: { surfaceId: string; }; } declare const DeleteSurfaceMessageSchema: z.ZodObject<{ version: z.ZodLiteral<"v0.9">; deleteSurface: z.ZodObject<{ surfaceId: z.ZodString; }, "strict", z.ZodTypeAny, { surfaceId: string; }, { surfaceId: string; }>; }, "strict", z.ZodTypeAny, { deleteSurface: { surfaceId: string; }; version: "v0.9"; }, { deleteSurface: { surfaceId: string; }; version: "v0.9"; }>; declare type DenormalizedError = { [k: string]: DenormalizedError | string[]; }; declare type deoptional = T extends ZodOptional ? deoptional : T extends ZodNullable ? ZodNullable> : T; declare type DIRTY = { status: "dirty"; value: T; }; declare const DIRTY: (value: T) => DIRTY; declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create; /** * A bridged event used by sample apps to forward client actions back to the * agent. Mirrors the existing public API but now carries a v0.9 * `A2uiClientMessage` envelope ({ version: 'v0.9', action: A2uiClientAction }). */ export declare interface DispatchedEvent { message: { version: 'v0.9'; action: A2uiClientAction; }; resolve: (messages: A2uiMessage[]) => void; reject: (error: Error) => void; } /** A dynamic value that can be a literal, a path, or a function call returning any type. */ declare type DynamicValue = z.infer; declare const DynamicValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray, z.ZodObject<{ path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }>, z.ZodObject<{ call: z.ZodString; args: z.ZodRecord; returnType: z.ZodDefault>; }, "strip", z.ZodTypeAny, { call: string; args: Record; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }, { call: string; args: Record; returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined; }>]>; declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; declare const effectsType: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; declare const EMPTY_PATH: ParsePath; declare type EnumLike = { [k: string]: string | number; [nu: number]: string; }; declare const enumType: typeof createZodEnum; declare namespace enumUtil { type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never; type GetUnionLast = UnionToIntersectionFn extends () => infer Last ? Last : never; type UnionToTuple = [T] extends [never] ? Tuple : UnionToTuple>, [GetUnionLast, ...Tuple]>; type CastToStringTuple = T extends [string, ...string[]] ? T : never; type UnionToTupleString = CastToStringTuple>; export {}; } declare type EnumValues = readonly [T, ...T[]]; declare const errorMap: ZodErrorMap; declare type ErrorMapCtx = { defaultError: string; data: any; }; declare namespace errorUtil { type ErrMessage = string | { message?: string | undefined; }; const errToObj: (message?: ErrMessage) => { message?: string | undefined; }; const toString: (message?: ErrMessage) => string | undefined; } /** A function that handles emitted events. */ declare type EventListener_2 = (data: T) => void | Promise; /** * Public interface exposed by models. * Allows ONLY subscribing to events. */ declare interface EventSource_2 { /** * Subscribes to the event. * * @param listener The listener function to call when the event is emitted. * @returns A subscription object that can be used to unsubscribe. */ subscribe(listener: EventListener_2): Subscription; } declare type FilterEnum = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum : [Head, ...FilterEnum] : never; /** * A definition of a UI function's API. */ declare interface FunctionApi { readonly name: string; readonly returnType: A2uiReturnType; readonly schema: z.ZodTypeAny; } /** * Describes a function's interface within an inline catalog. */ declare interface FunctionDefinition { name: string; description?: string; parameters: JsonSchema; returnType: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; } /** * A function implementation that can be registered with the evaluator or basic catalog. */ declare interface FunctionImplementation extends FunctionApi { execute(args: Record, context: DataContext, abortSignal?: AbortSignal): unknown | Signal; } /** * A function that invokes a catalog function by name and returns its result synchronously or as a Signal. * * @param name The name of the function to invoke. * @param args The arguments to pass to the function. * @param context The data context in which the function is being executed. * @param abortSignal An optional AbortSignal for asynchronous or long-running operations. * @returns The result of the function call, which can be a literal, a Signal, or a Promise (handled by the caller). */ declare type FunctionInvoker = (name: string, args: Record, context: DataContext, abortSignal?: AbortSignal) => any; declare const functionType: typeof ZodFunction.create; declare function getErrorMap(): ZodErrorMap; declare const getParsedType: (data: any) => ZodParsedType; declare type Indices = Exclude; declare type inferFlattenedErrors, U = string> = typeToFlattenedError, U>; declare type inferFormattedError, U = string> = ZodFormattedError, U>; /** * Defines a catalog inline for the a2uiClientCapabilities object. */ declare interface InlineCatalog { catalogId: string; components?: Record; functions?: FunctionDefinition[]; theme?: Record; } declare type InnerTypeOfFunction, Returns extends ZodTypeAny> = Args["_output"] extends Array ? (...args: Args["_output"]) => Returns["_input"] : never; declare type input> = T["_input"]; declare type InputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_input"] : never; }>; declare type InputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...InputTypeOfTuple, ...Rest["_input"][]] : InputTypeOfTuple; declare const instanceOfType: (cls: T, params?: CustomParams) => ZodType, ZodTypeDef, InstanceType>; declare const intersectionType: (left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection; declare type INVALID = { status: "aborted"; }; declare const INVALID: INVALID; declare type IpVersion = "v4" | "v6"; declare const isAborted: (x: ParseReturnType) => x is INVALID; declare const isAsync: (x: ParseReturnType) => x is AsyncParseReturnType; declare const isDirty: (x: ParseReturnType) => x is OK | DIRTY; declare type IssueData = stripPath & { path?: (string | number)[]; fatal?: boolean | undefined; }; declare const isValid: (x: ParseReturnType) => x is OK; /** * Represents a JSON Schema definition. * Typed as Record to allow standard JSON schema properties * without importing heavy schema types. */ declare type JsonSchema = Record; declare type KeySchema = ZodType; declare const late: { object: (shape: () => Shape, params?: RawCreateParams) => ZodObject; }; declare const lazyType: (getter: () => Inner, params?: RawCreateParams) => ZodLazy; declare const literalType: (value: Value, params?: RawCreateParams) => ZodLiteral; declare const makeIssue: (params: { data: any; path: (string | number)[]; errorMaps: ZodErrorMap[]; issueData: IssueData; }) => ZodIssue; declare type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; declare const mapType: (keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap; declare class MarkdownRenderer { private originalClassMap; private markdownIt; render(value: string, tagClassMap?: Record): string; private applyTagClassMap; private unapplyTagClassMap; } declare type mergeTypes = { [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never; }; /** * Vue-renderer message processor. * * Internally wraps the v0.9 `@a2ui/web_core/v0_9.MessageProcessor` and its * `SurfaceGroupModel`, but preserves the synchronous, Vue-friendly API the * existing renderer/components rely on (no signal subscriptions in templates). * * - `setCatalogs(...)` is invoked by `provideA2UI` once the catalog is known. * - Internal `version` ref is bumped whenever surfaces / components / data * change, allowing Vue computeds to re-evaluate without per-component * signal wiring. */ export declare class MessageProcessor { private core; private catalogs; private eventHandlers; /** Bumped on every internal state change; templates may read `.value` to subscribe. */ readonly version: Ref; /** Provide the catalog list to the underlying v0.9 processor. */ setCatalogs(catalogs: Catalog_2[]): void; private rebuildCore; private bump; /** Process a batch of v0.9 server-to-client messages. */ processMessages(messages: A2uiMessage[]): void; /** Dispose all surfaces and rebuild a fresh processor instance. */ clearSurfaces(): void; /** All surface models keyed by id (read-only). */ getSurfaces(): ReadonlyMap>; /** Lookup a single surface by id. */ getSurface(id: string): SurfaceModel | undefined; /** * Resolves a relative path against a base path, producing an absolute JSON * pointer. Mirrors v0.9 `MessageProcessor.resolvePath`. */ resolvePath(path: string, basePath?: string): string; /** Read the surface data model at the absolute / relative path. */ getData(node: VueComponentNode, path: string, surfaceId?: string | null): unknown; /** * Resolve any v0.9 `DynamicValue` (literal / `{path}` / `{call, args}`) to a * concrete value. Goes through the surface catalog's `functionInvoker` so * that function calls like `formatString` / `formatDate` are evaluated. */ resolveValue(node: VueComponentNode, value: unknown, surfaceId?: string | null): unknown; /** Write the surface data model at the (possibly relative) path. */ setData(node: VueComponentNode, relativePath: string, value: unknown, surfaceId?: string | null): void; private firstSurfaceId; /** * Dispatch a client action to subscribers (sample apps forward it to the * agent). The wrapped envelope is `{ version: 'v0.9', action }`. */ dispatch(action: A2uiClientAction): Promise; /** Register a handler for dispatched client actions. Returns an unsubscribe fn. */ onEvent(handler: (event: DispatchedEvent) => void): () => void; /** * Build a `VueComponentNode` tree rooted at `componentId` for the given * surface, expanding child references (`children` / `child` / `trigger` / * `content` / `tabs[].child`) into nested `VueComponentNode`s. */ buildVueNode(surfaceId: string, componentId: string, basePath?: string): VueComponentNode | null; private buildNodeInner; private expandProperties; private expandChildList; private expandChildRef; } declare const nanType: (params?: RawCreateParams) => ZodNaN; declare const nativeEnumType: (values: Elements, params?: RawCreateParams) => ZodNativeEnum; declare const NEVER: never; declare const neverType: (params?: RawCreateParams) => ZodNever; declare type noUnrecognized = { [k in keyof Obj]: k extends keyof Shape ? Obj[k] : never; }; declare const nullableType: (type: Inner, params?: RawCreateParams) => ZodNullable; declare const nullType: (params?: RawCreateParams) => ZodNull; declare const numberType: (params?: RawCreateParams & { coerce?: boolean; }) => ZodNumber; declare type objectInputType = objectUtil.flatten> & CatchallInput & PassthroughType; declare type objectOutputType = objectUtil.flatten>> & CatchallOutput & PassthroughType; declare type ObjectPair = { key: SyncParseReturnType; value: SyncParseReturnType; }; declare const objectType: (shape: Shape, params?: RawCreateParams) => ZodObject, objectInputType>; declare namespace objectUtil { type MergeShapes = keyof U & keyof V extends never ? U & V : { [k in Exclude]: U[k]; } & V; type optionalKeys = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T]; type requiredKeys = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T]; type addQuestionMarks = { [K in requiredKeys]: T[K]; } & { [K in optionalKeys]?: T[K]; } & { [k in keyof T]?: unknown; }; type identity = T; type flatten = identity<{ [k in keyof T]: T[k]; }>; type noNeverKeys = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T]; type noNever = identity<{ [k in noNeverKeys]: k extends keyof T ? T[k] : never; }>; const mergeShapes: (first: U, second: T) => T & U; type extendShape = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; }; export {}; } declare const oboolean: () => ZodOptional; declare type OK = { status: "valid"; value: T; }; declare const OK: (value: T) => OK; declare const onumber: () => ZodOptional; declare const optionalType: (type: Inner, params?: RawCreateParams) => ZodOptional; declare const ostring: () => ZodOptional; declare type OuterTypeOfFunction, Returns extends ZodTypeAny> = Args["_input"] extends Array ? (...args: Args["_input"]) => Returns["_output"] : never; declare type output> = T["_output"]; declare type OutputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_output"] : never; }>; declare type OutputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...OutputTypeOfTuple, ...Rest["_output"][]] : OutputTypeOfTuple; declare interface ParseContext { readonly common: { readonly issues: ZodIssue[]; readonly contextualErrorMap?: ZodErrorMap | undefined; readonly async: boolean; }; readonly path: ParsePath; readonly schemaErrorMap?: ZodErrorMap | undefined; readonly parent: ParseContext | null; readonly data: any; readonly parsedType: ZodParsedType; } declare type ParseInput = { data: any; path: (string | number)[]; parent: ParseContext; }; declare type ParseParams = { path: (string | number)[]; errorMap: ZodErrorMap; async: boolean; }; declare type ParsePath = ParsePathComponent[]; declare type ParsePathComponent = string | number; declare interface ParseResult { status: "aborted" | "dirty" | "valid"; data: any; } declare type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; declare class ParseStatus { value: "aborted" | "dirty" | "valid"; dirty(): void; abort(): void; static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; static mergeObjectAsync(status: ParseStatus, pairs: { key: ParseReturnType; value: ParseReturnType; }[]): Promise>; static mergeObjectSync(status: ParseStatus, pairs: { key: SyncParseReturnType; value: SyncParseReturnType; alwaysSet?: boolean; }[]): SyncParseReturnType; } declare namespace partialUtil { type DeepPartial = T extends ZodObject ? ZodObject<{ [k in keyof T["shape"]]: ZodOptional>; }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray ? ZodArray, Card> : T extends ZodOptional ? ZodOptional> : T extends ZodNullable ? ZodNullable> : T extends ZodTuple ? { [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never; } extends infer PI ? PI extends ZodTupleItems ? ZodTuple : never : never : T; } declare type PassthroughType = T extends "passthrough" ? { [k: string]: unknown; } : unknown; declare const pipelineType: typeof ZodPipeline.create; declare type PreprocessEffect = { type: "preprocess"; transform: (arg: T, ctx: RefinementCtx) => any; }; declare const preprocessType: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; declare type Primitive = string | number | symbol | bigint | boolean | null | undefined; declare type ProcessedCreateParams = { errorMap?: ZodErrorMap | undefined; description?: string | undefined; }; declare const promiseType: (schema: Inner, params?: RawCreateParams) => ZodPromise; /** * Provide an A2UI configuration to descendant components and bind the * v0.9 catalog to the message processor. * * Must be called from inside a Vue `setup()` so that `provide()` and * `useMessageProcessor()` resolve correctly. */ export declare function provideA2UI(options: ProvideA2UIOptions): void; export declare interface ProvideA2UIOptions { app: App; catalog: Catalog; theme: A2UITheme; /** Catalog id matching the `catalogId` field of `createSurface` messages. Defaults to the v0.9 basic catalog ID. */ catalogId?: string; } declare const quotelessJson: (obj: any) => string; declare type RawCreateParams = { errorMap?: ZodErrorMap | undefined; invalid_type_error?: string | undefined; required_error?: string | undefined; message?: string | undefined; description?: string | undefined; } | undefined; declare type RecordType = [string] extends [K] ? Record : [number] extends [K] ? Record : [symbol] extends [K] ? Record : [BRAND] extends [K] ? Record : Partial>; declare const recordType: typeof ZodRecord.create; declare type recursiveZodFormattedError = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError; } : T extends any[] ? { [k: number]: ZodFormattedError; } : T extends object ? { [K in keyof T]?: ZodFormattedError; } : unknown; declare type Refinement = (arg: T, ctx: RefinementCtx) => any; declare interface RefinementCtx { addIssue: (arg: IssueData) => void; path: (string | number)[]; } declare type RefinementEffect = { type: "refinement"; refinement: (arg: T, ctx: RefinementCtx) => any; }; declare type SafeParseError = { success: false; error: ZodError; data?: never; }; declare type SafeParseReturnType = SafeParseSuccess | SafeParseError; declare type SafeParseSuccess = { success: true; data: Output; error?: never; }; declare type Scalars = Primitive | Primitive[]; /** * Maps each v0.9 basic-catalog component type name to its real Zod schema. * * The {@link GenericBinder} relies on schema scraping to classify each * property (DYNAMIC / ACTION / STRUCTURAL / CHECKABLE / STATIC), so the * renderer must hand it the real component schemas rather than a permissive * `z.any()`. Keyed by `api.name` to match the Vue catalog type names 1:1. */ export declare const SCHEMA_REGISTRY: Record; declare function setErrorMap(map: ZodErrorMap): void; declare const setType: (valueType: ValueSchema, params?: RawCreateParams) => ZodSet; declare type SomeZodObject = ZodObject; /** * The Standard Schema interface. */ declare type StandardSchemaV1 = { /** * The Standard Schema properties. */ readonly "~standard": StandardSchemaV1.Props; }; declare namespace StandardSchemaV1 { /** * The Standard Schema properties interface. */ interface Props { /** * The version number of the standard. */ readonly version: 1; /** * The vendor name of the schema library. */ readonly vendor: string; /** * Validates unknown input values. */ readonly validate: (value: unknown) => Result | Promise>; /** * Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** * The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** * The result interface if validation succeeds. */ interface SuccessResult { /** * The typed output value. */ readonly value: Output; /** * The non-existent issues. */ readonly issues?: undefined; } /** * The result interface if validation fails. */ interface FailureResult { /** * The issues of failed validation. */ readonly issues: ReadonlyArray; } /** * The issue interface of the failure output. */ interface Issue { /** * The error message of the issue. */ readonly message: string; /** * The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** * The path segment interface of the issue. */ interface PathSegment { /** * The key representing a path segment. */ readonly key: PropertyKey; } /** * The Standard Schema types interface. */ interface Types { /** * The input type of the schema. */ readonly input: Input; /** * The output type of the schema. */ readonly output: Output; } /** * Infers the input type of a Standard Schema. */ type InferInput = NonNullable["input"]; /** * Infers the output type of a Standard Schema. */ type InferOutput = NonNullable["output"]; export {}; } declare const strictObjectType: (shape: Shape, params?: RawCreateParams) => ZodObject; declare const stringType: (params?: RawCreateParams & { coerce?: true; }) => ZodString; declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | { includes: string; position?: number | undefined; } | { startsWith: string; } | { endsWith: string; }; declare type stripPath = T extends any ? util.OmitKeys : never; /** Standard cleanup interface returned by all subscriptions. */ declare interface Subscription { /** Unsubscribes from the event source. */ unsubscribe(): void; } declare type SuperRefinement = (arg: T, ctx: RefinementCtx) => void | Promise; /** * Manages the collection of components for a specific surface. */ declare class SurfaceComponentsModel { private components; private readonly _onCreated; private readonly _onDeleted; /** Fires when a new component is added to the model. */ readonly onCreated: EventSource_2; /** Fires when a component is removed, providing the ID of the deleted component. */ readonly onDeleted: EventSource_2; /** * Retrieves a component by its ID. * * * @param id The ID of the component to retrieve. * @returns The component model, or undefined if not found. */ get(id: string): ComponentModel | undefined; /** * Returns an iterator over the components in the model. */ get entries(): IterableIterator<[string, ComponentModel]>; /** * Adds a component to the model. * Throws an error if a component with the same ID already exists. * * @param component The component to add. */ addComponent(component: ComponentModel): void; /** * Removes a component from the model by its ID. * Disposes of the component upon removal. * * @param id The ID of the component to remove. */ removeComponent(id: string): void; /** * Disposes of the model and all its components. */ dispose(): void; } /** * The state model for a single UI surface. * * A surface is the root container for a set of components and their associated data. * It coordinates data binding, component state, and action dispatching. * * @template T The concrete type of the ComponentApi from the catalog. */ declare class SurfaceModel { readonly id: string; readonly catalog: Catalog_2; readonly theme: any; readonly sendDataModel: boolean; readonly locale?: string | undefined; /** The data model for this surface. */ readonly dataModel: DataModel; /** The collection of component models for this surface. */ readonly componentsModel: SurfaceComponentsModel; private readonly _onAction; private readonly _onError; /** Fires whenever an action is dispatched from this surface. */ readonly onAction: EventSource_2; /** Fires whenever an error occurs on this surface. */ readonly onError: EventSource_2; /** * Creates a new surface model. * * @param id The unique identifier for this surface. * @param catalog The component catalog used by this surface. * @param theme The theme to apply to this surface. * @param sendDataModel If true, the client will send the full data model. * @param locale The locale to use in locale-sensitive functions. */ constructor(id: string, catalog: Catalog_2, theme?: any, sendDataModel?: boolean, locale?: string | undefined); /** * Dispatches an action from this surface to listeners. * * @param payload The action payload (name and context) to dispatch. * @param sourceComponentId The ID of the component that triggered the action. */ dispatchAction(payload: any, sourceComponentId: string): Promise; /** * Dispatches an error from this surface to listeners. * * @param error The error object to dispatch, conforming to client_to_server schema. */ dispatchError(error: { code: string; message: string; [key: string]: any; }): Promise; /** * Disposes of the surface and its resources. */ dispose(): void; } declare const symbolType: (params?: RawCreateParams) => ZodSymbol; declare type SyncParseReturnType = OK | DIRTY | INVALID; declare type TransformEffect = { type: "transform"; transform: (arg: T, ctx: RefinementCtx) => any; }; declare const tupleType: (schemas: Items, params?: RawCreateParams) => ZodTuple; declare type typecast = A extends T ? A : never; declare type TypeOf> = T["_output"]; declare type typeToFlattenedError = { formErrors: U[]; fieldErrors: { [P in allKeys]?: U[]; }; }; declare const undefinedType: (params?: RawCreateParams) => ZodUndefined; declare const unionType: >(types: Options, params?: RawCreateParams) => ZodUnion; declare type UnknownKeysParam = "passthrough" | "strict" | "strip"; declare const unknownType: (params?: RawCreateParams) => ZodUnknown; declare interface UpdateComponentsMessage extends z.infer { version: 'v0.9'; updateComponents: { surfaceId: string; components: any[]; }; } declare const UpdateComponentsMessageSchema: z.ZodObject<{ version: z.ZodLiteral<"v0.9">; updateComponents: z.ZodObject<{ surfaceId: z.ZodString; components: z.ZodArray; weight: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">; }, "strict", z.ZodTypeAny, { surfaceId: string; components: z.objectOutputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; }, { surfaceId: string; components: z.objectInputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; }>; }, "strict", z.ZodTypeAny, { version: "v0.9"; updateComponents: { surfaceId: string; components: z.objectOutputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; }; }, { version: "v0.9"; updateComponents: { surfaceId: string; components: z.objectInputType<{ component: z.ZodString; id: z.ZodOptional; weight: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; }; }>; declare interface UpdateDataModelMessage extends z.infer { version: 'v0.9'; updateDataModel: { surfaceId: string; path?: string; value?: any; }; } declare const UpdateDataModelMessageSchema: z.ZodObject<{ version: z.ZodLiteral<"v0.9">; updateDataModel: z.ZodObject<{ surfaceId: z.ZodString; path: z.ZodOptional; value: z.ZodOptional; }, "strict", z.ZodTypeAny, { surfaceId: string; value?: any; path?: string | undefined; }, { surfaceId: string; value?: any; path?: string | undefined; }>; }, "strict", z.ZodTypeAny, { version: "v0.9"; updateDataModel: { surfaceId: string; value?: any; path?: string | undefined; }; }, { version: "v0.9"; updateDataModel: { surfaceId: string; value?: any; path?: string | undefined; }; }>; export declare function useA2UIConfig(): A2UIConfig; /** * Vue counterpart of the Lit `A2uiController`. * * Creates a {@link GenericBinder} from a {@link ComponentContext} and the * component's real Zod schema, then bridges the binder's subscription model * into a Vue `shallowRef` (`bound`). The binder is recreated whenever the * component identity changes and disposed on unmount. * * Components that have no registered schema or whose surface is not yet * available degrade gracefully to an empty (but reactive) `bound` object. */ export declare function useBinder(props: { surfaceId: string | null; component: VueComponentNode; }): UseBinderResult; export declare interface UseBinderResult { /** * Reactive snapshot of the component's resolved props, mirroring the Lit * `A2uiController.props`. Contains resolved DYNAMIC values, ACTION callbacks * (`() => void`), STRUCTURAL child refs (`{ id, basePath }[]`), generated * `setXxx` setters for dynamic props, plus `isValid` / `validationErrors`. */ bound: Ref>; /** * Convert binder STRUCTURAL child refs into renderable `VueComponentNode`s * using the processor's node builder. */ resolveChildren: (refs: ChildRef[] | undefined) => VueComponentNode[]; } /** * Composable used inside every catalog component. Provides convenience helpers * for resolving v0.9 dynamic values, dispatching client actions, and writing * back to the data model. * * Notes on v0.9 vs v0.8 differences: * - `Action` is `{ event: { name, context } }` or `{ functionCall: ... }`. * - The wire-level client message is `{ version: 'v0.9', action: A2uiClientAction }`. * - `DynamicValue` is either a literal primitive, `{ path }` (data binding), * or `{ call, args, returnType }` (function call). The renderer keeps a * small backward-compatibility shim for the legacy `literal*` wrappers so * that existing samples continue to work during migration. */ export declare function useDynamicComponent(props: { surfaceId: string | null; component: T; weight: string | number; }): { theme: A2UITheme; processor: MessageProcessor; bound: Ref, Record>; resolveChildren: (refs: ChildRef[] | undefined) => VueComponentNode[]; sendAction: (action: any) => Promise; resolveDynamicValue: (value: unknown) => unknown; resolvePrimitive: (value: unknown) => string | number | boolean | null; getUniqueId: (prefix: string) => string; setData: (node: VueComponentNode, relativePath: string, value: unknown, surfaceId?: string | null) => void; getBindingPath: (value: unknown) => string | undefined; }; export declare function useMarkdownRenderer(): MarkdownRenderer; export declare function useMessageProcessor(): MessageProcessor; declare namespace util { type AssertEqual = (() => V extends T ? 1 : 2) extends () => V extends U ? 1 : 2 ? true : false; type isAny = 0 extends 1 & T ? true : false; const assertEqual: (_: AssertEqual) => void; function assertIs(_arg: T): void; function assertNever(_x: never): never; type Omit = Pick>; type OmitKeys = Pick>; type MakePartial = Omit & Partial>; type Exactly = T & Record, never>; type InexactPartial = { [k in keyof T]?: T[k] | undefined; }; const arrayToEnum: (items: U) => { [k in U[number]]: k; }; const getValidEnumValues: (obj: any) => any[]; const objectValues: (obj: any) => any[]; const objectKeys: ObjectConstructor["keys"]; const find: (arr: T[], checker: (arg: T) => any) => T | undefined; type identity = objectUtil.identity; type flatten = objectUtil.flatten; type noUndefined = T extends undefined ? never : T; const isInteger: NumberConstructor["isInteger"]; function joinValues(array: T, separator?: string): string; const jsonStringifyReplacer: (_: string, value: any) => any; export {}; } declare type Values = { [k in T[number]]: k; }; declare const voidType: (params?: RawCreateParams) => ZodVoid; /** * A v0.9 ComponentApi specialised for the Vue renderer. * * Mirrors the angular `AngularComponentImplementation` / lit `LitComponentApi` * pattern: extends the core ComponentApi with framework-specific metadata. * For Vue we only need a `name` + a permissive `schema`; the actual Vue * component class is resolved through the Vue-style `Catalog` map below. */ export declare interface VueComponentApi extends ComponentApi { /** Component name as it appears in the A2UI JSON. */ readonly name: string; /** Zod schema describing the component's properties (permissive by default). */ readonly schema: z.ZodType; } /** * Lightweight adapter object passed to Vue components in lieu of the v0.8 * `AnyComponentNode` tree. Built from a v0.9 `ComponentModel`. */ export declare interface VueComponentNode { id: string; type: string; properties: Record; /** Absolute base path of the component within its surface's data model. */ dataContextPath: string; weight?: string | number; } declare type Writeable = { -readonly [P in keyof T]: T[P]; }; declare namespace z { export { setErrorMap, getErrorMap, errorMap as defaultErrorMap, addIssueToContext, makeIssue, ParseParams, ParsePathComponent, ParsePath, EMPTY_PATH, ParseContext, ParseInput, ObjectPair, ParseStatus, ParseResult, INVALID, DIRTY, OK, SyncParseReturnType, AsyncParseReturnType, ParseReturnType, isAborted, isDirty, isValid, isAsync, Primitive, Scalars, util, objectUtil, ZodParsedType, getParsedType, datetimeRegex, custom, RefinementCtx, ZodRawShape, ZodTypeAny, TypeOf, input, output, TypeOf as infer, CustomErrorParams, ZodTypeDef, RawCreateParams, ProcessedCreateParams, SafeParseSuccess, SafeParseError, SafeParseReturnType, ZodType, IpVersion, ZodStringCheck, ZodStringDef, ZodString, ZodNumberCheck, ZodNumberDef, ZodNumber, ZodBigIntCheck, ZodBigIntDef, ZodBigInt, ZodBooleanDef, ZodBoolean, ZodDateCheck, ZodDateDef, ZodDate, ZodSymbolDef, ZodSymbol, ZodUndefinedDef, ZodUndefined, ZodNullDef, ZodNull, ZodAnyDef, ZodAny, ZodUnknownDef, ZodUnknown, ZodNeverDef, ZodNever, ZodVoidDef, ZodVoid, ZodArrayDef, ArrayCardinality, arrayOutputType, ZodArray, ZodNonEmptyArray, UnknownKeysParam, ZodObjectDef, mergeTypes, objectOutputType, baseObjectOutputType, objectInputType, baseObjectInputType, CatchallOutput, CatchallInput, PassthroughType, deoptional, SomeZodObject, noUnrecognized, ZodObject, AnyZodObject, ZodUnionOptions, ZodUnionDef, ZodUnion, ZodDiscriminatedUnionOption, ZodDiscriminatedUnionDef, ZodDiscriminatedUnion, ZodIntersectionDef, ZodIntersection, ZodTupleItems, AssertArray, OutputTypeOfTuple, OutputTypeOfTupleWithRest, InputTypeOfTuple, InputTypeOfTupleWithRest, ZodTupleDef, AnyZodTuple, ZodTuple, ZodRecordDef, KeySchema, RecordType, ZodRecord, ZodMapDef, ZodMap, ZodSetDef, ZodSet, ZodFunctionDef, OuterTypeOfFunction, InnerTypeOfFunction, ZodFunction, ZodLazyDef, ZodLazy, ZodLiteralDef, ZodLiteral, ArrayKeys, Indices, EnumValues, Values, ZodEnumDef, Writeable, FilterEnum, typecast, ZodEnum, ZodNativeEnumDef, EnumLike, ZodNativeEnum, ZodPromiseDef, ZodPromise, Refinement, SuperRefinement, RefinementEffect, TransformEffect, PreprocessEffect, Effect, ZodEffectsDef, ZodEffects, ZodEffects as ZodTransformer, ZodOptionalDef, ZodOptionalType, ZodOptional, ZodNullableDef, ZodNullableType, ZodNullable, ZodDefaultDef, ZodDefault, ZodCatchDef, ZodCatch, ZodNaNDef, ZodNaN, ZodBrandedDef, BRAND, ZodBranded, ZodPipelineDef, ZodPipeline, ZodReadonlyDef, ZodReadonly, ZodType as Schema, ZodType as ZodSchema, late, ZodFirstPartyTypeKind, ZodFirstPartySchemaTypes, coerce, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, NEVER, inferFlattenedErrors, typeToFlattenedError, ZodIssueCode, ZodIssueBase, ZodInvalidTypeIssue, ZodInvalidLiteralIssue, ZodUnrecognizedKeysIssue, ZodInvalidUnionIssue, ZodInvalidUnionDiscriminatorIssue, ZodInvalidEnumValueIssue, ZodInvalidArgumentsIssue, ZodInvalidReturnTypeIssue, ZodInvalidDateIssue, StringValidation, ZodInvalidStringIssue, ZodTooSmallIssue, ZodTooBigIssue, ZodInvalidIntersectionTypesIssue, ZodNotMultipleOfIssue, ZodNotFiniteIssue, ZodCustomIssue, DenormalizedError, ZodIssueOptionalMessage, ZodIssue, quotelessJson, ZodFormattedError, inferFormattedError, ZodError, IssueData, ErrorMapCtx, ZodErrorMap } } declare class ZodAny extends ZodType { _any: true; _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodAny; } declare interface ZodAnyDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodAny; } declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { _parse(input: ParseInput): ParseReturnType; get element(): T; min(minLength: number, message?: errorUtil.ErrMessage): this; max(maxLength: number, message?: errorUtil.ErrMessage): this; length(len: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodArray; static create: (schema: El, params?: RawCreateParams) => ZodArray; } declare interface ZodArrayDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodArray; exactLength: { value: number; message?: string | undefined; } | null; minLength: { value: number; message?: string | undefined; } | null; maxLength: { value: number; message?: string | undefined; } | null; } declare class ZodBigInt extends ZodType { _parse(input: ParseInput): ParseReturnType; _getInvalidInput(input: ParseInput): INVALID; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodBigInt; gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt; gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt; lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt; _addCheck(check: ZodBigIntCheck): ZodBigInt; positive(message?: errorUtil.ErrMessage): ZodBigInt; negative(message?: errorUtil.ErrMessage): ZodBigInt; nonpositive(message?: errorUtil.ErrMessage): ZodBigInt; nonnegative(message?: errorUtil.ErrMessage): ZodBigInt; multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt; get minValue(): bigint | null; get maxValue(): bigint | null; } declare type ZodBigIntCheck = { kind: "min"; value: bigint; inclusive: boolean; message?: string | undefined; } | { kind: "max"; value: bigint; inclusive: boolean; message?: string | undefined; } | { kind: "multipleOf"; value: bigint; message?: string | undefined; }; declare interface ZodBigIntDef extends ZodTypeDef { checks: ZodBigIntCheck[]; typeName: ZodFirstPartyTypeKind.ZodBigInt; coerce: boolean; } declare class ZodBoolean extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodBoolean; } declare interface ZodBooleanDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodBoolean; coerce: boolean; } declare class ZodBranded extends ZodType, ZodBrandedDef, T["_input"]> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; } declare interface ZodBrandedDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodBranded; } declare class ZodCatch extends ZodType, unknown> { _parse(input: ParseInput): ParseReturnType; removeCatch(): T; static create: (type: Inner, params: RawCreateParams & { catch: Inner["_output"] | (() => Inner["_output"]); }) => ZodCatch; } declare interface ZodCatchDef extends ZodTypeDef { innerType: T; catchValue: (ctx: { error: ZodError; input: unknown; }) => T["_input"]; typeName: ZodFirstPartyTypeKind.ZodCatch; } declare interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any; }; } declare class ZodDate extends ZodType { _parse(input: ParseInput): ParseReturnType; _addCheck(check: ZodDateCheck): ZodDate; min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate; max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate; get minDate(): Date | null; get maxDate(): Date | null; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodDate; } declare type ZodDateCheck = { kind: "min"; value: number; message?: string | undefined; } | { kind: "max"; value: number; message?: string | undefined; }; declare interface ZodDateDef extends ZodTypeDef { checks: ZodDateCheck[]; coerce: boolean; typeName: ZodFirstPartyTypeKind.ZodDate; } declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; removeDefault(): T; static create: (type: Inner, params: RawCreateParams & { default: Inner["_input"] | (() => util.noUndefined); }) => ZodDefault; } declare interface ZodDefaultDef extends ZodTypeDef { innerType: T; defaultValue: () => util.noUndefined; typeName: ZodFirstPartyTypeKind.ZodDefault; } declare class ZodDiscriminatedUnion[]> extends ZodType, ZodDiscriminatedUnionDef, input> { _parse(input: ParseInput): ParseReturnType; get discriminator(): Discriminator; get options(): Options; get optionsMap(): Map>; /** * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. * However, it only allows a union of objects, all of which need to share a discriminator property. This property must * have a different value for each object in the union. * @param discriminator the name of the discriminator property * @param types an array of object schemas * @param params */ static create, ...ZodDiscriminatedUnionOption[] ]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion; } declare interface ZodDiscriminatedUnionDef[] = ZodDiscriminatedUnionOption[]> extends ZodTypeDef { discriminator: Discriminator; options: Options; optionsMap: Map>; typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion; } declare type ZodDiscriminatedUnionOption = ZodObject<{ [key in Discriminator]: ZodTypeAny; } & ZodRawShape, UnknownKeysParam, ZodTypeAny>; declare class ZodEffects, Input = input> extends ZodType, Input> { innerType(): T; sourceType(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; static createWithPreprocess: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; } declare interface ZodEffectsDef extends ZodTypeDef { schema: T; typeName: ZodFirstPartyTypeKind.ZodEffects; effect: Effect; } declare class ZodEnum extends ZodType, T[number]> { _cache: Set | undefined; _parse(input: ParseInput): ParseReturnType; get options(): T; get enum(): Values; get Values(): Values; get Enum(): Values; extract(values: ToExtract, newDef?: RawCreateParams): ZodEnum>; exclude(values: ToExclude, newDef?: RawCreateParams): ZodEnum>, [string, ...string[]]>>; static create: typeof createZodEnum; } declare interface ZodEnumDef extends ZodTypeDef { values: T; typeName: ZodFirstPartyTypeKind.ZodEnum; } declare class ZodError extends Error { issues: ZodIssue[]; get errors(): ZodIssue[]; constructor(issues: ZodIssue[]); format(): ZodFormattedError; format(mapper: (issue: ZodIssue) => U): ZodFormattedError; static create: (issues: ZodIssue[]) => ZodError; static assert(value: unknown): asserts value is ZodError; toString(): string; get message(): string; get isEmpty(): boolean; addIssue: (sub: ZodIssue) => void; addIssues: (subs?: ZodIssue[]) => void; flatten(): typeToFlattenedError; flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; get formErrors(): typeToFlattenedError; } declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string; }; declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray | ZodObject | ZodUnion | ZodDiscriminatedUnion | ZodIntersection | ZodTuple | ZodRecord | ZodMap | ZodSet | ZodFunction | ZodLazy | ZodLiteral | ZodEnum | ZodEffects | ZodNativeEnum | ZodOptional | ZodNullable | ZodDefault | ZodCatch | ZodPromise | ZodBranded | ZodPipeline | ZodReadonly | ZodSymbol; declare enum ZodFirstPartyTypeKind { ZodString = "ZodString", ZodNumber = "ZodNumber", ZodNaN = "ZodNaN", ZodBigInt = "ZodBigInt", ZodBoolean = "ZodBoolean", ZodDate = "ZodDate", ZodSymbol = "ZodSymbol", ZodUndefined = "ZodUndefined", ZodNull = "ZodNull", ZodAny = "ZodAny", ZodUnknown = "ZodUnknown", ZodNever = "ZodNever", ZodVoid = "ZodVoid", ZodArray = "ZodArray", ZodObject = "ZodObject", ZodUnion = "ZodUnion", ZodDiscriminatedUnion = "ZodDiscriminatedUnion", ZodIntersection = "ZodIntersection", ZodTuple = "ZodTuple", ZodRecord = "ZodRecord", ZodMap = "ZodMap", ZodSet = "ZodSet", ZodFunction = "ZodFunction", ZodLazy = "ZodLazy", ZodLiteral = "ZodLiteral", ZodEnum = "ZodEnum", ZodEffects = "ZodEffects", ZodNativeEnum = "ZodNativeEnum", ZodOptional = "ZodOptional", ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodCatch = "ZodCatch", ZodPromise = "ZodPromise", ZodBranded = "ZodBranded", ZodPipeline = "ZodPipeline", ZodReadonly = "ZodReadonly" } declare type ZodFormattedError = { _errors: U[]; } & recursiveZodFormattedError>; declare class ZodFunction, Returns extends ZodTypeAny> extends ZodType, ZodFunctionDef, InnerTypeOfFunction> { _parse(input: ParseInput): ParseReturnType; parameters(): Args; returnType(): Returns; args[0]>(...items: Items): ZodFunction, Returns>; returns>(returnType: NewReturnType): ZodFunction; implement>(func: F): ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; strictImplement(func: InnerTypeOfFunction): InnerTypeOfFunction; validate: >(func: F) => ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; static create(): ZodFunction, ZodUnknown>; static create>(args: T): ZodFunction; static create(args: T, returns: U): ZodFunction; static create, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction; } declare interface ZodFunctionDef = ZodTuple, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef { args: Args; returns: Returns; typeName: ZodFirstPartyTypeKind.ZodFunction; } declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { _parse(input: ParseInput): ParseReturnType; static create: (left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection; } declare interface ZodIntersectionDef extends ZodTypeDef { left: T; right: U; typeName: ZodFirstPartyTypeKind.ZodIntersection; } declare interface ZodInvalidArgumentsIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_arguments; argumentsError: ZodError; } declare interface ZodInvalidDateIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_date; } declare interface ZodInvalidEnumValueIssue extends ZodIssueBase { received: string | number; code: typeof ZodIssueCode.invalid_enum_value; options: (string | number)[]; } declare interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_intersection_types; } declare interface ZodInvalidLiteralIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_literal; expected: unknown; received: unknown; } declare interface ZodInvalidReturnTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_return_type; returnTypeError: ZodError; } declare interface ZodInvalidStringIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_string; validation: StringValidation; } declare interface ZodInvalidTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_type; expected: ZodParsedType; received: ZodParsedType; } declare interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union_discriminator; options: Primitive[]; } declare interface ZodInvalidUnionIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union; unionErrors: ZodError[]; } declare type ZodIssue = ZodIssueOptionalMessage & { fatal?: boolean | undefined; message: string; }; declare type ZodIssueBase = { path: (string | number)[]; message?: string | undefined; }; declare const ZodIssueCode: { invalid_type: "invalid_type"; invalid_literal: "invalid_literal"; custom: "custom"; invalid_union: "invalid_union"; invalid_union_discriminator: "invalid_union_discriminator"; invalid_enum_value: "invalid_enum_value"; unrecognized_keys: "unrecognized_keys"; invalid_arguments: "invalid_arguments"; invalid_return_type: "invalid_return_type"; invalid_date: "invalid_date"; invalid_string: "invalid_string"; too_small: "too_small"; too_big: "too_big"; invalid_intersection_types: "invalid_intersection_types"; not_multiple_of: "not_multiple_of"; not_finite: "not_finite"; }; declare type ZodIssueCode = keyof typeof ZodIssueCode; declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue; declare class ZodLazy extends ZodType, ZodLazyDef, input> { get schema(): T; _parse(input: ParseInput): ParseReturnType; static create: (getter: () => Inner, params?: RawCreateParams) => ZodLazy; } declare interface ZodLazyDef extends ZodTypeDef { getter: () => T; typeName: ZodFirstPartyTypeKind.ZodLazy; } declare class ZodLiteral extends ZodType, T> { _parse(input: ParseInput): ParseReturnType; get value(): T; static create: (value: Value, params?: RawCreateParams) => ZodLiteral; } declare interface ZodLiteralDef extends ZodTypeDef { value: T; typeName: ZodFirstPartyTypeKind.ZodLiteral; } declare class ZodMap extends ZodType, ZodMapDef, Map> { get keySchema(): Key; get valueSchema(): Value; _parse(input: ParseInput): ParseReturnType; static create: (keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap; } declare interface ZodMapDef extends ZodTypeDef { valueType: Value; keyType: Key; typeName: ZodFirstPartyTypeKind.ZodMap; } declare class ZodNaN extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNaN; } declare interface ZodNaNDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNaN; } declare class ZodNativeEnum extends ZodType, T[keyof T]> { _cache: Set | undefined; _parse(input: ParseInput): ParseReturnType; get enum(): T; static create: (values: Elements, params?: RawCreateParams) => ZodNativeEnum; } declare interface ZodNativeEnumDef extends ZodTypeDef { values: T; typeName: ZodFirstPartyTypeKind.ZodNativeEnum; } declare class ZodNever extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNever; } declare interface ZodNeverDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNever; } declare type ZodNonEmptyArray = ZodArray; declare interface ZodNotFiniteIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_finite; } declare interface ZodNotMultipleOfIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_multiple_of; multipleOf: number | bigint; } declare class ZodNull extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNull; } declare class ZodNullable extends ZodType, T["_input"] | null> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodNullable; } declare interface ZodNullableDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodNullable; } declare type ZodNullableType = ZodNullable; declare interface ZodNullDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNull; } declare class ZodNumber extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodNumber; gte(value: number, message?: errorUtil.ErrMessage): ZodNumber; min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; gt(value: number, message?: errorUtil.ErrMessage): ZodNumber; lte(value: number, message?: errorUtil.ErrMessage): ZodNumber; max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; lt(value: number, message?: errorUtil.ErrMessage): ZodNumber; protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber; _addCheck(check: ZodNumberCheck): ZodNumber; int(message?: errorUtil.ErrMessage): ZodNumber; positive(message?: errorUtil.ErrMessage): ZodNumber; negative(message?: errorUtil.ErrMessage): ZodNumber; nonpositive(message?: errorUtil.ErrMessage): ZodNumber; nonnegative(message?: errorUtil.ErrMessage): ZodNumber; multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber; step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; finite(message?: errorUtil.ErrMessage): ZodNumber; safe(message?: errorUtil.ErrMessage): ZodNumber; get minValue(): number | null; get maxValue(): number | null; get isInt(): boolean; get isFinite(): boolean; } declare type ZodNumberCheck = { kind: "min"; value: number; inclusive: boolean; message?: string | undefined; } | { kind: "max"; value: number; inclusive: boolean; message?: string | undefined; } | { kind: "int"; message?: string | undefined; } | { kind: "multipleOf"; value: number; message?: string | undefined; } | { kind: "finite"; message?: string | undefined; }; declare interface ZodNumberDef extends ZodTypeDef { checks: ZodNumberCheck[]; typeName: ZodFirstPartyTypeKind.ZodNumber; coerce: boolean; } declare class ZodObject, Input = objectInputType> extends ZodType, Input> { private _cached; _getCached(): { shape: T; keys: string[]; }; _parse(input: ParseInput): ParseReturnType; get shape(): T; strict(message?: errorUtil.ErrMessage): ZodObject; strip(): ZodObject; passthrough(): ZodObject; /** * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. * If you want to pass through unknown properties, use `.passthrough()` instead. */ nonstrict: () => ZodObject; extend(augmentation: Augmentation): ZodObject, UnknownKeys, Catchall>; /** * @deprecated Use `.extend` instead * */ augment: (augmentation: Augmentation) => ZodObject, UnknownKeys, Catchall>; /** * Prior to zod@1.0.12 there was a bug in the * inferred type of merged objects. Please * upgrade if you are experiencing issues. */ merge(merging: Incoming): ZodObject, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>; setKey(key: Key, schema: Schema): ZodObject; catchall(index: Index): ZodObject; pick>(mask: Mask): ZodObject>, UnknownKeys, Catchall>; omit>(mask: Mask): ZodObject, UnknownKeys, Catchall>; /** * @deprecated */ deepPartial(): partialUtil.DeepPartial; partial(): ZodObject<{ [k in keyof T]: ZodOptional; }, UnknownKeys, Catchall>; partial>(mask: Mask): ZodObject : T[k]; }>, UnknownKeys, Catchall>; required(): ZodObject<{ [k in keyof T]: deoptional; }, UnknownKeys, Catchall>; required>(mask: Mask): ZodObject : T[k]; }>, UnknownKeys, Catchall>; keyof(): ZodEnum>; static create: (shape: Shape, params?: RawCreateParams) => ZodObject, objectInputType>; static strictCreate: (shape: Shape, params?: RawCreateParams) => ZodObject; static lazycreate: (shape: () => Shape, params?: RawCreateParams) => ZodObject; } declare interface ZodObjectDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodObject; shape: () => T; catchall: Catchall; unknownKeys: UnknownKeys; } declare class ZodOptional extends ZodType, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodOptional; } declare interface ZodOptionalDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodOptional; } declare type ZodOptionalType = ZodOptional; declare const ZodParsedType: { string: "string"; nan: "nan"; number: "number"; integer: "integer"; float: "float"; boolean: "boolean"; date: "date"; bigint: "bigint"; symbol: "symbol"; function: "function"; undefined: "undefined"; null: "null"; array: "array"; object: "object"; unknown: "unknown"; promise: "promise"; void: "void"; never: "never"; map: "map"; set: "set"; }; declare type ZodParsedType = keyof typeof ZodParsedType; declare class ZodPipeline extends ZodType, A["_input"]> { _parse(input: ParseInput): ParseReturnType; static create(a: ASchema, b: BSchema): ZodPipeline; } declare interface ZodPipelineDef extends ZodTypeDef { in: A; out: B; typeName: ZodFirstPartyTypeKind.ZodPipeline; } declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { unwrap(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: Inner, params?: RawCreateParams) => ZodPromise; } declare interface ZodPromiseDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodPromise; } declare type ZodRawShape = { [k: string]: ZodTypeAny; }; declare class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { _parse(input: ParseInput): ParseReturnType; static create: (type: Inner, params?: RawCreateParams) => ZodReadonly; unwrap(): T; } declare interface ZodReadonlyDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodReadonly; } declare class ZodRecord extends ZodType, ZodRecordDef, RecordType> { get keySchema(): Key; get valueSchema(): Value; _parse(input: ParseInput): ParseReturnType; get element(): Value; static create(valueType: Value, params?: RawCreateParams): ZodRecord; static create(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord; } declare interface ZodRecordDef extends ZodTypeDef { valueType: Value; keyType: Key; typeName: ZodFirstPartyTypeKind.ZodRecord; } declare class ZodSet extends ZodType, ZodSetDef, Set> { _parse(input: ParseInput): ParseReturnType; min(minSize: number, message?: errorUtil.ErrMessage): this; max(maxSize: number, message?: errorUtil.ErrMessage): this; size(size: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodSet; static create: (valueType: ValueSchema, params?: RawCreateParams) => ZodSet; } declare interface ZodSetDef extends ZodTypeDef { valueType: Value; typeName: ZodFirstPartyTypeKind.ZodSet; minSize: { value: number; message?: string | undefined; } | null; maxSize: { value: number; message?: string | undefined; } | null; } declare class ZodString extends ZodType { _parse(input: ParseInput): ParseReturnType; protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects; _addCheck(check: ZodStringCheck): ZodString; email(message?: errorUtil.ErrMessage): ZodString; url(message?: errorUtil.ErrMessage): ZodString; emoji(message?: errorUtil.ErrMessage): ZodString; uuid(message?: errorUtil.ErrMessage): ZodString; nanoid(message?: errorUtil.ErrMessage): ZodString; cuid(message?: errorUtil.ErrMessage): ZodString; cuid2(message?: errorUtil.ErrMessage): ZodString; ulid(message?: errorUtil.ErrMessage): ZodString; base64(message?: errorUtil.ErrMessage): ZodString; base64url(message?: errorUtil.ErrMessage): ZodString; jwt(options?: { alg?: string; message?: string | undefined; }): ZodString; ip(options?: string | { version?: IpVersion; message?: string | undefined; }): ZodString; cidr(options?: string | { version?: IpVersion; message?: string | undefined; }): ZodString; datetime(options?: string | { message?: string | undefined; precision?: number | null; offset?: boolean; local?: boolean; }): ZodString; date(message?: string): ZodString; time(options?: string | { message?: string | undefined; precision?: number | null; }): ZodString; duration(message?: errorUtil.ErrMessage): ZodString; regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString; includes(value: string, options?: { message?: string; position?: number; }): ZodString; startsWith(value: string, message?: errorUtil.ErrMessage): ZodString; endsWith(value: string, message?: errorUtil.ErrMessage): ZodString; min(minLength: number, message?: errorUtil.ErrMessage): ZodString; max(maxLength: number, message?: errorUtil.ErrMessage): ZodString; length(len: number, message?: errorUtil.ErrMessage): ZodString; /** * Equivalent to `.min(1)` */ nonempty(message?: errorUtil.ErrMessage): ZodString; trim(): ZodString; toLowerCase(): ZodString; toUpperCase(): ZodString; get isDatetime(): boolean; get isDate(): boolean; get isTime(): boolean; get isDuration(): boolean; get isEmail(): boolean; get isURL(): boolean; get isEmoji(): boolean; get isUUID(): boolean; get isNANOID(): boolean; get isCUID(): boolean; get isCUID2(): boolean; get isULID(): boolean; get isIP(): boolean; get isCIDR(): boolean; get isBase64(): boolean; get isBase64url(): boolean; get minLength(): number | null; get maxLength(): number | null; static create: (params?: RawCreateParams & { coerce?: true; }) => ZodString; } declare type ZodStringCheck = { kind: "min"; value: number; message?: string | undefined; } | { kind: "max"; value: number; message?: string | undefined; } | { kind: "length"; value: number; message?: string | undefined; } | { kind: "email"; message?: string | undefined; } | { kind: "url"; message?: string | undefined; } | { kind: "emoji"; message?: string | undefined; } | { kind: "uuid"; message?: string | undefined; } | { kind: "nanoid"; message?: string | undefined; } | { kind: "cuid"; message?: string | undefined; } | { kind: "includes"; value: string; position?: number | undefined; message?: string | undefined; } | { kind: "cuid2"; message?: string | undefined; } | { kind: "ulid"; message?: string | undefined; } | { kind: "startsWith"; value: string; message?: string | undefined; } | { kind: "endsWith"; value: string; message?: string | undefined; } | { kind: "regex"; regex: RegExp; message?: string | undefined; } | { kind: "trim"; message?: string | undefined; } | { kind: "toLowerCase"; message?: string | undefined; } | { kind: "toUpperCase"; message?: string | undefined; } | { kind: "jwt"; alg?: string; message?: string | undefined; } | { kind: "datetime"; offset: boolean; local: boolean; precision: number | null; message?: string | undefined; } | { kind: "date"; message?: string | undefined; } | { kind: "time"; precision: number | null; message?: string | undefined; } | { kind: "duration"; message?: string | undefined; } | { kind: "ip"; version?: IpVersion | undefined; message?: string | undefined; } | { kind: "cidr"; version?: IpVersion | undefined; message?: string | undefined; } | { kind: "base64"; message?: string | undefined; } | { kind: "base64url"; message?: string | undefined; }; declare interface ZodStringDef extends ZodTypeDef { checks: ZodStringCheck[]; typeName: ZodFirstPartyTypeKind.ZodString; coerce: boolean; } declare class ZodSymbol extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodSymbol; } declare interface ZodSymbolDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodSymbol; } declare interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } declare interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } declare class ZodTuple extends ZodType, ZodTupleDef, InputTypeOfTupleWithRest> { _parse(input: ParseInput): ParseReturnType; get items(): T; rest(rest: RestSchema): ZodTuple; static create: (schemas: Items, params?: RawCreateParams) => ZodTuple; } declare interface ZodTupleDef extends ZodTypeDef { items: T; rest: Rest; typeName: ZodFirstPartyTypeKind.ZodTuple; } declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]]; declare abstract class ZodType { readonly _type: Output; readonly _output: Output; readonly _input: Input; readonly _def: Def; get description(): string | undefined; "~standard": StandardSchemaV1.Props; abstract _parse(input: ParseInput): ParseReturnType; _getType(input: ParseInput): string; _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; _processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext; }; _parseSync(input: ParseInput): SyncParseReturnType; _parseAsync(input: ParseInput): AsyncParseReturnType; parse(data: unknown, params?: util.InexactPartial): Output; safeParse(data: unknown, params?: util.InexactPartial): SafeParseReturnType; "~validate"(data: unknown): StandardSchemaV1.Result | Promise>; parseAsync(data: unknown, params?: util.InexactPartial): Promise; safeParseAsync(data: unknown, params?: util.InexactPartial): Promise>; /** Alias of safeParseAsync */ spa: (data: unknown, params?: util.InexactPartial) => Promise>; refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; constructor(def: Def); optional(): ZodOptional; nullable(): ZodNullable; nullish(): ZodOptional>; array(): ZodArray; promise(): ZodPromise; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; default(def: util.noUndefined): ZodDefault; default(def: () => util.noUndefined): ZodDefault; brand(brand?: B): ZodBranded; catch(def: Output): ZodCatch; catch(def: (ctx: { error: ZodError; input: Input; }) => Output): ZodCatch; describe(description: string): this; pipe(target: T): ZodPipeline; readonly(): ZodReadonly; isOptional(): boolean; isNullable(): boolean; } declare type ZodTypeAny = ZodType; declare interface ZodTypeDef { errorMap?: ZodErrorMap | undefined; description?: string | undefined; } declare class ZodUndefined extends ZodType { _parse(input: ParseInput): ParseReturnType; params?: RawCreateParams; static create: (params?: RawCreateParams) => ZodUndefined; } declare interface ZodUndefinedDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodUndefined; } declare class ZodUnion extends ZodType, T[number]["_input"]> { _parse(input: ParseInput): ParseReturnType; get options(): T; static create: >(types: Options, params?: RawCreateParams) => ZodUnion; } declare interface ZodUnionDef> extends ZodTypeDef { options: T; typeName: ZodFirstPartyTypeKind.ZodUnion; } declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; declare class ZodUnknown extends ZodType { _unknown: true; _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodUnknown; } declare interface ZodUnknownDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodUnknown; } declare interface ZodUnrecognizedKeysIssue extends ZodIssueBase { code: typeof ZodIssueCode.unrecognized_keys; keys: string[]; } declare class ZodVoid extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodVoid; } declare interface ZodVoidDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodVoid; } export { }