zod
Version:
Typescript-first schema declaration and validation library with static type inference
16 lines (15 loc) • 594 B
TypeScript
import * as z from './base';
import { ZodUndefined } from './undefined';
import { ZodNull } from './null';
import { ZodUnion } from './union';
export interface ZodLazyDef<T extends z.ZodAny = z.ZodAny> extends z.ZodTypeDef {
t: z.ZodTypes.lazy;
getter: () => T;
}
export declare class ZodLazy<T extends z.ZodAny> extends z.ZodType<z.TypeOf<T>, ZodLazyDef<T>> {
get schema(): T;
optional: () => ZodUnion<[this, ZodUndefined]>;
nullable: () => ZodUnion<[this, ZodNull]>;
toJSON: () => never;
static create: <T_1 extends z.ZodAny>(getter: () => T_1) => ZodLazy<T_1>;
}