import { AIClient } from '@opentiny/tiny-robot-kit'; import { BubbleCommonProps } from '@opentiny/tiny-robot'; import { BubbleMarkdownContentRenderer } from '@opentiny/tiny-robot'; import { BubbleProps } from '@opentiny/tiny-robot'; import { BubbleRoleConfig } from '@opentiny/tiny-robot'; import { ChatMessage } from '@opentiny/tiny-robot-kit'; import { Component } from 'vue'; import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import { ComputedRef } from 'vue'; import { Conversation } from '@opentiny/tiny-robot-kit'; import { ConversationState } from '@opentiny/tiny-robot-kit'; import { ConversationStorageStrategy } from '@opentiny/tiny-robot-kit'; import { DefineComponent } from 'vue'; import { MessageState } from '@opentiny/tiny-robot-kit'; import { PublicProps } from 'vue'; import { Reactive } from 'vue'; import { Ref } from 'vue'; import { RendererElement } from 'vue'; import { RendererNode } from 'vue'; import { UnwrapNestedRefs } from 'vue'; import { UseConversationOptions } from '@opentiny/tiny-robot-kit'; import { UseMessageReturn as UseMessageReturn_2 } from '@opentiny/tiny-robot-kit'; import { UserItem } from '@opentiny/tiny-robot'; import { VNode } from 'vue'; declare const __VLS_component: DefineComponent void; handleNewConversation: () => void; getConversation: () => UseConversationReturn; getResponseHandlers: () => IResponseHandler[]; setResponseHandlers: (handlers: IResponseHandler[]) => void; getMessageRenderers: () => { 'custom-text': (props: BubbleCommonProps & { content: string; }) => VNode; 'schema-card': (schemaCardProps: IRendererProps) => VNode; tool: DefineComponent< { name: string; status: "running" | "success" | "failed" | "cancelled"; content?: string | { params?: object; result?: object; [x: string]: unknown; }; formatPretty?: boolean; defaultOpen?: boolean; }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{ name: string; status: "running" | "success" | "failed" | "cancelled"; content?: string | { params?: object; result?: object; [x: string]: unknown; }; formatPretty?: boolean; defaultOpen?: boolean; }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>; reasoning: DefineComponent< { content: string; thinking?: boolean; }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{ content: string; thinking?: boolean; }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>; markdown: BubbleMarkdownContentRenderer; templateData: DefineComponent & Readonly<{}>, { attachments: FileMeta[]; templateData: UserItem[]; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>; 'loading-text': Component | DefineComponent & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; 'error-text': DefineComponent< { content: string; }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{ content: string; }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>; }; setMessageRenderer: (key: string, renderer: Component) => void; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, { messagesContainer: HTMLDivElement; }, HTMLDivElement>; declare function __VLS_template(): { attrs: Partial<{}>; slots: { empty?(_: {}): any; }; refs: { messagesContainer: HTMLDivElement; }; rootEl: HTMLDivElement; }; declare type __VLS_TemplateResult = ReturnType; declare type __VLS_WithTemplateSlots = T & { new (): { $slots: S; }; }; 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; }; }; declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; declare type CardSchema = z.infer; declare const cardSchema: z.ZodType; declare type CatchallInput = ZodType extends T ? unknown : { [k: string]: T["_input"]; }; declare type CatchallOutput = ZodType extends T ? unknown : { [k: string]: T["_output"]; }; 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"]; }; export declare function createI18n(options?: I18nOptions): I18nInstance; 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; export declare const CUSTOM_CONTEXT: unique symbol; declare type CustomErrorParams = Partial>; /** * 自定义请求函数类型 * @param url 请求地址 * @param options 请求选项(包含 method, headers, body, signal 等) * @returns 返回 Response 对象或 Promise */ export declare type CustomFetch = (url: string, options: { method: string; headers: Record; body: string; signal?: AbortSignal; }) => Promise | Response; declare type CustomParams = CustomErrorParams & { fatal?: boolean; }; declare function datetimeRegex(args: { precision?: number | null; offset?: boolean; local?: boolean; }): RegExp; declare const dateType: (params?: RawCreateParams & { coerce?: boolean; }) => ZodDate; export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures; 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; declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; declare const effectsType: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; export declare const emitter: EventEmitter; 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>; {}; } declare type EnumValues = readonly [T, ...T[]]; declare const errorMap: ZodErrorMap; declare type ErrorMapCtx = { defaultError: string; data: any; }; declare type ErrorMessages = Partial>; declare namespace errorUtil { type ErrMessage = string | { message?: string | undefined; }; const errToObj: (message?: ErrMessage) => { message?: string | undefined; }; const toString: (message?: ErrMessage) => string | undefined; } export declare class EventEmitter { private events; constructor(); /** * @param {string} eventName - 事件名 * @param {Function} callback - 回调函数 * @param {boolean} [once=false] - 是否只触发一次 */ on(eventName: string, callback: Function, once?: boolean): void; /** * @param {string} eventName - 事件名 * @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用) */ off(eventName: string, callback: Function): void; /** * @param {string} eventName - 事件名 * @param {...any} args - 传递给回调的参数 */ emit(eventName: string, ...args: any[]): void; /** * @param {string} eventName - 事件名 * @param {Function} callback - 回调函数 */ once(eventName: string, callback: Function): void; } declare interface FileMeta { name: string; type: string; size: number; lastModified: number; base64: string; } declare type FilterEnum = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum : [Head, ...FilterEnum] : never; declare const functionType: typeof ZodFunction.create; export declare const GENUI_CONFIG: unique symbol; export declare const GENUI_I18N: unique symbol; export declare const GENUI_RENDERER: unique symbol; export declare const GenuiChat: __VLS_WithTemplateSlots; declare function getErrorMap(): ZodErrorMap; declare const getParsedType: (data: any) => ZodParsedType; export declare interface I18nInstance { locale: Ref; messages: Readonly>>; setLocale: (lang: string) => void; mergeMessages: (newMessages: I18nMessages, isCoverSameKey?: boolean) => void; t: (key: string, params?: I18nTranslateParams) => string; } export declare type I18nMessageObject = { [key: string]: string | I18nMessageObject; }; export declare type I18nMessages = { [lang: string]: I18nMessageObject; }; export declare interface I18nOptions { locale?: string; messages?: I18nMessages; } export declare type I18nTranslateParams = { [key: string]: string | number | boolean; }; export declare interface IBubbleSlotsProps { index: number; bubbleProps: BubbleProps; isFinished: boolean; messageManager: UseMessageReturn_2; chatMessage: IChatMessage; } export declare interface IChatConfig { addToolCallContext?: boolean; showThinkingResult?: boolean; } /** * 单轮对话中的消息对象 */ declare interface IChatMessage { role: 'assistant'; content: string; messages: IMessageItem_2[]; [customKey: string]: any; } export declare interface IChatProps { url?: string; model?: string; temperature?: number; messages?: IMessage[]; chatConfig?: IChatConfig; requiredCompleteFieldSelectors?: string[]; customComponents?: ICustomComponentItem[]; customSnippets?: IGenPromptSnippet[]; customExamples?: IGenPromptExample[]; customActions?: ICustomActionItem[]; rendererSlots?: IRendererSlots; thinkComponent?: Component; roles?: IRolesConfig; features?: ModelCapability; customFetch?: CustomFetch; } /** * 单次流式响应中的一条 choice(与 OpenAI chat.completion.chunk 对齐) */ declare interface IChatStreamChoice { index: number; delta?: IStreamDelta; finish_reason?: string | null; } export declare interface ICustomActionItem extends IGenPromptAction { execute: (params: any, context: Record) => void; } export declare interface ICustomComponentItem extends IGenPromptComponent { ref: Component; } declare interface IFunctionInfo { params: IFunctionParam[]; returns: Record; } declare interface IFunctionParam { name: string; type: string; defaultValue: string; description: II18nText; } declare interface IGenPromptAction { name: string; description?: string; parameters?: JsonSchema7Type; } declare interface IGenPromptComponent { component: string; schema: IGenPromptComponentSchema; name?: string; description?: string; } declare interface IGenPromptComponentEvent { type: string; functionInfo?: IFunctionInfo; defaultValue?: string; description: string; } declare interface IGenPromptComponentProperty { property: string; description: string; type: string; required?: boolean; defaultValue?: any; properties?: IGenPromptComponentProperty[]; } declare interface IGenPromptComponentSchema { properties?: IGenPromptComponentProperty[]; events?: IGenPromptComponentEvent[]; slots?: Record; } declare interface IGenPromptExample { id?: string; name: string; description?: string; schema: CardSchema; } declare type IGenPromptSnippet = NodeSchema; declare interface II18nText { zh_CN: string; [key: string]: string; } export declare interface ImageFeatures { enabled: boolean; maxImageSize: number; maxFilesPerRequest: number; supportedFileTypes: string[]; } declare interface IMarkdownMessageItem { type: 'markdown'; content: string; } export declare interface IMessage { role: 'user' | 'assistant'; content: string; messages?: IMessageItem[]; } export declare interface IMessageItem { type: string; content: string; [customKey: string]: any; } /** * 消息项类型 */ declare type IMessageItem_2 = IMarkdownMessageItem | ISchemaCardMessageItem | IToolMessageItem | IReasoningMessageItem; export declare class IndexedDBStrategy implements ConversationStorageStrategy { private dbName; private storeName; private dataKey; private db; constructor(dbName?: string, storeName?: string, dataKey?: string); private openDB; saveConversations(conversations: Conversation[]): Promise; loadConversations(): Promise; } declare type Indices = Exclude; declare type inferFlattenedErrors, U = string> = typeToFlattenedError, U>; declare type inferFormattedError, U = string> = ZodFormattedError, U>; declare type InnerTypeOfFunction, Returns extends ZodTypeAny> = Args["_output"] extends Array ? (...args: Args["_output"]) => Returns["_input"] : never; /** * 通知事件发射器类型,专门用于处理 'notification' 事件 */ export declare interface INotificationEventEmitter { on(eventName: 'notification', callback: (payload: INotificationPayload) => void, once?: boolean): void; off(eventName: 'notification', callback: (payload: INotificationPayload) => void): void; emit(eventName: 'notification', payload: INotificationPayload): void; once(eventName: 'notification', callback: (payload: INotificationPayload) => void): void; } /** * 流式通知事件负载,包含事件类型、增量数据和完整的消息对象 */ declare type INotificationPayload = { type: 'markdown' | 'schema-card' | 'done'; delta: IStreamDelta; chatMessage: IChatMessage; } | { type: 'tool'; delta: IStreamDelta; chatMessage: IChatMessage; toolCallData: IMessageItem_2 & { type: 'tool'; }; }; 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 interface IReasoningMessageItem { type: 'reasoning'; content: string; thinking?: boolean; } declare interface IRendererProps { content: string | { [prop: string]: any; }; generating?: boolean; isJsonComplete?: boolean; customComponents?: Record; customActions?: any; requiredCompleteFieldSelectors?: string[]; id?: string; state?: Record; } declare interface IRendererSlots { header?: Component | ((props: IRendererSlotsProps) => VNode | VNode[]); footer?: Component | ((props: IRendererSlotsProps) => VNode | VNode[]); } declare interface IRendererSlotsProps { schema: CardSchema; isError: boolean; isFinished: boolean; } declare interface IResponseHandler { name: string; match: (data: T, context: any) => boolean; handler: (data: T, context: any) => boolean; notMatchHandler?: (data: T, context: any) => boolean; start?: (context: any, handlers: { onData: (data: IChatMessage) => void; onDone: () => void; onError: (error: Error) => void; }) => void; end?: (context: any) => void; } export declare interface IRolesConfig { user: Partial; assistant: Partial; } declare const isAborted: (x: ParseReturnType) => x is INVALID; declare const isAsync: (x: ParseReturnType) => x is AsyncParseReturnType; declare interface ISchemaCardMessageItem { type: 'schema-card'; content: string; id?: string; state?: Record; } declare const isDirty: (x: ParseReturnType) => x is OK | DIRTY; declare type ISlotProps = any; declare type IssueData = stripPath & { path?: (string | number)[]; fatal?: boolean | undefined; }; /** * 单次 SSE data 行解析后的完整负载(含 id、model、choices 等顶层字段) */ declare interface IStreamData { id?: string; object?: string; model?: string; type?: string; created?: number; choices?: IChatStreamChoice[]; usage?: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number; }; } /** * 流式响应的增量数据 */ declare interface IStreamDelta { reasoning_content?: string; content?: string; tool_calls?: Array<{ id: string; function: { name: string; arguments: string; }; }>; tool_calls_result?: Array<{ id: string; function: { arguments: any; result: any; }; }>; } declare const isValid: (x: ParseReturnType) => x is OK; export declare interface IThinkComponentProps { emitter: INotificationEventEmitter; message: IMessage; showThinkingResult: boolean; } declare interface IToolMessageItem { type: 'tool'; name: string; formatPretty?: boolean; status: 'running' | 'success' | 'failed' | 'cancelled'; content: string; id?: string; } declare type JSFunction = { type: 'JSFunction'; value: string; params?: string[]; }; declare type JsonSchema7AllOfType = { allOf: JsonSchema7Type[]; unevaluatedProperties?: boolean; }; declare type JsonSchema7AnyOfType = { anyOf: JsonSchema7Type[]; }; declare type JsonSchema7AnyType = { $ref?: string; }; declare type JsonSchema7ArrayType = { type: "array"; items?: JsonSchema7Type; minItems?: number; maxItems?: number; errorMessages?: ErrorMessages; }; declare type JsonSchema7BigintType = { type: "integer"; format: "int64"; minimum?: BigInt; exclusiveMinimum?: BigInt; maximum?: BigInt; exclusiveMaximum?: BigInt; multipleOf?: BigInt; errorMessage?: ErrorMessages; }; declare type JsonSchema7BooleanType = { type: "boolean"; }; declare type JsonSchema7DateType = { type: "integer" | "string"; format: "unix-time" | "date-time" | "date"; minimum?: number; maximum?: number; errorMessage?: ErrorMessages; } | { anyOf: JsonSchema7DateType[]; }; declare type JsonSchema7EnumType = { type: "string"; enum: string[]; }; declare type JsonSchema7LiteralType = { type: "string" | "number" | "integer" | "boolean"; const: string | number | boolean; } | { type: "object" | "array"; }; declare type JsonSchema7MapType = { type: "array"; maxItems: 125; items: { type: "array"; items: [JsonSchema7Type, JsonSchema7Type]; minItems: 2; maxItems: 2; }; }; declare type JsonSchema7Meta = { title?: string; default?: any; description?: string; markdownDescription?: string; }; declare type JsonSchema7NativeEnumType = { type: "string" | "number" | ["string", "number"]; enum: (string | number)[]; }; declare type JsonSchema7NeverType = { not: JsonSchema7AnyType; }; declare type JsonSchema7NullableType = { anyOf: [JsonSchema7Type, JsonSchema7NullType]; } | { type: [string, "null"]; }; declare type JsonSchema7NullType = { type: "null"; }; declare type JsonSchema7NumberType = { type: "number" | "integer"; minimum?: number; exclusiveMinimum?: number; maximum?: number; exclusiveMaximum?: number; multipleOf?: number; errorMessage?: ErrorMessages; }; declare type JsonSchema7ObjectType = { type: "object"; properties: Record; additionalProperties?: boolean | JsonSchema7Type; required?: string[]; }; declare type JsonSchema7Primitive = (typeof primitiveMappings)[keyof typeof primitiveMappings]; declare type JsonSchema7PrimitiveUnionType = { type: JsonSchema7Primitive | JsonSchema7Primitive[]; } | { type: JsonSchema7Primitive | JsonSchema7Primitive[]; enum: (string | number | bigint | boolean | null)[]; }; declare type JsonSchema7RecordPropertyNamesType = Omit | Omit; declare type JsonSchema7RecordType = { type: "object"; additionalProperties?: JsonSchema7Type | true; propertyNames?: JsonSchema7RecordPropertyNamesType; }; declare type JsonSchema7RefType = { $ref: string; }; declare type JsonSchema7SetType = { type: "array"; uniqueItems: true; items?: JsonSchema7Type; minItems?: number; maxItems?: number; errorMessage?: ErrorMessages; }; declare type JsonSchema7StringType = { type: "string"; minLength?: number; maxLength?: number; format?: "email" | "idn-email" | "uri" | "uuid" | "date-time" | "ipv4" | "ipv6" | "date" | "time" | "duration"; pattern?: string; allOf?: { pattern: string; errorMessage?: ErrorMessages<{ pattern: string; }>; }[]; anyOf?: { format: string; errorMessage?: ErrorMessages<{ format: string; }>; }[]; errorMessage?: ErrorMessages; contentEncoding?: string; }; declare type JsonSchema7TupleType = { type: "array"; minItems: number; items: JsonSchema7Type[]; } & ({ maxItems: number; } | { additionalItems?: JsonSchema7Type; }); declare type JsonSchema7Type = JsonSchema7TypeUnion & JsonSchema7Meta; declare type JsonSchema7TypeUnion = JsonSchema7StringType | JsonSchema7ArrayType | JsonSchema7NumberType | JsonSchema7BigintType | JsonSchema7BooleanType | JsonSchema7DateType | JsonSchema7EnumType | JsonSchema7LiteralType | JsonSchema7NativeEnumType | JsonSchema7NullType | JsonSchema7NumberType | JsonSchema7ObjectType | JsonSchema7RecordType | JsonSchema7TupleType | JsonSchema7UnionType | JsonSchema7UndefinedType | JsonSchema7RefType | JsonSchema7NeverType | JsonSchema7MapType | JsonSchema7AnyType | JsonSchema7NullableType | JsonSchema7AllOfType | JsonSchema7UnknownType | JsonSchema7SetType; declare type JsonSchema7UndefinedType = { not: JsonSchema7AnyType; }; declare type JsonSchema7UnionType = JsonSchema7PrimitiveUnionType | JsonSchema7AnyOfType; declare type JsonSchema7UnknownType = JsonSchema7AnyType; 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 type mergeTypes = { [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never; }; export declare class MessageManager { messageManagerMap: Map; conversationState: Reactive; options: UseMessageOptions; constructor(conversationState: Reactive, options: UseMessageOptions); getMessageManager(conversationId: string): UseMessageReturn; setMessageManager(id: string, options?: UseMessageOptions): UseMessageReturn; deleteMessageManager(id: string): void; } declare type Methods = Record; export declare interface ModelCapability { supportImage?: ImageFeatures; supportFunctionCalling?: boolean; [key: string]: any; } export declare interface ModelFeatures { supportImage?: boolean | ImageFeatures; supportFunctionCalling?: boolean; [key: string]: any; } export declare interface ModelInfo { name: string; features?: ModelFeatures; } 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 interface Node_2 { id?: string; componentName: string; props?: Record & { columns?: { slots?: Record; }[]; }; children?: Node_2[]; componentType?: 'Block' | 'PageStart' | 'PageSection'; slot?: string | Record; params?: string[]; loop?: Record; loopArgs?: string[]; condition?: boolean | Record; } declare type NodeSchema = z.infer; declare const nodeSchema: z.ZodType; 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]; }; {}; } 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 const primitiveMappings: { readonly ZodString: "string"; readonly ZodNumber: "number"; readonly ZodBigInt: "integer"; readonly ZodBoolean: "boolean"; readonly ZodNull: "null"; }; declare type ProcessedCreateParams = { errorMap?: ZodErrorMap | undefined; description?: string | undefined; }; declare const promiseType: (schema: Inner, params?: RawCreateParams) => ZodPromise; declare interface Props { templateData?: UserItem[]; attachments?: FileMeta[]; } 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 RootNode = Omit & { id?: string; css?: string; fileName?: string; methods?: Methods; state?: Record; lifeCycles?: Record; children?: Node_2[]; dataSource?: any; bridge?: any; inputs?: any[]; outputs?: any[]; schema?: 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[]; export declare const scrollEnd: (container: Ref) => { scrollToBottom: () => void; scrollToBottomWithRetry: (maxRetries?: number, retryDelay?: number) => void; autoScrollToBottom: () => void; isLastMessageInBottom: Ref; updateIsLastMessageInBottom: () => void; }; 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"]; {}; } 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; declare type SuperRefinement = (arg: T, ctx: RefinementCtx) => void | Promise; declare const symbolType: (params?: RawCreateParams) => ZodSymbol; declare type SyncParseReturnType = OK | DIRTY | INVALID; export declare class ThinkTagWrapPattern { protected thinkStartFlag: string; protected thinkEndFlag: string; protected startRegex: RegExp; protected endRegex: RegExp; protected partialStartRegex: RegExp; protected partialEndRegex: RegExp; get regExpMap(): { start: { full: RegExp; partial: RegExp; }; end: { full: RegExp; partial: RegExp; }; }; } export declare function throttle any>(fn: T, delay: number): (...args: Parameters) => void; export declare const toSlotFunction: (slot: Component | ((props: ISlotProps) => VNode | VNode[]) | undefined) => (props: ISlotProps) => VNode | VNode[]; 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; /** * useConversation composable * 提供会话管理和持久化功能 * * @param options useConversation选项 * @returns UseConversationReturn */ export declare function useConversation(options: UseConversationOptions): UseConversationReturn; /** * useConversation返回值接口 */ export declare interface UseConversationReturn { /** 会话状态 */ state: ConversationState; /** 消息管理 */ messageManager: ComputedRef; /** 创建新会话 */ createConversation: (title?: string, metadata?: Record) => string; /** 切换会话 */ switchConversation: (id: string) => void; /** 删除会话 */ deleteConversation: (id: string) => void; /** 更新会话标题 */ updateTitle: (id: string, title: string) => void; /** 更新会话元数据 */ updateMetadata: (id: string, metadata: Record) => void; /** 保存会话 */ saveConversations: () => Promise; /** 加载会话 */ loadConversations: () => Promise; /** 生成会话标题 */ generateTitle: (id: string) => Promise; /** 获取当前会话 */ getCurrentConversation: () => Conversation | null; } export declare const useI18n: () => I18nInstance; export declare function useMessage(options: UseMessageOptions): UseMessageReturn; /** * useMessage选项接口 */ export declare interface UseMessageOptions { /** AI客户端实例 */ client: AIClient; /** 消息ID */ conversationId: string; /** 是否默认使用流式响应 */ useStreamByDefault?: boolean; /** 错误消息模板 */ errorMessage?: string; /** 初始消息列表 */ initialMessages?: ChatMessage[]; events?: { onReceiveData?: (data: T, messages: Ref, preventDefault: () => void) => void; onFinish?: (finishReason: string | undefined, context: { messages: Ref; messageState: Reactive; }, preventDefault: () => void) => void; }; } /** * useMessage返回值接口 */ export declare interface UseMessageReturn { /** 消息ID */ conversationId: string; /** 消息列表 */ messages: Ref; /** 消息状态 */ messageState: Reactive; /** 输入消息 */ inputMessage: Ref; /** 是否使用流式响应 */ useStream: Ref; /** 发送消息 */ sendMessage: (content?: ChatMessage['content'], clearInput?: boolean) => Promise; /** 手动执行addMessage添加消息后,可以执行send发送消息 */ send: () => Promise; /** 清空消息 */ clearMessages: () => void; /** 添加消息 */ addMessage: (message: ChatMessage | ChatMessage[]) => void; /** 中止请求 */ abortRequest: () => void; /** 重试请求 */ retryRequest: (msgIndex: number) => Promise; } 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; {}; } declare type Values = { [k in T[number]]: k; }; declare const voidType: (params?: RawCreateParams) => ZodVoid; 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 { }