bupkis
    Preparing search index...

    Interface _ZodDate<T>

    interface _ZodDate<T extends $ZodDateInternals = $ZodDateInternals> {
        minDate: null | Date;
        maxDate: null | Date;
        def: T["def"];
        type: T["def"]["type"];
        _def: T["def"];
        _output: T["output"];
        _input: T["input"];
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<ZodSafeParseResult<z.core.output<_ZodDate<T>>>>;
        description?: string;
        _zod: T;
        "~standard": $ZodStandardSchema<_ZodDate<T>>;
        min(
            value: number | Date,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>;
                    message?: string;
                },
        ): this;
        max(
            value: number | Date,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooBig<Numeric>>;
                    message?: string;
                },
        ): this;
        check(
            ...checks: (
                | CheckFn<z.core.output<_ZodDate<T>>>
                | z.core.$ZodCheck<z.core.output<_ZodDate<T>>>
            )[],
        ): this;
        clone(def?: T["def"], params?: { parent: boolean }): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    z.core.$ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: _ZodDate<T> extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & _ZodDate<T>>?]
                    : [$replace<R["_meta"], R["_schema"] & _ZodDate<T>>]
                : ["Incompatible schema"],
        ): this;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T ? _ZodDate<T> : $ZodBranded<_ZodDate<T>, T>;
        parse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): z.core.output<_ZodDate<T>>;
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<z.core.output<_ZodDate<T>>>;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<z.core.output<_ZodDate<T>>>;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<z.core.output<_ZodDate<T>>>>;
        encode(
            data: z.core.output<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): z.core.input<_ZodDate<T>>;
        decode(
            data: z.core.input<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): z.core.output<_ZodDate<T>>;
        encodeAsync(
            data: z.core.output<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<z.core.input<_ZodDate<T>>>;
        decodeAsync(
            data: z.core.input<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<z.core.output<_ZodDate<T>>>;
        safeEncode(
            data: z.core.output<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<z.core.input<_ZodDate<T>>>;
        safeDecode(
            data: z.core.input<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<z.core.output<_ZodDate<T>>>;
        safeEncodeAsync(
            data: z.core.output<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<z.core.input<_ZodDate<T>>>>;
        safeDecodeAsync(
            data: z.core.input<_ZodDate<T>>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<z.core.output<_ZodDate<T>>>>;
        refine(
            check: (arg: z.core.output<_ZodDate<T>>) => 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: z.core.output<_ZodDate<T>>,
                ctx: $RefinementCtx<z.core.output<_ZodDate<T>>>,
            ) => void | Promise<void>,
        ): this;
        overwrite(
            fn: (x: z.core.output<_ZodDate<T>>) => z.core.output<_ZodDate<T>>,
        ): this;
        optional(): z.ZodOptional<_ZodDate<T>>;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): z.ZodNonOptional<_ZodDate<T>>;
        nullable(): z.ZodNullable<_ZodDate<T>>;
        nullish(): z.ZodOptional<z.ZodNullable<_ZodDate<T>>>;
        default(def: z.core.output<_ZodDate<T>>): z.ZodDefault<_ZodDate<T>>;
        default(
            def: () => NoUndefined<z.core.output<_ZodDate<T>>>,
        ): z.ZodDefault<_ZodDate<T>>;
        prefault(def: () => z.core.input<_ZodDate<T>>): z.ZodPrefault<_ZodDate<T>>;
        prefault(def: z.core.input<_ZodDate<T>>): z.ZodPrefault<_ZodDate<T>>;
        array(): z.ZodArray<_ZodDate<T>>;
        or<T extends SomeType>(option: T): z.ZodUnion<[_ZodDate<T>, T]>;
        and<T extends SomeType>(incoming: T): z.ZodIntersection<_ZodDate<T>, T>;
        transform<NewOut>(
            transform: (
                arg: z.core.output<_ZodDate<T>>,
                ctx: $RefinementCtx<z.core.output<_ZodDate<T>>>,
            ) => NewOut | Promise<NewOut>,
        ): z.ZodPipe<
            _ZodDate<T>,
            z.ZodTransform<Awaited<NewOut>, z.core.output<_ZodDate<T>>>,
        >;
        catch(def: z.core.output<_ZodDate<T>>): z.ZodCatch<_ZodDate<T>>;
        catch(
            def: (ctx: $ZodCatchCtx) => z.core.output<_ZodDate<T>>,
        ): z.ZodCatch<_ZodDate<T>>;
        pipe<
            T extends
                z.core.$ZodType<
                    any,
                    z.core.output<_ZodDate<T>>,
                    $ZodTypeInternals<any, z.core.output<_ZodDate<T>>>,
                >,
        >(
            target:
                | T
                | z.core.$ZodType<
                    any,
                    z.core.output<_ZodDate<T>>,
                    $ZodTypeInternals<any, z.core.output<_ZodDate<T>>>,
                >,
        ): z.ZodPipe<_ZodDate<T>, T>;
        readonly(): z.ZodReadonly<_ZodDate<T>>;
        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

    minDate: null | Date

    Not recommended.

    maxDate: null | Date

    Not recommended.

    def: T["def"]
    type: T["def"]["type"]
    _def: T["def"]

    Use .def instead.

    _output: T["output"]

    Use z.output<typeof schema> instead.

    _input: T["input"]

    Use z.input<typeof schema> instead.

    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<ZodSafeParseResult<z.core.output<_ZodDate<T>>>>
    description?: string
    _zod: T

    Methods

    • Parameters

      • value: number | Date
      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>;
                message?: string;
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>;
              message?: string;
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

      Returns this

    • Parameters

      • value: number | Date
      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueTooBig<Numeric>>;
                message?: string;
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>;
              message?: string;
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

      Returns this

    • Parameters

      • Optionaldef: T["def"]
      • Optionalparams: { parent: boolean }

      Returns this

    • Parameters

      • check: (arg: z.core.output<_ZodDate<T>>) => 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