interface-forge - v2.5.0
    Preparing search index...
    interface ZodUUID {
        _def: $ZodStringFormatDef<"uuid">;
        _input: string;
        _output: string;
        _zod: $ZodUUIDInternals;
        "~standard": $ZodStandardSchema<ZodUUID>;
        def: $ZodStringFormatDef<"uuid">;
        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<ZodUUID, T>;
        array(): ZodArray<ZodUUID>;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T ? ZodUUID : $ZodBranded<ZodUUID, T>;
        catch(def: string): ZodCatch<ZodUUID>;
        catch(def: (ctx: $ZodCatchCtx) => string): ZodCatch<ZodUUID>;
        check(...checks: ($ZodCheck<string> | CheckFn<string>)[]): this;
        clone(
            def?: $ZodStringFormatDef<"uuid">,
            params?: { parent: boolean },
        ): this;
        default(def: string): ZodDefault<ZodUUID>;
        default(def: () => string): ZodDefault<ZodUUID>;
        describe(description: string): this;
        endsWith(
            value: string,
            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;
        isNullable(): boolean;
        isOptional(): boolean;
        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;
        nonempty(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueTooSmall<HasLength>>;
                    message?: string;
                },
        ): this;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): ZodNonOptional<ZodUUID>;
        normalize(form?: string & {} | "NFC" | "NFD" | "NFKC" | "NFKD"): this;
        nullable(): ZodNullable<ZodUUID>;
        nullish(): ZodOptional<ZodNullable<ZodUUID>>;
        optional(): ZodOptional<ZodUUID>;
        or<T extends SomeType>(option: T): ZodUnion<[ZodUUID, 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: $ZodType<any, string, $ZodTypeInternals<any, string>> | T,
        ): ZodPipe<ZodUUID, T>;
        prefault(def: () => string): ZodPrefault<ZodUUID>;
        prefault(def: string): ZodPrefault<ZodUUID>;
        readonly(): ZodReadonly<ZodUUID>;
        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: ZodUUID extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & ZodUUID>?]
                    : [$replace<R["_meta"], R["_schema"] & ZodUUID>]
                : ["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;
        toLowerCase(): this;
        toUpperCase(): this;
        transform<NewOut>(
            transform: (
                arg: string,
                ctx: RefinementCtx<string>,
            ) => NewOut | Promise<NewOut>,
        ): ZodPipe<ZodUUID, ZodTransform<Awaited<NewOut>, string>>;
        trim(): this;
        uppercase(
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidStringFormat>;
                    message?: string;
                    pattern?: RegExp;
                },
        ): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _def: $ZodStringFormatDef<"uuid">

    Use .def instead.

    _input: string

    Use z.input<typeof schema> instead.

    _output: string

    Use z.output<typeof schema> instead.

    def: $ZodStringFormatDef<"uuid">
    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

    • Parameters

      Returns this

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

      Parameters

      • description: string

      Returns this

    • Parameters

      Returns this

    • 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

    • 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

      • 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<$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: $ZodType<any, string, $ZodTypeInternals<any, string>> | T

      Returns ZodPipe<ZodUUID, 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: ZodUUID extends R["_schema"]
            ? undefined extends R["_meta"]
                ? [$replace<R["_meta"], R["_schema"] & ZodUUID>?]
                : [$replace<R["_meta"], R["_schema"] & ZodUUID>]
            : ["Incompatible schema"]

      Returns this

    • Parameters

      Returns this

    • Parameters

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

      Returns this

      Use .check() 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