zod
Version:
Typescript-first schema declaration and validation library with static type inference
20 lines (19 loc) • 799 B
TypeScript
import * as z from './base';
import { ZodUndefined } from './undefined';
import { ZodNull } from './null';
import { ZodUnion } from './union';
export interface ZodIntersectionDef<T extends z.ZodAny = z.ZodAny, U extends z.ZodAny = z.ZodAny> extends z.ZodTypeDef {
t: z.ZodTypes.intersection;
left: T;
right: U;
}
export declare class ZodIntersection<T extends z.ZodAny, U extends z.ZodAny> extends z.ZodType<T['_type'] & U['_type'], ZodIntersectionDef<T, U>> {
optional: () => ZodUnion<[this, ZodUndefined]>;
nullable: () => ZodUnion<[this, ZodNull]>;
toJSON: () => {
t: z.ZodTypes.intersection;
left: object;
right: object;
};
static create: <T_1 extends z.ZodAny, U_1 extends z.ZodAny>(left: T_1, right: U_1) => ZodIntersection<T_1, U_1>;
}