@morojs/moro


@morojs/moro / z / ZodCoercedNumber

Interface: ZodCoercedNumber<T>

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

Extends

Type Parameters

T

T = unknown

Properties

~~_def~~

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

Deprecated

Use .def instead.

Inherited from

_ZodNumber._def


~~_input~~

_input: T

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

Deprecated

Use z.input<typeof schema> instead.

Inherited from

_ZodNumber._input


~~_output~~

_output: number

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

Deprecated

Use z.output<typeof schema> instead.

Inherited from

_ZodNumber._output


_zod

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

Inherited from

_ZodNumber._zod


~standard

~standard: $ZodStandardSchema<ZodCoercedNumber<T>>

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

Inherited from

_ZodNumber.~standard


def

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

Inherited from

_ZodNumber.def


description?

optional description: string

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

Inherited from

_ZodNumber.description


format

format: null | string

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

Inherited from

_ZodNumber.format


~~isFinite~~

isFinite: boolean

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

Deprecated

Number schemas no longer accept infinite values, so this always returns true.

Inherited from

_ZodNumber.isFinite


~~isInt~~

isInt: boolean

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

Deprecated

Check the format property instead.

Inherited from

_ZodNumber.isInt


maxValue

maxValue: null | number

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

Inherited from

_ZodNumber.maxValue


minValue

minValue: null | number

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

Inherited from

_ZodNumber.minValue


spa()

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

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

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<number>>

Inherited from

_ZodNumber.spa


type

type: "number"

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

Inherited from

_ZodNumber.type

Methods

and()

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

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

Type Parameters

T

T extends SomeType

Parameters

incoming

T

Returns

ZodIntersection<ZodCoercedNumber<T>, T>

Inherited from

_ZodNumber.and


array()

array(): ZodArray<ZodCoercedNumber<T>>

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

Returns

ZodArray<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.array


brand()

brand<T>(value?): PropertyKey extends T ? ZodCoercedNumber<T> : $ZodBranded<ZodCoercedNumber<T>, 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 ? ZodCoercedNumber<T> : $ZodBranded<ZodCoercedNumber<T>, T>

Inherited from

_ZodNumber.brand


catch()

Call Signature

catch(def): ZodCatch<ZodCoercedNumber<T>>

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

Parameters
def

number

Returns

ZodCatch<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.catch

Call Signature

catch(def): ZodCatch<ZodCoercedNumber<T>>

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

Parameters
def

(ctx) => number

Returns

ZodCatch<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.catch


check()

check(...checks): this

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

Parameters

checks

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

Returns

this

Inherited from

_ZodNumber.check


clone()

clone(def?, params?): this

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

Parameters

def?

$ZodNumberDef

params?
parent

boolean

Returns

this

Inherited from

_ZodNumber.clone


decode()

decode(data, params?): number

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

Parameters

data

T

params?

ParseContext<$ZodIssue>

Returns

number

Inherited from

_ZodNumber.decode


decodeAsync()

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

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

Parameters

data

T

params?

ParseContext<$ZodIssue>

Returns

Promise<number>

Inherited from

_ZodNumber.decodeAsync


default()

Call Signature

default(def): ZodDefault<ZodCoercedNumber<T>>

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

Parameters
def

number

Returns

ZodDefault<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.default

Call Signature

default(def): ZodDefault<ZodCoercedNumber<T>>

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

Parameters
def

() => number

Returns

ZodDefault<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.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

_ZodNumber.describe


encode()

encode(data, params?): T

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

Parameters

data

number

params?

ParseContext<$ZodIssue>

Returns

T

Inherited from

_ZodNumber.encode


encodeAsync()

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

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

Parameters

data

number

params?

ParseContext<$ZodIssue>

Returns

Promise<T>

Inherited from

_ZodNumber.encodeAsync


~~finite()~~

finite(params?): this

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

Parameters

params?

unknown

Returns

this

Deprecated

In v4 and later, z.number() does not allow infinite values by default. This is a no-op.

Inherited from

_ZodNumber.finite


gt()

