dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
8 lines (7 loc) • 750 B
TypeScript
import type { ZodTuple, ZodTypeAny } from 'zod';
import type { TupleSchema, TupleSchema_ } from '../../../index.js';
import type { SchemaProps } from '../../../schema/types/schemaProps.js';
import type { FromZodSchemaRec } from './fromZodSchema.js';
export type ZodTupleAny = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]], ZodTypeAny | null>;
export type FromZodTuple<ZOD_SCHEMA extends ZodTupleAny, ROOT extends boolean = true, PROPS extends SchemaProps = {}> = ZOD_SCHEMA extends ZodTuple<infer ELEMENT_ZOD_SCHEMAS> ? ROOT extends true ? TupleSchema_<FromZodSchemaRec<ELEMENT_ZOD_SCHEMAS, false>, PROPS> : TupleSchema<FromZodSchemaRec<ELEMENT_ZOD_SCHEMAS, false>, PROPS> : never;
export declare const fromZodTuple: (zodTuple: ZodTupleAny) => TupleSchema;