zod
Version:
Typescript-first schema declaration and validation library with static type inference
18 lines (17 loc) • 735 B
TypeScript
import * as z from './base';
import { ZodUnion } from './union';
import { ZodUndefined } from './undefined';
import { ZodNull } from './null';
export interface ZodTupleDef<T extends [z.ZodAny, ...z.ZodAny[]] | [] = [z.ZodAny, ...z.ZodAny[]]> extends z.ZodTypeDef {
t: z.ZodTypes.tuple;
items: T;
}
export declare class ZodTuple<T extends [z.ZodAny, ...z.ZodAny[]] | [] = [z.ZodAny, ...z.ZodAny[]]> extends z.ZodType<z.TypeOfTuple<T>, ZodTupleDef<T>> {
toJSON: () => {
t: z.ZodTypes.tuple;
items: any[];
};
optional: () => ZodUnion<[this, ZodUndefined]>;
nullable: () => ZodUnion<[this, ZodNull]>;
static create: <T_1 extends [] | [z.ZodAny, ...z.ZodAny[]]>(schemas: T_1) => ZodTuple<T_1>;
}