interface-forge - v2.5.0
    Preparing search index...

    Interface ZodString

    interface ZodString {
        _def: $ZodStringDef;
        _input: string;
        _output: string;
        _zod: $ZodStringInternals;
        "~standard": $ZodStandardSchema<ZodString>;
        def: $ZodStringDef;
        description?: string;
        format: null | string;
        maxLength: null | number;
        minLength: null | number;
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<ZodSafeParseResult<string>>;
        type: "string";
        and<T extends SomeType>(incoming: T): ZodIntersection<ZodString, T>;
        array(): ZodArray<ZodString>;
        base64(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        base64url(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T ? ZodString : $ZodBranded<ZodString, T>;
        catch(def: string): ZodCatch<ZodString>;
        catch(def: (ctx: $ZodCatchCtx) => string): ZodCatch<ZodString>;
        check(...checks: ($ZodCheck<string> | CheckFn<string>)[]): this;
        cidrv4(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v4";
                },
        ): this;
        cidrv6(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v6";
                },
        ): this;
        clone(def?: $ZodStringDef, params?: { parent: boolean }): this;
        cuid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        cuid2(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        date(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        datetime(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    local?: boolean;
                    message?: string;
                    offset?: boolean;
                    precision?: null | number;
                },
        ): this;
        default(def: string): ZodDefault<ZodString>;
        default(def: () => string): ZodDefault<ZodString>;
        describe(description: string): this;
        duration(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        e164(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        email(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        emoji(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        endsWith(
            value: string,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        guid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        guid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        includes(
            value: string,
            params?: {
                abort?: boolean;
                error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                position?: number;
            },
        ): this;
        ipv4(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v4";
                },
        ): this;
        ipv6(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v6";
                },
        ): this;
        isNullable(): boolean;
        isOptional(): boolean;
        jwt(
            params?:
                | string
                | {
                    abort?: boolean;
                    alg?: JWTAlgorithm;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        ksuid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        length(
            len: number,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: | string
                    | $ZodErrorMap<
                        NonNullable<
                            $ZodIssueTooSmall<HasLength>
                            | $ZodIssueTooBig<HasLength>,
                        >,
                    >;
                    message?: string;
                },
        ): this;
        lowercase(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        max(
            maxLength: number,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooBig<HasLength>>;
                    message?: string;
                },
        ): this;
        meta(): | undefined
        | {
            deprecated?: boolean;
            description?: string;
            example?: unknown;
            examples?: | unknown[]
            | { [key: string]: { value: unknown; [key: string]: unknown } };
            id?: string;
            title?: string;
            [key: string]: unknown;
        };
        meta(
            data: {
                deprecated?: boolean;
                description?: string;
                example?: unknown;
                examples?:
                    | unknown[]
                    | { [key: string]: { value: unknown; [key: string]: unknown } };
                id?: string;
                title?: string;
                [key: string]: unknown;
            },
        ): this;
        min(
            minLength: number,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                    message?: string;
                },
        ): this;
        nanoid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        nonempty(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                    message?: string;
                },
        ): this;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): ZodNonOptional<ZodString>;
        normalize(form?: string & {} | "NFC" | "NFD" | "NFKC" | "NFKD"): this;
        nullable(): ZodNullable<ZodString>;
        nullish(): ZodOptional<ZodNullable<ZodString>>;
        optional(): ZodOptional<ZodString>;
        or<T extends SomeType>(option: T): ZodUnion<[ZodString, T]>;
        overwrite(fn: (x: string) => string): this;
        parse(data: unknown, params?: ParseContext<$ZodIssue>): string;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<string>;
        pipe<T extends $ZodType<any, string, $ZodTypeInternals<any, string>>>(
            target: T | $ZodType<any, string, $ZodTypeInternals<any, string>>,
        ): ZodPipe<ZodString, T>;
        prefault(def: () => string): ZodPrefault<ZodString>;
        prefault(def: string): ZodPrefault<ZodString>;
        readonly(): ZodReadonly<ZodString>;
        refine(
            check: (arg: string) => unknown,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<NonNullable<$ZodIssue>>;
                    message?: string;
                    params?: Record<string, any>;
                    path?: PropertyKey[];
                },
        ): this;
        regex(
            regex: RegExp,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: ZodString extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & ZodString>?]
                    : [$replace<R["_meta"], R["_schema"] & ZodString>]
                : ["Incompatible schema"],
        ): this;
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<string>;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<string>>;
        startsWith(
            value: string,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                },
        ): this;
        superRefine(
            refinement: (
                arg: string,
                ctx: RefinementCtx<string>,
            ) => void | Promise<void>,
        ): this;
        time(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    precision?: null | number;
                },
        ): this;
        toLowerCase(): this;
        toUpperCase(): this;
        transform<NewOut>(
            transform: (
                arg: string,
                ctx: RefinementCtx<string>,
            ) => NewOut | Promise<NewOut>,
        ): ZodPipe<ZodString, ZodTransform<Awaited<NewOut>, string>>;
        trim(): this;
        ulid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        uppercase(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
        url(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    hostname?: RegExp;
                    message?: string;
                    pattern?: RegExp;
                    protocol?: RegExp;
                },
        ): this;
        uuid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
                },
        ): this;
        uuidv4(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
                },
        ): this;
        uuidv6(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
                },
        ): this;
        uuidv7(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
                },
        ): this;
        xid(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Use .def instead.

    _input: string

    Use z.input<typeof schema> instead.

    _output: string

    Use z.output<typeof schema> instead.

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

    Methods

    • Parameters

      Returns this

      Use z.base64() instead.

    • Parameters

      Returns this

      Use z.base64url() instead.

    • Parameters

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v4";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v4";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v4"

      Returns this

      Use z.cidrv4() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v6";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v6";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v6"

      Returns this

      Use z.cidrv6() instead.

    • Parameters

      Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.cuid() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.cuid2() instead.

    • Parameters

      Returns this

      Use z.iso.date() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                local?: boolean;
                message?: string;
                offset?: boolean;
                precision?: null | number;
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              local?: boolean;
              message?: string;
              offset?: boolean;
              precision?: null | number;
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionallocal?: boolean
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionaloffset?: boolean
          • Optionalprecision?: null | number

      Returns this

      Use z.iso.datetime() instead.

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

      Parameters

      • description: string

      Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.iso.duration() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.e164() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.email() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.emoji() instead.

    • Parameters

      Returns this

    • Parameters

      Returns this

      Use z.guid() instead.

    • Parameters

      Returns this

      Use z.guid() instead.

    • Parameters

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

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

        • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
        • Optionalmessage?: string

          This parameter is deprecated. Use error instead.

        • Optionalposition?: number

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v4";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v4";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v4"

      Returns this

      Use z.ipv4() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v6";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v6";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v6"

      Returns this

      Use z.ipv6() instead.

    • Returns boolean

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

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

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

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

      Returns this

      Use z.jwt() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.ksuid() instead.

    • Parameters

      Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

    • Parameters

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

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

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

            This parameter is deprecated. Use error instead.

      Returns this

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

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

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

      Parameters

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

      Returns this

    • Parameters

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

      Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.nanoid() instead.

    • Parameters

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

      Returns this

    • Parameters

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

      Returns this

    • Parameters

      • fn: (x: string) => string

      Returns this

    • Type Parameters

      • T extends $ZodType<any, string, $ZodTypeInternals<any, string>>

      Parameters

      • target: T | $ZodType<any, string, $ZodTypeInternals<any, string>>

      Returns ZodPipe<ZodString, T>

    • Parameters

      • check: (arg: string) => unknown
      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<NonNullable<$ZodIssue>>;
                message?: string;
                params?: Record<string, any>;
                path?: PropertyKey[];
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
              message?: string;
              params?: Record<string, any>;
              path?: PropertyKey[];
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<NonNullable<$ZodIssue>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalparams?: Record<string, any>
          • Optionalpath?: PropertyKey[]

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      Parameters

      • registry: R
      • ...meta: ZodString extends R["_schema"]
            ? undefined extends R["_meta"]
                ? [$replace<R["_meta"], R["_schema"] & ZodString>?]
                : [$replace<R["_meta"], R["_schema"] & ZodString>]
            : ["Incompatible schema"]

      Returns this

    • Parameters

      Returns this

    • Parameters

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

      Returns this

      Use .check() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                precision?: null | number;
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              precision?: null | number;
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalprecision?: null | number

      Returns this

      Use z.iso.time() instead.

    • Returns this

    • Returns this

    • Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.ulid() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalhostname?: RegExp
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp
          • Optionalprotocol?: RegExp

      Returns this

      Use z.url() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7"

      Returns this

      Use z.uuid() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7"

      Returns this

      Use z.uuid() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7"

      Returns this

      Use z.uuid() instead.

    • Parameters

      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                message?: string;
                version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
              message?: string;
              version?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7";
          }
          • Optionalabort?: boolean

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalversion?: "v8" | "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7"

      Returns this

      Use z.uuid() instead.

    • Parameters

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

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

          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidStringFormat>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

          • Optionalpattern?: RegExp

      Returns this

      Use z.xid() instead.