import { type Type } from "./type.js"; interface OptionalSchemaMarker { readonly _optional: true; } interface RefineOptions { message?: string; error?: string; } export interface SuperRefineIssue { code?: string; path?: PropertyKey[]; message: string; actual?: unknown; } export interface SuperRefineContext { addIssue(issue: SuperRefineIssue): void; } export interface ZodLikeIssue { path: PropertyKey[]; message: string; } export type ZodLikeSafeParseResult = { success: true; data: Out; } | { success: false; error: { message: string; issues: ZodLikeIssue[]; }; }; /** A callable omptype schema carrying the Zod-v4-style fluent surface. */ export interface ZodLikeSchema extends Type { readonly _output: Out; /** @internal Used while composing object property IR. */ readonly isOptional: boolean; parse(value: unknown): Out; safeParse(value: unknown): ZodLikeSafeParseResult; min(bound: number): ZodLikeSchema; max(bound: number): ZodLikeSchema; int(): ZodLikeSchema; positive(): ZodLikeSchema; nonnegative(): ZodLikeSchema; regex(expression: RegExp, message?: string): ZodLikeSchema; url(): ZodLikeSchema; optional(): ZodLikeSchema & OptionalSchemaMarker; nullable(): ZodLikeSchema; default(value: Exclude | (() => Exclude)): ZodLikeSchema>; describe(description: string): ZodLikeSchema; refine(predicate: (value: Out) => unknown, messageOrOptions?: string | RefineOptions): ZodLikeSchema; superRefine(refinement: (value: Out, ctx: SuperRefineContext) => void): ZodLikeSchema; trim(): ZodLikeSchema; transform(transformer: (value: Out) => Next): ZodLikeSchema; catch(fallback: Out | (() => Out)): ZodLikeSchema; strict(): ZodLikeSchema; passthrough(): ZodLikeSchema>; strip(): ZodLikeSchema; partial(): Out extends object ? ZodLikeSchema> : ZodLikeSchema; } export type infer = T extends { readonly _output: infer Out; } ? Out : never; type SchemaOutput = Schema extends { readonly _output: infer Out; } ? Out : never; type Shape = Readonly>>; type ObjectOutput = { -readonly [K in keyof S as S[K] extends OptionalSchemaMarker ? never : K]: SchemaOutput; } & { -readonly [K in keyof S as S[K] extends OptionalSchemaMarker ? K : never]?: SchemaOutput; }; type Simplify = { [K in keyof T]: T[K]; }; type UnionOutput[]> = SchemaOutput; export declare const string: () => ZodLikeSchema; export declare const number: () => ZodLikeSchema; export declare const boolean: () => ZodLikeSchema; export declare const literal: (value: Value) => ZodLikeSchema; declare const enumSchema: (values: Values) => ZodLikeSchema; export { enumSchema as enum }; export declare const union: , ZodLikeSchema, ...ZodLikeSchema[]]>(schemas: Schemas) => ZodLikeSchema>; export declare const array: (element: ZodLikeSchema) => ZodLikeSchema; export declare const object: (shape: S) => ZodLikeSchema>>; export declare function record(keySchema: ZodLikeSchema, valueSchema: ZodLikeSchema): ZodLikeSchema>; export declare function record(valueSchema: ZodLikeSchema): ZodLikeSchema>; export declare const unknown: () => ZodLikeSchema; export declare const any: () => ZodLikeSchema; declare const nullSchema: () => ZodLikeSchema; declare const undefinedSchema: () => ZodLikeSchema; export { nullSchema as null, undefinedSchema as undefined }; /** Runtime `z.*` facade, merged with the `z.infer` type namespace below. */ export declare const z: { string: typeof string; number: typeof number; boolean: typeof boolean; literal: typeof literal; enum: typeof enumSchema; union: typeof union; array: typeof array; object: typeof object; record: typeof record; unknown: typeof unknown; any: typeof any; null: typeof nullSchema; undefined: typeof undefinedSchema; }; export declare namespace z { type infer = Schema extends { readonly _output: infer Out; } ? Out : never; }