bupkis
    Preparing search index...

    Interface ZodTuple<T, Rest>

    interface ZodTuple<
        T extends TupleItems = readonly z.core.$ZodType[],
        Rest extends SomeType | null = z.core.$ZodType | null,
    > {
        def: $ZodTupleDef<T, Rest>;
        type: "tuple";
        _def: $ZodTupleDef<T, Rest>;
        _output: [
            ...TupleOutputTypeWithOptionals<T>[],
            ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
        ];
        _input: [
            ...TupleInputTypeWithOptionals<T>[],
            ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
        ];
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<
            ZodSafeParseResult<
                [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            >,
        >;
        description?: string;
        _zod: $ZodTupleInternals;
        "~standard": $ZodStandardSchema<z.ZodTuple<T, Rest>>;
        rest<
            Rest extends
                SomeType = z.core.$ZodType<
                unknown,
                unknown,
                $ZodTypeInternals<unknown, unknown>,
            >,
        >(
            rest: Rest,
        ): z.ZodTuple<T, Rest>;
        check(
            ...checks: (
                | CheckFn<
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                >
                | z.core.$ZodCheck<
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                >
            )[],
        ): this;
        clone(def?: $ZodTupleDef<T, Rest>, params?: { parent: boolean }): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    z.core.$ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: z.ZodTuple<T, Rest> extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & z.ZodTuple<T, Rest>>?]
                    : [$replace<R["_meta"], R["_schema"] & z.ZodTuple<T, Rest>>]
                : ["Incompatible schema"],
        ): this;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T
            ? z.ZodTuple<T, Rest>
            : $ZodBranded<z.ZodTuple<T, Rest>, T>;
        parse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): [
            ...TupleOutputTypeWithOptionals<T>[],
            ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
        ];
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<
            [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        >;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        >;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            ZodSafeParseResult<
                [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            >,
        >;
        encode(
            data: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): [
            ...TupleInputTypeWithOptionals<T>[],
            ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
        ];
        decode(
            data: [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): [
            ...TupleOutputTypeWithOptionals<T>[],
            ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
        ];
        encodeAsync(
            data: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
        >;
        decodeAsync(
            data: [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        >;
        safeEncode(
            data: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<
            [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
        >;
        safeDecode(
            data: [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<
            [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        >;
        safeEncodeAsync(
            data: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            ZodSafeParseResult<
                [
                    ...TupleInputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
                ],
            >,
        >;
        safeDecodeAsync(
            data: [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
            params?: ParseContext<$ZodIssue>,
        ): Promise<
            ZodSafeParseResult<
                [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            >,
        >;
        refine(
            check: (
                arg: [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            ) => unknown,
            params?:
                | string
                | {
                    abort?: boolean;
                    when?: (payload: ParsePayload) => boolean;
                    path?: PropertyKey[];
                    params?: Record<string, any>;
                    error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
                    message?: string;
                },
        ): this;
        superRefine(
            refinement: (
                arg: [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
                ctx: $RefinementCtx<
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                >,
            ) => void | Promise<void>,
        ): this;
        overwrite(
            fn: (
                x: [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            ) => [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        ): this;
        optional(): z.ZodOptional<z.ZodTuple<T, Rest>>;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): z.ZodNonOptional<z.ZodTuple<T, Rest>>;
        nullable(): z.ZodNullable<z.ZodTuple<T, Rest>>;
        nullish(): z.ZodOptional<z.ZodNullable<z.ZodTuple<T, Rest>>>;
        default(
            def: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        ): z.ZodDefault<z.ZodTuple<T, Rest>>;
        default(
            def: () => NoUndefined<
                [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            >,
        ): z.ZodDefault<z.ZodTuple<T, Rest>>;
        prefault(
            def: () => [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
        ): z.ZodPrefault<z.ZodTuple<T, Rest>>;
        prefault(
            def: [
                ...TupleInputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
            ],
        ): z.ZodPrefault<z.ZodTuple<T, Rest>>;
        array(): z.ZodArray<z.ZodTuple<T, Rest>>;
        or<T extends SomeType>(option: T): z.ZodUnion<[z.ZodTuple<T, Rest>, T]>;
        and<T extends SomeType>(
            incoming: T,
        ): z.ZodIntersection<z.ZodTuple<T, Rest>, T>;
        transform<NewOut>(
            transform: (
                arg: [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
                ctx: $RefinementCtx<
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                >,
            ) => NewOut | Promise<NewOut>,
        ): z.ZodPipe<
            z.ZodTuple<T, Rest>,
            z.ZodTransform<
                Awaited<NewOut>,
                [
                    ...TupleOutputTypeWithOptionals<T>[],
                    ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                ],
            >,
        >;
        catch(
            def: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        ): z.ZodCatch<z.ZodTuple<T, Rest>>;
        catch(
            def: (
                ctx: $ZodCatchCtx,
            ) => [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        ): z.ZodCatch<z.ZodTuple<T, Rest>>;
        pipe<
            T extends
                z.core.$ZodType<
                    any,
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                    $ZodTypeInternals<
                        any,
                        [
                            ...TupleOutputTypeWithOptionals<T>[],
                            ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                        ],
                    >,
                >,
        >(
            target:
                | T
                | z.core.$ZodType<
                    any,
                    [
                        ...TupleOutputTypeWithOptionals<T>[],
                        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                    ],
                    $ZodTypeInternals<
                        any,
                        [
                            ...TupleOutputTypeWithOptionals<T>[],
                            ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
                        ],
                    >,
                >,
        ): z.ZodPipe<z.ZodTuple<T, Rest>, T>;
        readonly(): z.ZodReadonly<z.ZodTuple<T, Rest>>;
        describe(description: string): this;
        meta(): | undefined
        | {
            id?: string;
            title?: string;
            description?: string;
            deprecated?: boolean;
            [key: string]: unknown;
        };
        meta(
            data: {
                id?: string;
                title?: string;
                description?: string;
                deprecated?: boolean;
                [key: string]: unknown;
            },
        ): this;
        isOptional(): boolean;
        isNullable(): boolean;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    type: "tuple"

    Use .def instead.

    _output: [
        ...TupleOutputTypeWithOptionals<T>[],
        ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
    ]

    Use z.output<typeof schema> instead.

    _input: [
        ...TupleInputTypeWithOptionals<T>[],
        ...(Rest extends SomeType ? z.core.input<Rest<Rest>>[] : [])[],
    ]

    Use z.input<typeof schema> instead.

    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<
        ZodSafeParseResult<
            [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        >,
    >
    description?: string

    Methods

    • Parameters

      Returns this

    • Parameters

      • check: (
            arg: [
                ...TupleOutputTypeWithOptionals<T>[],
                ...(Rest extends SomeType ? z.core.output<Rest<Rest>>[] : [])[],
            ],
        ) => unknown
      • Optionalparams:
            | string
            | {
                abort?: boolean;
                when?: (payload: ParsePayload) => boolean;
                path?: PropertyKey[];
                params?: Record<string, any>;
                error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
                message?: string;
            }
        • string
        • {
              abort?: boolean;
              when?: (payload: ParsePayload) => boolean;
              path?: PropertyKey[];
              params?: Record<string, any>;
              error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
              message?: string;
          }
          • Optionalabort?: boolean

            If true, no later checks will be executed if this check fails. Default false.

          • Optionalwhen?: (payload: ParsePayload) => boolean

            If provided, this check will only be executed if the function returns true. Defaults to payload => z.util.isAborted(payload).

          • Optionalpath?: PropertyKey[]
          • Optionalparams?: Record<string, any>
          • Optionalerror?: string | $ZodErrorMap<NonNullable<$ZodIssue>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

      Returns this

    • Returns a new instance that has been registered in z.globalRegistry with the specified description

      Parameters

      • description: string

      Returns this

    • Returns the metadata associated with this instance in z.globalRegistry

      Returns
          | undefined
          | {
              id?: string;
              title?: string;
              description?: string;
              deprecated?: boolean;
              [key: string]: unknown;
          }

    • Returns a new instance that has been registered in z.globalRegistry with the specified metadata

      Parameters

      • data: {
            id?: string;
            title?: string;
            description?: string;
            deprecated?: boolean;
            [key: string]: unknown;
        }

      Returns this

    • Returns boolean

      Try safe-parsing undefined (this is what isOptional does internally):

      const schema = z.string().optional();
      const isOptional = schema.safeParse(undefined).success; // true
    • Returns boolean

      Try safe-parsing null (this is what isNullable does internally):

      const schema = z.string().nullable();
      const isNullable = schema.safeParse(null).success; // true