@traversable/schema
    Preparing search index...
    interface ZodObject {
        _def: $ZodObjectDef<$ZodLooseShape>;
        _input: Record<string, unknown>;
        _output: Record<string, unknown>;
        _zod: $ZodObjectInternals;
        "~standard": $ZodStandardSchema<ZodObject>;
        def: $ZodObjectDef<$ZodLooseShape>;
        description?: string;
        shape: Shape;
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<ZodSafeParseResult<Record<string, unknown>>>;
        type: "object";
        and<T extends SomeType>(incoming: T): ZodIntersection<ZodObject, T>;
        array(): ZodArray<ZodObject>;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T ? ZodObject : $ZodBranded<ZodObject, T>;
        catch(def: core.output<this>): ZodCatch<ZodObject>;
        catch(def: (ctx: $ZodCatchCtx) => core.output<this>): ZodCatch<ZodObject>;
        catchall<T extends SomeType>(
            schema: T,
        ): ZodObject<$ZodLooseShape, $catchall<T>>;
        check(
            ...checks: (
                CheckFn<Record<string, unknown>>
                | $ZodCheck<Record<string, unknown>>
            )[],
        ): this;
        clone(
            def?: $ZodObjectDef<$ZodLooseShape>,
            params?: { parent: boolean },
        ): this;
        default(def: core.output<this>): ZodDefault<ZodObject>;
        default(
            def: () => util.NoUndefined<core.output<this>>,
        ): ZodDefault<ZodObject>;
        describe(description: string): this;
        extend<U extends $ZodLooseShape & Partial<Record<string, SomeType>>>(
            shape: U,
        ): ZodObject<
            {
                [k in string
                | number
                | symbol]: (
                    (string & keyof U) extends never
                        ? $ZodLooseShape & U
                        : { [K in string as K extends keyof U ? never : K]: any } & {
                            [K in string | number | symbol]: U[K]
                        }
                )[k]
            },
            $strip,
        >;
        isNullable(): boolean;
        isOptional(): boolean;
        keyof(): ZodEnum<{ [key: string]: string }>;
        loose(): ZodObject<$ZodLooseShape, $loose>;
        merge<U extends ZodObject<$ZodLooseShape, $strip>>(
            other: U,
        ): ZodObject<
            {
                [k in string
                | number
                | symbol]: (
                    (string & keyof U["shape"]) extends never
                        ? $ZodLooseShape & U["shape"]
                        : { [K in string as K extends keyof U["shape"] ? never : K]: any } & {
                            [K in string | number | symbol]: U["shape"][K]
                        }
                )[k]
            },
            U["_zod"]["config"],
        >;
        meta(): | undefined
        | {
            deprecated?: boolean;
            description?: string;
            id?: string;
            title?: string;
            [key: string]: unknown;
        };
        meta(
            data: {
                deprecated?: boolean;
                description?: string;
                id?: string;
                title?: string;
                [key: string]: unknown;
            },
        ): this;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): ZodNonOptional<ZodObject>;
        nullable(): ZodNullable<ZodObject>;
        nullish(): ZodOptional<ZodNullable<ZodObject>>;
        omit<M extends Mask<string>>(
            mask: M,
        ): ZodObject<
            { [k in string]: Omit<$ZodLooseShape, Extract<string, keyof M>>[k] },
            $strip,
        >;
        optional(): ZodOptional<ZodObject>;
        or<T extends SomeType>(option: T): ZodUnion<[ZodObject, T]>;
        overwrite(fn: (x: core.output<this>) => core.output<this>): this;
        parse(data: unknown, params?: ParseContext<$ZodIssue>): core.output<this>;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<Record<string, unknown>>;
        partial(): ZodObject<{ [key: string]: ZodOptional<any> }, $strip>;
        partial<M extends Mask<string>>(
            mask: M,
        ): ZodObject<
            { [key: string]: string extends keyof M ? ZodOptional<any> : any },
            $strip,
        >;
        passthrough(): ZodObject<$ZodLooseShape, $loose>;
        pick<M extends Mask<string>>(
            mask: M,
        ): ZodObject<
            { [k in string]: Pick<$ZodLooseShape, Extract<string, keyof M>>[k] },
            $strip,
        >;
        pipe<
            T extends
                $ZodType<
                    any,
                    Record<string, unknown>,
                    $ZodTypeInternals<any, Record<string, unknown>>,
                >,
        >(
            target:
                | T
                | $ZodType<
                    any,
                    Record<string, unknown>,
                    $ZodTypeInternals<any, Record<string, unknown>>,
                >,
        ): ZodPipe<ZodObject, T>;
        prefault(def: () => core.input<this>): ZodPrefault<ZodObject>;
        prefault(def: core.input<this>): ZodPrefault<ZodObject>;
        readonly(): ZodReadonly<ZodObject>;
        refine(
            check: (arg: core.output<this>) => unknown,
            params?:
                | string
                | {
                    abort?: boolean;
                    error?: string
                    | $ZodErrorMap<NonNullable<$ZodIssue>>;
                    message?: string;
                    params?: Record<string, any>;
                    path?: PropertyKey[];
                    when?: (payload: ParsePayload) => boolean;
                },
        ): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: ZodObject extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & ZodObject>?]
                    : [$replace<R["_meta"], R["_schema"] & ZodObject>]
                : ["Incompatible schema"],
        ): this;
        required(): ZodObject<{ [key: string]: ZodNonOptional<any> }, $strip>;
        required<M extends Mask<string>>(
            mask: M,
        ): ZodObject<
            { [key: string]: string extends keyof M ? ZodNonOptional<any> : any },
            $strip,
        >;
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<Record<string, unknown>>;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<Record<string, unknown>>>;
        strict(): ZodObject<$ZodLooseShape, $strict>;
        strip(): ZodObject<$ZodLooseShape, $strip>;
        superRefine(
            refinement: (
                arg: core.output<this>,
                ctx: RefinementCtx<Record<string, unknown>>,
            ) => void | Promise<void>,
        ): this;
        transform<NewOut>(
            transform: (
                arg: core.output<this>,
                ctx: RefinementCtx<Record<string, unknown>>,
            ) => NewOut | Promise<NewOut>,
        ): ZodPipe<
            ZodObject,
            ZodTransform<Awaited<NewOut>, Record<string, unknown>>,
        >;
    }

    Hierarchy

    • ZodObject
      • ZodObject
    Index

    Properties

    _def: $ZodObjectDef<$ZodLooseShape>

    Use .def instead.

    _input: Record<string, unknown>

    Use z.input<typeof schema> instead.

    _output: Record<string, unknown>

    Use z.output<typeof schema> instead.

    _zod: $ZodObjectInternals
    "~standard": $ZodStandardSchema<ZodObject>
    def: $ZodObjectDef<$ZodLooseShape>
    description?: string
    shape: Shape
    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<ZodSafeParseResult<Record<string, unknown>>>
    type: "object"

    Methods

    • Type Parameters

      • T extends SomeType

      Parameters

      • incoming: T

      Returns ZodIntersection<ZodObject, T>

    • Returns ZodArray<ZodObject>

    • Type Parameters

      • T extends PropertyKey = PropertyKey

      Parameters

      • Optionalvalue: T

      Returns PropertyKey extends T ? ZodObject : $ZodBranded<ZodObject, T>

    • Parameters

      • def: core.output<this>

      Returns ZodCatch<ZodObject>

    • Parameters

      • def: (ctx: $ZodCatchCtx) => core.output<this>

      Returns ZodCatch<ZodObject>

    • Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior.

      Type Parameters

      • T extends SomeType

      Parameters

      • schema: T

      Returns ZodObject<$ZodLooseShape, $catchall<T>>

    • Parameters

      • ...checks: (CheckFn<Record<string, unknown>> | $ZodCheck<Record<string, unknown>>)[]

      Returns this

    • Parameters

      • Optionaldef: $ZodObjectDef<$ZodLooseShape>
      • Optionalparams: { parent: boolean }

      Returns this

    • Parameters

      • def: core.output<this>

      Returns ZodDefault<ZodObject>

    • Parameters

      • def: () => util.NoUndefined<core.output<this>>

      Returns ZodDefault<ZodObject>

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

      Parameters

      • description: string

      Returns this

    • Type Parameters

      • U extends $ZodLooseShape & Partial<Record<string, SomeType>>

      Parameters

      • shape: U

      Returns ZodObject<
          {
              [k in string
              | number
              | symbol]: (
                  (string & keyof U) extends never
                      ? $ZodLooseShape & U
                      : { [K in string as K extends keyof U ? never : K]: any } & {
                          [K in string | number | symbol]: U[K]
                      }
              )[k]
          },
          $strip,
      >

    • 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
    • Returns ZodEnum<{ [key: string]: string }>

    • Consider z.looseObject(A.shape) instead

      Returns ZodObject<$ZodLooseShape, $loose>

    • Type Parameters

      • U extends ZodObject<$ZodLooseShape, $strip>

      Parameters

      • other: U

      Returns ZodObject<
          {
              [k in string
              | number
              | symbol]: (
                  (string & keyof U["shape"]) extends never
                      ? $ZodLooseShape & U["shape"]
                      : { [K in string as K extends keyof U["shape"] ? never : K]: any } & {
                          [K in string | number | symbol]: U["shape"][K]
                      }
              )[k]
          },
          U["_zod"]["config"],
      >

      Use A.extend(B.shape) instead.

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

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

      Returns this

    • Parameters

      • Optionalparams:
            | string
            | {
                error?: string
                | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                message?: string;
            }
        • string
        • {
              error?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
              message?: string;
          }
          • Optionalerror?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

      Returns ZodNonOptional<ZodObject>

    • Returns ZodNullable<ZodObject>

    • Returns ZodOptional<ZodNullable<ZodObject>>

    • Type Parameters

      • M extends Mask<string>

      Parameters

      • mask: M

      Returns ZodObject<
          { [k in string]: Omit<$ZodLooseShape, Extract<string, keyof M>>[k] },
          $strip,
      >

    • Returns ZodOptional<ZodObject>

    • Type Parameters

      • T extends SomeType

      Parameters

      • option: T

      Returns ZodUnion<[ZodObject, T]>

    • Parameters

      • fn: (x: core.output<this>) => core.output<this>

      Returns this

    • Parameters

      • data: unknown
      • Optionalparams: ParseContext<$ZodIssue>

      Returns core.output<this>

    • Parameters

      • data: unknown
      • Optionalparams: ParseContext<$ZodIssue>

      Returns Promise<Record<string, unknown>>

    • Returns ZodObject<{ [key: string]: ZodOptional<any> }, $strip>

    • Type Parameters

      • M extends Mask<string>

      Parameters

      • mask: M

      Returns ZodObject<
          { [key: string]: string extends keyof M ? ZodOptional<any> : any },
          $strip,
      >

    • Returns ZodObject<$ZodLooseShape, $loose>

      Use z.looseObject() or .loose() instead.

    • Type Parameters

      • M extends Mask<string>

      Parameters

      • mask: M

      Returns ZodObject<
          { [k in string]: Pick<$ZodLooseShape, Extract<string, keyof M>>[k] },
          $strip,
      >

    • Type Parameters

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

      Parameters

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

      Returns ZodPipe<ZodObject, T>

    • Parameters

      • def: () => core.input<this>

      Returns ZodPrefault<ZodObject>

    • Parameters

      • def: core.input<this>

      Returns ZodPrefault<ZodObject>

    • Returns ZodReadonly<ZodObject>

    • Parameters

      • check: (arg: core.output<this>) => unknown
      • Optionalparams:
            | string
            | {
                abort?: boolean;
                error?: string
                | $ZodErrorMap<NonNullable<$ZodIssue>>;
                message?: string;
                params?: Record<string, any>;
                path?: PropertyKey[];
                when?: (payload: ParsePayload) => boolean;
            }
        • string
        • {
              abort?: boolean;
              error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>;
              message?: string;
              params?: Record<string, any>;
              path?: PropertyKey[];
              when?: (payload: ParsePayload) => boolean;
          }
          • 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[]
          • Optionalwhen?: (payload: ParsePayload) => boolean

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

      Returns this

    • Type Parameters

      • R extends $ZodRegistry<
            MetadataType,
            $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
        >

      Parameters

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

      Returns this

    • Returns ZodObject<{ [key: string]: ZodNonOptional<any> }, $strip>

    • Type Parameters

      • M extends Mask<string>

      Parameters

      • mask: M

      Returns ZodObject<
          { [key: string]: string extends keyof M ? ZodNonOptional<any> : any },
          $strip,
      >

    • Parameters

      • data: unknown
      • Optionalparams: ParseContext<$ZodIssue>

      Returns ZodSafeParseResult<Record<string, unknown>>

    • Parameters

      • data: unknown
      • Optionalparams: ParseContext<$ZodIssue>

      Returns Promise<ZodSafeParseResult<Record<string, unknown>>>

    • Consider z.strictObject(A.shape) instead

      Returns ZodObject<$ZodLooseShape, $strict>

    • This is the default behavior. This method call is likely unnecessary.

      Returns ZodObject<$ZodLooseShape, $strip>

    • Parameters

      • refinement: (
            arg: core.output<this>,
            ctx: RefinementCtx<Record<string, unknown>>,
        ) => void | Promise<void>

      Returns this

      Use .check() instead.

    • Type Parameters

      • NewOut

      Parameters

      • transform: (
            arg: core.output<this>,
            ctx: RefinementCtx<Record<string, unknown>>,
        ) => NewOut | Promise<NewOut>

      Returns ZodPipe<ZodObject, ZodTransform<Awaited<NewOut>, Record<string, unknown>>>