bupkis
    Preparing search index...

    Interface ZodRecord<Key, Value>

    interface ZodRecord<
        Key extends $ZodRecordKey = $ZodRecordKey,
        Value extends SomeType = z.core.$ZodType,
    > {
        keyType: Key;
        valueType: Value;
        def: $ZodRecordDef<Key, Value>;
        type: "record";
        _def: $ZodRecordDef<Key, Value>;
        _output: $InferZodRecordOutput<Key, Value>;
        _input: $InferZodRecordInput<Key, Value>;
        spa: (
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ) => Promise<ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>>;
        description?: string;
        _zod: $ZodRecordInternals;
        "~standard": $ZodStandardSchema<z.ZodRecord<Key, Value>>;
        check(
            ...checks: (
                | CheckFn<$InferZodRecordOutput<Key, Value>>
                | z.core.$ZodCheck<$InferZodRecordOutput<Key, Value>>
            )[],
        ): this;
        clone(def?: $ZodRecordDef<Key, Value>, params?: { parent: boolean }): this;
        register<
            R extends
                $ZodRegistry<
                    MetadataType,
                    z.core.$ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
                >,
        >(
            registry: R,
            ...meta: z.ZodRecord<Key, Value> extends R["_schema"]
                ? undefined extends R["_meta"]
                    ? [$replace<R["_meta"], R["_schema"] & z.ZodRecord<Key, Value>>?]
                    : [$replace<R["_meta"], R["_schema"] & z.ZodRecord<Key, Value>>]
                : ["Incompatible schema"],
        ): this;
        brand<T extends PropertyKey = PropertyKey>(
            value?: T,
        ): PropertyKey extends T
            ? z.ZodRecord<Key, Value>
            : $ZodBranded<z.ZodRecord<Key, Value>, T>;
        parse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): $InferZodRecordOutput<Key>;
        safeParse(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>;
        parseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<$InferZodRecordOutput<Key, Value>>;
        safeParseAsync(
            data: unknown,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>>;
        encode(
            data: $InferZodRecordOutput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): $InferZodRecordInput<Key>;
        decode(
            data: $InferZodRecordInput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): $InferZodRecordOutput<Key>;
        encodeAsync(
            data: $InferZodRecordOutput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<$InferZodRecordInput<Key, Value>>;
        decodeAsync(
            data: $InferZodRecordInput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<$InferZodRecordOutput<Key, Value>>;
        safeEncode(
            data: $InferZodRecordOutput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<$InferZodRecordInput<Key, Value>>;
        safeDecode(
            data: $InferZodRecordInput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>;
        safeEncodeAsync(
            data: $InferZodRecordOutput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<$InferZodRecordInput<Key, Value>>>;
        safeDecodeAsync(
            data: $InferZodRecordInput<Key>,
            params?: ParseContext<$ZodIssue>,
        ): Promise<ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>>;
        refine(
            check: (arg: $InferZodRecordOutput<Key>) => 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: $InferZodRecordOutput<Key>,
                ctx: $RefinementCtx<$InferZodRecordOutput<Key, Value>>,
            ) => void | Promise<void>,
        ): this;
        overwrite(
            fn: (x: $InferZodRecordOutput<Key>) => $InferZodRecordOutput<Key>,
        ): this;
        optional(): z.ZodOptional<z.ZodRecord<Key, Value>>;
        nonoptional(
            params?:
                | string
                | {
                    error?: string
                    | $ZodErrorMap<$ZodIssueInvalidType<unknown>>;
                    message?: string;
                },
        ): z.ZodNonOptional<z.ZodRecord<Key, Value>>;
        nullable(): z.ZodNullable<z.ZodRecord<Key, Value>>;
        nullish(): z.ZodOptional<z.ZodNullable<z.ZodRecord<Key, Value>>>;
        default(
            def: $InferZodRecordOutput<Key>,
        ): z.ZodDefault<z.ZodRecord<Key, Value>>;
        default(
            def: () => NoUndefined<$InferZodRecordOutput<Key, Value>>,
        ): z.ZodDefault<z.ZodRecord<Key, Value>>;
        prefault(
            def: () => $InferZodRecordInput<Key>,
        ): z.ZodPrefault<z.ZodRecord<Key, Value>>;
        prefault(
            def: $InferZodRecordInput<Key>,
        ): z.ZodPrefault<z.ZodRecord<Key, Value>>;
        array(): z.ZodArray<z.ZodRecord<Key, Value>>;
        or<T extends SomeType>(option: T): z.ZodUnion<[z.ZodRecord<Key, Value>, T]>;
        and<T extends SomeType>(
            incoming: T,
        ): z.ZodIntersection<z.ZodRecord<Key, Value>, T>;
        transform<NewOut>(
            transform: (
                arg: $InferZodRecordOutput<Key>,
                ctx: $RefinementCtx<$InferZodRecordOutput<Key, Value>>,
            ) => NewOut | Promise<NewOut>,
        ): z.ZodPipe<
            z.ZodRecord<Key, Value>,
            z.ZodTransform<Awaited<NewOut>, $InferZodRecordOutput<Key, Value>>,
        >;
        catch(def: $InferZodRecordOutput<Key>): z.ZodCatch<z.ZodRecord<Key, Value>>;
        catch(
            def: (ctx: $ZodCatchCtx) => $InferZodRecordOutput<Key>,
        ): z.ZodCatch<z.ZodRecord<Key, Value>>;
        pipe<
            T extends
                z.core.$ZodType<
                    any,
                    $InferZodRecordOutput<Key, Value>,
                    $ZodTypeInternals<any, $InferZodRecordOutput<Key, Value>>,
                >,
        >(
            target:
                | T
                | z.core.$ZodType<
                    any,
                    $InferZodRecordOutput<Key, Value>,
                    $ZodTypeInternals<any, $InferZodRecordOutput<Key, Value>>,
                >,
        ): z.ZodPipe<z.ZodRecord<Key, Value>, T>;
        readonly(): z.ZodReadonly<z.ZodRecord<Key, Value>>;
        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

    keyType: Key
    valueType: Value
    type: "record"

    Use .def instead.

    Use z.output<typeof schema> instead.

    Use z.input<typeof schema> instead.

    spa: (
        data: unknown,
        params?: ParseContext<$ZodIssue>,
    ) => Promise<ZodSafeParseResult<$InferZodRecordOutput<Key, Value>>>
    description?: string

    Methods

    • Parameters

      • check: (arg: $InferZodRecordOutput<Key>) => 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