/** A JSON Schema, as a component's parameters are described to the agent. */ export type AIUIJSONSchema = Record; /** Something the agent fills in for a component. The counterpart of `AIUIParameter`. */ export type AIUIParameter = { /** Whether the agent must fill it in. */ isRequired: boolean; /** The name the agent fills it in by, such as `title`. */ name: string; /** What it holds, as a JSON Schema, such as `AIUIParameterType.string`. */ type: AIUIJSONSchema; /** What it is, for the agent. */ description?: string; }; /** Something a component reports when the person uses it, such as tapping a place. */ export type AIUIComponentEvent = { /** When it happens, for the agent. */ description: string; /** The name it is reported by, such as `ask_about`. */ name: string; /** What it carries, in order. */ parameters: AIUIParameter[]; }; /** * An app's component as the agent knows it: its name, what it shows, what the agent fills in * and what it reports. It is portable JSON, the same on every platform, so one description * (such as a `UIComponents.json` shared with the iOS and Android apps) serves them all. The * counterpart of `AIUIComponentDefinition` in StreamChatAI. */ export type AIUIComponentDefinition = { /** What it shows and when to use it, for the agent. */ description: string; /** What it reports when the person uses it. */ events: AIUIComponentEvent[]; /** The name the agent places it by, such as `place_card`. */ name: string; /** * What the agent fills in, in order: a format such as OpenUI Lang passes arguments by * position. */ parameters: AIUIParameter[]; }; /** The types a parameter commonly has, as JSON Schemas. */ export declare const AIUIParameterType: { /** A list of values of one type. */ array: (items: AIUIJSONSchema) => AIUIJSONSchema; boolean: AIUIJSONSchema; /** A day, such as `2026-11-14`. */ date: AIUIJSONSchema; /** A moment, such as `2026-11-14T09:30:00Z`. */ dateTime: AIUIJSONSchema; /** One of a fixed set of strings. */ enumeration: (values: string[]) => AIUIJSONSchema; integer: AIUIJSONSchema; number: AIUIJSONSchema; /** An object with named fields, in order. */ object: (fields: AIUIParameter[]) => AIUIJSONSchema; string: AIUIJSONSchema; /** A link, such as an image's. */ url: AIUIJSONSchema; }; /** A parameter the agent must fill in. */ export declare const requiredAIUIParameter: (name: string, type: AIUIJSONSchema, description?: string) => AIUIParameter; /** A parameter the agent may leave out. */ export declare const optionalAIUIParameter: (name: string, type: AIUIJSONSchema, description?: string) => AIUIParameter; /** Parameters as a JSON Schema object, the way a tool's are described, keeping their order. */ export declare const aiUIObjectSchema: (parameters: AIUIParameter[]) => AIUIJSONSchema; /** The fields of a JSON Schema object, in the order it keeps, then by name. */ export declare const aiUIParametersOf: (schema: unknown) => AIUIParameter[]; /** * Reads a component's portable JSON, such as one entry of a `UIComponents.json`, or returns * `undefined` for one without a name. */ export declare const parseAIUIComponentDefinition: (json: unknown) => AIUIComponentDefinition | undefined; /** A component's portable JSON, as `parseAIUIComponentDefinition` reads it back. */ export declare const aiUIComponentDefinitionJSON: (definition: AIUIComponentDefinition) => { description: string; events: { parameters?: AIUIJSONSchema | undefined; description: string; name: string; }[]; name: string; parameters: AIUIJSONSchema; }; //# sourceMappingURL=AIUIComponentDefinition.d.ts.map