gt(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.gt


gte()

gte(value, params?): this

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

Identical to .min()

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.gte


int()

int(params?): this

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

Consider z.int() instead. This API is considered legacy; it will never be removed but a better alternative exists.

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssueInvalidType<unknown> | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<NonNullable<$ZodIssueInvalidType<unknown> | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.int


~~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

_ZodNumber.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

_ZodNumber.isOptional


lt()

lt(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.lt


lte()

lte(value, params?): this

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

Identical to .max()

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.lte


max()

max(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.max


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

_ZodNumber.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

_ZodNumber.meta


min()

min(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.min


multipleOf()

multipleOf(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueNotMultipleOf<number | bigint>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueNotMultipleOf<number | bigint>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.multipleOf


negative()

negative(params?): this

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

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.negative


nonnegative()

nonnegative(params?): this

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

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.nonnegative


nonoptional()

nonoptional(params?): ZodNonOptional<ZodCoercedNumber<T>>

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<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.nonoptional


nonpositive()

nonpositive(params?): this

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

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooBig<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.nonpositive


nullable()

nullable(): ZodNullable<ZodCoercedNumber<T>>

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

Returns

ZodNullable<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.nullable


nullish()

nullish(): ZodOptional<ZodNullable<ZodCoercedNumber<T>>>

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

Returns

ZodOptional<ZodNullable<ZodCoercedNumber<T>>>

Inherited from

_ZodNumber.nullish


optional()

optional(): ZodOptional<ZodCoercedNumber<T>>

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

Returns

ZodOptional<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.optional


or()

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

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

Type Parameters

T

T extends SomeType

Parameters

option

T

Returns

ZodUnion<[ZodCoercedNumber<T>, T]>

Inherited from

_ZodNumber.or


overwrite()

overwrite(fn): this

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

Parameters

fn

(x) => number

Returns

this

Inherited from

_ZodNumber.overwrite


parse()

parse(data, params?): number

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

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

number

Inherited from

_ZodNumber.parse


parseAsync()

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

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

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<number>

Inherited from

_ZodNumber.parseAsync


pipe()

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

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

Type Parameters

T

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

Parameters

target

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

Returns

ZodPipe<ZodCoercedNumber<T>, T>

Inherited from

_ZodNumber.pipe


positive()

positive(params?): this

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

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueTooSmall<Numeric>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Inherited from

_ZodNumber.positive


prefault()

Call Signature

prefault(def): ZodPrefault<ZodCoercedNumber<T>>

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

Parameters
def

() => T

Returns

ZodPrefault<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.prefault

Call Signature

prefault(def): ZodPrefault<ZodCoercedNumber<T>>

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

Parameters
def

T

Returns

ZodPrefault<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.prefault


readonly()

readonly(): ZodReadonly<ZodCoercedNumber<T>>

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

Returns

ZodReadonly<ZodCoercedNumber<T>>

Inherited from

_ZodNumber.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

_ZodNumber.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

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

Returns

this

Inherited from

_ZodNumber.register


~~safe()~~

safe(params?): this

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

Parameters

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssueInvalidType<unknown> | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<NonNullable<$ZodIssueInvalidType<unknown> | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Deprecated

This is now identical to .int(). Only numbers in the safe integer range are accepted.

Inherited from

_ZodNumber.safe


safeDecode()

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

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

Parameters

data

T

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<number>

Inherited from

_ZodNumber.safeDecode


safeDecodeAsync()

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

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

Parameters

data

T

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<number>>

Inherited from

_ZodNumber.safeDecodeAsync


safeEncode()

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

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

Parameters

data

number

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<T>

Inherited from

_ZodNumber.safeEncode


safeEncodeAsync()

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

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

Parameters

data

number

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<T>>

Inherited from

_ZodNumber.safeEncodeAsync


safeParse()

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

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

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<number>

Inherited from

_ZodNumber.safeParse


safeParseAsync()

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

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

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<number>>

Inherited from

_ZodNumber.safeParseAsync


~~step()~~

step(value, params?): this

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

Parameters

value

number

params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<$ZodIssueNotMultipleOf<number | bigint>>; message?: string; }

abort?

boolean

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

error?

string | $ZodErrorMap<$ZodIssueNotMultipleOf<number | bigint>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

this

Deprecated

Use .multipleOf() instead.

Inherited from

_ZodNumber.step


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

_ZodNumber.superRefine


transform()

transform<NewOut>(transform): ZodPipe<ZodCoercedNumber<T>, ZodTransform<Awaited<NewOut>, number>>

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

Type Parameters

NewOut

NewOut

Parameters

transform

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

Returns

ZodPipe<ZodCoercedNumber<T>, ZodTransform<Awaited<NewOut>, number>>

Inherited from

_ZodNumber.transform