@morojs/moro


@morojs/moro / z / ZodBoolean

Interface: ZodBoolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:326

Extends

Properties

~~_def~~

Defined in: node_modules/zod/v4/classic/schemas.d.cts:8

Deprecated

Use .def instead.

Inherited from

_ZodBoolean._def


~~_input~~

_input: boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:12

Deprecated

Use z.input<typeof schema> instead.

Inherited from

_ZodBoolean._input


~~_output~~

_output: boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:10

Deprecated

Use z.output<typeof schema> instead.

Inherited from

_ZodBoolean._output


_zod

Defined in: node_modules/zod/v4/core/schemas.d.cts:89

Inherited from

_ZodBoolean._zod


~standard

~standard: $ZodStandardSchema<ZodBoolean>

Defined in: node_modules/zod/v4/core/schemas.d.cts:90

Inherited from

_ZodBoolean.~standard


def

Defined in: node_modules/zod/v4/classic/schemas.d.cts:5

Inherited from

_ZodBoolean.def


description?

optional description: string

Defined in: node_modules/zod/v4/classic/schemas.d.cts:53

Inherited from

ZodCoercedDate.description


spa()

spa: (data, params?) => Promise<ZodSafeParseResult<boolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:23

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<boolean>>

Inherited from

_ZodBoolean.spa


type

type: "boolean"

Defined in: node_modules/zod/v4/classic/schemas.d.cts:6

Inherited from

_ZodBoolean.type

Methods

and()

and<T>(incoming): ZodIntersection<ZodBoolean, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:45

Type Parameters

T

T extends SomeType

Parameters

incoming

T

Returns

ZodIntersection<ZodBoolean, T>

Inherited from

_ZodBoolean.and


array()

array(): ZodArray<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:43

Returns

ZodArray<ZodBoolean>

Inherited from

_ZodBoolean.array


brand()

brand<T>(value?): PropertyKey extends T ? ZodBoolean : $ZodBranded<ZodBoolean, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:18

Type Parameters

T

T extends PropertyKey = PropertyKey

Parameters

value?

T

Returns

PropertyKey extends T ? ZodBoolean : $ZodBranded<ZodBoolean, T>

Inherited from

_ZodBoolean.brand


catch()

Call Signature

catch(def): ZodCatch<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:47

Parameters
def

boolean

Returns

ZodCatch<ZodBoolean>

Inherited from

_ZodBoolean.catch

Call Signature

catch(def): ZodCatch<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:48

Parameters
def

(ctx) => boolean

Returns

ZodCatch<ZodBoolean>

Inherited from

_ZodBoolean.catch


check()

check(...checks): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:13

Parameters

checks

...($ZodCheck<boolean> | CheckFn<boolean>)[]

Returns

this

Inherited from

_ZodBoolean.check


clone()

clone(def?, params?): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:14

Parameters

def?

$ZodBooleanDef

params?
parent

boolean

Returns

this

Inherited from

_ZodBoolean.clone


decode()

decode(data, params?): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:25

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

boolean

Inherited from

_ZodBoolean.decode


decodeAsync()

decodeAsync(data, params?): Promise<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:27

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

Promise<boolean>

Inherited from

_ZodBoolean.decodeAsync


default()

Call Signature

default(def): ZodDefault<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:39

Parameters
def

boolean

Returns

ZodDefault<ZodBoolean>

Inherited from

_ZodBoolean.default

Call Signature

default(def): ZodDefault<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:40

Parameters
def

() => boolean

Returns

ZodDefault<ZodBoolean>

Inherited from

_ZodBoolean.default


describe()

describe(description): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:52

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

Parameters

description

string

Returns

this

Inherited from

_ZodBoolean.describe


encode()

encode(data, params?): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:24

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

boolean

Inherited from

_ZodBoolean.encode


encodeAsync()

encodeAsync(data, params?): Promise<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:26

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

Promise<boolean>

Inherited from

_ZodBoolean.encodeAsync


~~isNullable()~~

isNullable(): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:74

Returns

boolean

Deprecated

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

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

Inherited from

_ZodBoolean.isNullable


~~isOptional()~~

isOptional(): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:65

Returns

boolean

Deprecated

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

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

Inherited from

_ZodBoolean.isOptional


meta()

Call Signature

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

Defined in: node_modules/zod/v4/classic/schemas.d.cts:55

Returns the metadata associated with this instance in z.globalRegistry

Returns

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

Inherited from

_ZodBoolean.meta

Call Signature

meta(data): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:57

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

Returns

this

Inherited from

_ZodBoolean.meta


nonoptional()

nonoptional(params?): ZodNonOptional<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:36

Parameters

params?

string |

{ error?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>; message?: string; }

