import { z } from 'zod/v4'; import type { ZodObject, ZodRawShape, ZodType } from 'zod/v4'; import type { $ZodArray, $ZodBigInt, $ZodBoolean, $ZodCatch, $ZodDate, $ZodDefault, $ZodEnum, $ZodIntersection, $ZodLazy, $ZodLiteral, $ZodNever, $ZodNonOptional, $ZodNullable, $ZodNumber, $ZodObject, $ZodOptional, $ZodPipe, $ZodPrefault, $ZodReadonly, $ZodRecord, $ZodString, $ZodTransform, $ZodTuple, $ZodType, $ZodTypes, $ZodUndefined, $ZodUnion, $ZodVoid } from 'zod/v4/core'; /** * Maps each schema kind to the concrete zod type carrying its definition. * `instanceofZodTypeKind` narrows with this map, so `_zod.def` can be read * without casting to `any`. */ interface ZodKindMap { array: $ZodArray; bigint: $ZodBigInt; boolean: $ZodBoolean; catch: $ZodCatch; date: $ZodDate; default: $ZodDefault; enum: $ZodEnum; intersection: $ZodIntersection; lazy: $ZodLazy; literal: $ZodLiteral; never: $ZodNever; nonoptional: $ZodNonOptional; nullable: $ZodNullable; number: $ZodNumber; object: $ZodObject; optional: $ZodOptional; pipe: $ZodPipe; prefault: $ZodPrefault; readonly: $ZodReadonly; record: $ZodRecord; string: $ZodString; transform: $ZodTransform; tuple: $ZodTuple; undefined: $ZodUndefined; union: $ZodUnion; void: $ZodVoid; } /** * Whether `type` is a zod schema. The library consumes classic zod schemas, * which is what `zod/v4` exports; the check inspects the shared core marker. */ export declare const instanceofZodType: (type: unknown) => type is ZodType; export declare const instanceofZodTypeKind: (type: $ZodType, zodTypeKind: K) => type is ZodKindMap[K]; export declare const instanceofZodTypeOptional: (type: $ZodType) => type is z.ZodOptional<$ZodTypes>; export declare const instanceofZodTypeObject: (type: $ZodType) => type is z.ZodObject; export type ZodTypeLikeVoid = z.ZodVoid | z.ZodUndefined | z.ZodNever; export declare const instanceofZodTypeLikeVoid: (type: $ZodType) => type is ZodTypeLikeVoid; /** * Returns the classic `ZodType` view of an unwrapped schema. The library only * accepts classic zod schemas (the imports come from `zod/v4`), so this is a * boundary cast; internally the walker stays on the core `$ZodType` types. */ export declare const unwrapZodType: (type: $ZodType, unwrapPreprocess: boolean) => ZodType; export declare const instanceofZodTypeLikeString: (_type: $ZodType) => boolean; export declare const zodSupportsCoerce: boolean; export type ZodTypeCoercible = z.ZodNumber | z.ZodBoolean | z.ZodBigInt | z.ZodDate; export declare const instanceofZodTypeCoercible: (_type: $ZodType) => _type is ZodTypeCoercible; /** * @deprecated The adapters call `coerceInput` instead. This sets zod's `coerce` flag on the schema, * which changes it for every later parse, and zod's coercion also converts values that are not * strings, such as `null` to `0`. */ export declare const coerceSchema: (schema: ZodObject) => void; /** * The schema that first receives a procedure's input: through `optional` and similar wrappers, and * through a pipe to its input side when that is an object, as for `z.object(...).transform(...)`. * For `z.preprocess`, whose input side is a function, it is the schema after the function. */ export declare const unwrapZodInputSide: (schema: $ZodType) => $ZodType; export type CoercionMode = 'query' | 'body'; /** * Converts each string in a procedure's `input` that `schema` expects to be a number, boolean, * bigint or date, because query and path parameters always arrive as strings, and each safe integer * that it expects to be a bigint. Any other value, such as `null` or `true` in a JSON body, is left * for the schema to validate, and so is a field declared with `z.coerce`. Objects and arrays are * copied rather than changed, and the schema is not changed. * * `mode` selects the URL-parameter grammar (`query`, the default) or the looser JSON-body grammar, * which keeps the conversions JSON clients had before the strict rules were introduced. */ export declare const coerceInput: (schema: $ZodType, input: unknown, mode?: CoercionMode) => unknown; export {}; //# sourceMappingURL=zod.d.ts.map