bupkis
    Preparing search index...

    Interface ZodObject<Shape, Config>

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

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    shape: Shape
    type: "object"

    Use .def instead.

    _output: $InferObjectOutput<Shape, Config["out"]>

    Use z.output<typeof schema> instead.

    Use z.input<typeof schema> instead.

    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<ZodSafeParseResult<$InferObjectOutput<Shape, Config["out"]>>>
    description?: string

    Methods

    • Returns z.ZodEnum<{ [k in string]: { [k in string]: k }[k] }>

    • Type Parameters

      Parameters

      • shape: U

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: (
                  (keyof Shape & keyof U) extends never
                      ? Shape & U
                      : {
                          [K in string | number | symbol as K extends keyof U ? never : K]: Shape[K]
                      } & { [K in string
                      | number
                      | symbol]: U[K] }
              )[k]
          },
          Config,
      >

    • Type Parameters

      Parameters

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: (
                  (keyof Shape & keyof U) extends never
                      ? Shape & U
                      : {
                          [K in string | number | symbol as K extends keyof U ? never : K]: Shape[K]
                      } & { [K in string
                      | number
                      | symbol]: U[K] }
              )[k]
          },
          Config,
      >

    • Type Parameters

      Parameters

      • other: U

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

      Use A.extend(B.shape) instead.

    • Type Parameters

      Parameters

      • mask: M

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: Pick<Shape, Extract<keyof Shape, keyof M>>[k]
          },
          Config,
      >

    • Type Parameters

      Parameters

      • mask: M

      Returns z.ZodObject<
          {
              [k in string
              | number
              | symbol]: Omit<Shape, Extract<keyof Shape, keyof M>>[k]
          },
          Config,
      >

    • Parameters

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

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

          • Optionalwhen?: (payload: ParsePayload) => boolean

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

          • Optionalpath?: PropertyKey[]
          • Optionalparams?: Record<string, any>
          • Optionalerror?: string | $ZodErrorMap<NonNullable<$ZodIssue>>
          • Optionalmessage?: string

            This parameter is deprecated. Use error instead.

      Returns this

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

      Parameters

      • description: string

      Returns this

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

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

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

      Parameters

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

      Returns this

    • Returns boolean

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

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

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

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