error?

string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

ZodNonOptional<ZodBoolean>

Inherited from

_ZodBoolean.nonoptional


nullable()

nullable(): ZodNullable<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:37

Returns

ZodNullable<ZodBoolean>

Inherited from

_ZodBoolean.nullable


nullish()

nullish(): ZodOptional<ZodNullable<ZodBoolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:38

Returns

ZodOptional<ZodNullable<ZodBoolean>>

Inherited from

_ZodBoolean.nullish


optional()

optional(): ZodOptional<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:35

Returns

ZodOptional<ZodBoolean>

Inherited from

_ZodBoolean.optional


or()

or<T>(option): ZodUnion<[ZodBoolean, T]>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:44

Type Parameters

T

T extends SomeType

Parameters

option

T

Returns

ZodUnion<[ZodBoolean, T]>

Inherited from

_ZodBoolean.or


overwrite()

overwrite(fn): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:34

Parameters

fn

(x) => boolean

Returns

this

Inherited from

_ZodBoolean.overwrite


parse()

parse(data, params?): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:19

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

boolean

Inherited from

_ZodBoolean.parse


parseAsync()

parseAsync(data, params?): Promise<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:21

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<boolean>

Inherited from

_ZodBoolean.parseAsync


pipe()

pipe<T>(target): ZodPipe<ZodBoolean, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:49

Type Parameters

T

T extends $ZodType<any, boolean, $ZodTypeInternals<any, boolean>>

Parameters

target

T | $ZodType<any, boolean, $ZodTypeInternals<any, boolean>>

Returns

ZodPipe<ZodBoolean, T>

Inherited from

_ZodBoolean.pipe


prefault()

Call Signature

prefault(def): ZodPrefault<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:41

Parameters
def

() => boolean

Returns

ZodPrefault<ZodBoolean>

Inherited from

_ZodBoolean.prefault

Call Signature

prefault(def): ZodPrefault<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:42

Parameters
def

boolean

Returns

ZodPrefault<ZodBoolean>

Inherited from

_ZodBoolean.prefault


readonly()

readonly(): ZodReadonly<ZodBoolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:50

Returns

ZodReadonly<ZodBoolean>

Inherited from

_ZodBoolean.readonly


refine()

refine(check, params?): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:32

Parameters

check

(arg) => unknown

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>; message?: string; params?: Record<string, any>; path?: PropertyKey[]; when?: (payload) => boolean; }

abort?

boolean

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

error?

string | $ZodErrorMap<NonNullable<$ZodIssue>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

params?

Record<string, any>

path?

PropertyKey[]

when?

(payload) => boolean

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

Returns

this

Inherited from

_ZodBoolean.refine


register()

register<R>(registry, ...meta): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:17

Type Parameters

R

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

Parameters

registry

R

meta

...ZodBoolean extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], R["_schema"] & ZodBoolean>?] : [$replace<R["_meta"], R["_schema"] & ZodBoolean>] : ["Incompatible schema"]

Returns

this

Inherited from

_ZodBoolean.register


safeDecode()

safeDecode(data, params?): ZodSafeParseResult<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:29

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<boolean>

Inherited from

_ZodBoolean.safeDecode


safeDecodeAsync()

safeDecodeAsync(data, params?): Promise<ZodSafeParseResult<boolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:31

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<boolean>>

Inherited from

_ZodBoolean.safeDecodeAsync


safeEncode()

safeEncode(data, params?): ZodSafeParseResult<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:28

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<boolean>

Inherited from

_ZodBoolean.safeEncode


safeEncodeAsync()

safeEncodeAsync(data, params?): Promise<ZodSafeParseResult<boolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:30

Parameters

data

boolean

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<boolean>>

Inherited from

_ZodBoolean.safeEncodeAsync


safeParse()

safeParse(data, params?): ZodSafeParseResult<boolean>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:20

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<boolean>

Inherited from

_ZodBoolean.safeParse


safeParseAsync()

safeParseAsync(data, params?): Promise<ZodSafeParseResult<boolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:22

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<boolean>>

Inherited from

_ZodBoolean.safeParseAsync


superRefine()

superRefine(refinement): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:33

Parameters

refinement

(arg, ctx) => void | Promise<void>

Returns

this

Inherited from

_ZodBoolean.superRefine


transform()

transform<NewOut>(transform): ZodPipe<ZodBoolean, ZodTransform<Awaited<NewOut>, boolean>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:46

Type Parameters

NewOut

NewOut

Parameters

transform

(arg, ctx) => NewOut | Promise<NewOut>

Returns

ZodPipe<ZodBoolean, ZodTransform<Awaited<NewOut>, boolean>>

Inherited from

_ZodBoolean.transform