zod
Version:
Typescript-first schema declaration and validation library with static type inference
30 lines (29 loc) • 1.09 kB
TypeScript
import * as z from './base';
import { ZodUndefined } from './undefined';
import { ZodNull } from './null';
import { ZodUnion } from './union';
export interface ZodArrayDef<T extends z.ZodAny = z.ZodAny> extends z.ZodTypeDef {
t: z.ZodTypes.array;
type: T;
nonempty: boolean;
}
export declare class ZodArray<T extends z.ZodAny> extends z.ZodType<T['_type'][], ZodArrayDef<T>> {
toJSON: () => {
t: z.ZodTypes.array;
nonempty: boolean;
type: object;
};
optional: () => ZodUnion<[this, ZodUndefined]>;
nullable: () => ZodUnion<[this, ZodNull]>;
nonempty: () => ZodNonEmptyArray<T>;
static create: <T_1 extends z.ZodAny>(schema: T_1) => ZodArray<T_1>;
}
export declare class ZodNonEmptyArray<T extends z.ZodAny> extends z.ZodType<[T['_type'], ...T['_type'][]], ZodArrayDef<T>> {
toJSON: () => {
t: z.ZodTypes.array;
type: object;
};
optional: () => ZodUnion<[this, ZodUndefined]>;
nullable: () => ZodUnion<[this, ZodNull]>;
static create: <T_1 extends z.ZodAny>(schema: T_1) => ZodArray<T_1>;
}