Membrane SDK - v0.29.2
    Preparing search index...

    Interface ZodISODateTime

    interface ZodISODateTime {
        _zod: $ZodISODateTimeInternals;
        def: $ZodStringFormatDef<string>;
        type: "string";
        _def: $ZodStringFormatDef<string>;
        _output: string;
        _input: string;
        "~standard": ZodStandardSchemaWithJSON<ZodISODateTime>;
        toJSONSchema(
            params?: ToJSONSchemaParams,
        ): ZodStandardJSONSchemaPayload<ZodISODateTime>;
        check(...checks: ($ZodCheck<string> | CheckFn<string>)[]): this;
        with(...checks: ($ZodCheck<string> | CheckFn<string>)[]): this;
        clone(
            def?: $ZodStringFormatDef<string>,
            params?: { parent: boolean },
        ): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: ZodISODateTime extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & ZodISODateTime>?]
                    : [$replace<R["_meta"], R["_schema"] & ZodISODateTime>]
                : ["Incompatible schema"],
        ): this;
        brand<
            T extends PropertyKey = PropertyKey,
            Dir extends "inout" | "in" | "out" = "out",
        >(
            value?: T,
        ): PropertyKey extends T
            ? ZodISODateTime
            : $ZodBranded<ZodISODateTime, T, Dir>;
        parse(data: unknown, params?: ParseContext<$ZodIssue>): string;
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<string>;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<string>;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<string>>;
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<ZodSafeParseResult<string>>;
        encode(data: string, params?: ParseContext<$ZodIssue>): string;
        decode(data: string, params?: ParseContext<$ZodIssue>): string;
        encodeAsync(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): Promise<string>;
        decodeAsync(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): Promise<string>;
        safeEncode(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<string>;
        safeDecode(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<string>;
        safeEncodeAsync(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<string>>;
        safeDecodeAsync(
            data: string,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<string>>;
        refine<Ch extends (arg: string) => unknown>(
            check: Ch,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<NonNullable<$ZodIssue>>;
                    message?: string;
                    abort?: boolean;
                    when?: (payload: ParsePayload) => boolean;
                    path?: PropertyKey[];
                    params?: Record<string, any>;
                },
        ): Ch extends (arg: any) => arg is R
            ? ZodISODateTime & ZodType<R, string, $ZodTypeInternals<R, string>>
            : ZodISODateTime;
        superRefine(
            refinement: (
                arg: string,
                ctx: $RefinementCtx<string>,
            ) => void | Promise<void>,
        ): this;
        overwrite(fn: (x: string) => string): this;
        optional(): ZodOptional<ZodISODateTime>;
        exactOptional(): ZodExactOptional<ZodISODateTime>;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): ZodNonOptional<ZodISODateTime>;
        nullable(): ZodNullable<ZodISODateTime>;
        nullish(): ZodOptional<ZodNullable<ZodISODateTime>>;
        default(def: string): ZodDefault<ZodISODateTime>;
        default(def: () => string): ZodDefault<ZodISODateTime>;
        prefault(def: () => string): ZodPrefault<ZodISODateTime>;
        prefault(def: string): ZodPrefault<ZodISODateTime>;
        array(): ZodArray<ZodISODateTime>;
        or<T extends SomeType>(option: T): ZodUnion<[ZodISODateTime, T]>;
        and<T extends SomeType>(incoming: T): ZodIntersection<ZodISODateTime, T>;
        transform<NewOut>(
            transform: (
                arg: string,
                ctx: $RefinementCtx<string>,
            ) => NewOut | Promise<NewOut>,
        ): ZodPipe<ZodISODateTime, ZodTransform<Awaited<NewOut>, string>>;
        catch(def: string): ZodCatch<ZodISODateTime>;
        catch(def: (ctx: $ZodCatchCtx) => string): ZodCatch<ZodISODateTime>;
        pipe<T extends $ZodType<any, string, $ZodTypeInternals<any, string>>>(
            target: $ZodType<any, string, $ZodTypeInternals<any, string>> | T,
        ): ZodPipe<ZodISODateTime, T>;
        readonly(): ZodReadonly<ZodISODateTime>;
        describe(description: string): this;
        description?: string;
        meta(): | {
            id?: string;
            title?: string;
            description?: string;
            deprecated?: boolean;
            [key: string]: unknown;
        }
        | undefined;
        meta(
            data: {
                id?: string;
                title?: string;
                description?: string;
                deprecated?: boolean;
                [key: string]: unknown;
            },
        ): this;
        isOptional(): boolean;
        isNullable(): boolean;
        apply<T>(fn: (schema: this) => T): T;
        format: string | null;
        minLength: number | null;
        maxLength: number | null;
        regex(
            regex: RegExp,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        includes(
            value: string,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                    position?: number;
                },
        ): this;
        startsWith(
            value: string,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        endsWith(
            value: string,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        min(
            minLength: number,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        max(
            maxLength: number,
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooBig<HasLength>>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        length(
            len: number,
            params?:
                | string
                | {
                    error?: | string
                    | $ZodErrorMap<
                        NonNullable<
                            $ZodIssueTooSmall<HasLength>
                            | $ZodIssueTooBig<HasLength>,
                        >,
                    >;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        nonempty(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                    message?: string;
                    abort?: boolean;
                },
        ): this;
        lowercase(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                    pattern?: RegExp;
                },
        ): this;
        uppercase(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    abort?: boolean;
                    pattern?: RegExp;
                },
        ): this;
        trim(): this;
        normalize(form?: string & {} | "NFC" | "NFD" | "NFKC" | "NFKD"): this;
        toLowerCase(): this;
        toUpperCase(): this;
        slugify(): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    def: $ZodStringFormatDef<string>
    type: "string"
    _def: $ZodStringFormatDef<string>

    Use .def instead.

    _output: string

    Use z.output<typeof schema> instead.

    _input: string

    Use z.input<typeof schema> instead.

    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<ZodSafeParseResult<string>>
    description?: string
    format: string | null
    minLength: number | null
    maxLength: number | null

    Methods

    • Type Parameters

      • Ch extends (arg: string) => unknown

      Parameters

      • check: Ch
      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<NonNullable<$ZodIssue>>;
                message?: string;
                abort?: boolean;
                when?: (payload: ParsePayload) => boolean;
                path?: PropertyKey[];
                params?: Record<string, any>;
            }
        • string
        • {
              error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
              message?: string;
              abort?: boolean;
              when?: (payload: ParsePayload) => boolean;
              path?: PropertyKey[];
              params?: Record<string, any>;
          }
          • Optionalerror?: string | $ZodErrorMap<NonNullable<$ZodIssue>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • 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>

      Returns Ch extends (arg: any) => arg is R
          ? ZodISODateTime & ZodType<R, string, $ZodTypeInternals<R, string>>
          : ZodISODateTime

    • Parameters

      • refinement: (arg: string, ctx: $RefinementCtx<string>) => void | Promise<void>

      Returns this

    • Parameters

      • fn: (x: string) => string

      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
          | {
              id?: string;
              title?: string;
              description?: string;
              deprecated?: boolean;
              [key: string]: unknown;
          }
          | undefined

    • 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
    • Type Parameters

      • T

      Parameters

      • fn: (schema: this) => T

      Returns T

    • Parameters

      Returns this

    • Parameters

      • value: string
      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                abort?: boolean;
                position?: number;
            }
        • string
        • {
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              abort?: boolean;
              position?: number;
          }
          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalabort?: boolean

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

          • Optionalposition?: number

      Returns this

    • Parameters

      Returns this

    • Parameters

      Returns this

    • Parameters

      • minLength: number
      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                message?: string;
                abort?: boolean;
            }

      Returns this

    • Parameters

      • maxLength: number
      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueTooBig<HasLength>>;
                message?: string;
                abort?: boolean;
            }
        • string
        • {
              error?: string | $ZodErrorMap<$ZodIssueTooBig<HasLength>>;
              message?: string;
              abort?: boolean;
          }
          • Optionalerror?: string | $ZodErrorMap<$ZodIssueTooBig<HasLength>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalabort?: boolean

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

      Returns this

    • Parameters

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                message?: string;
                abort?: boolean;
            }

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                abort?: boolean;
                pattern?: RegExp;
            }
        • string
        • {
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              abort?: boolean;
              pattern?: RegExp;
          }
          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalabort?: boolean

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

          • Optionalpattern?: RegExp

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                abort?: boolean;
                pattern?: RegExp;
            }
        • string
        • {
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              abort?: boolean;
              pattern?: RegExp;
          }
          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalabort?: boolean

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

          • Optionalpattern?: RegExp

      Returns this

    • Parameters

      • Optionalform: string & {} | "NFC" | "NFD" | "NFKC" | "NFKD"

      Returns this