Validates that the number is finite (rejects Infinity and -Infinity).
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the finite validator applied
Validates that the number is an exact multiple of n.
Uses a relative tolerance of 1e-10 for float-safe comparison.
the divisor to check against
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the multipleOf validator applied
Validates that the number is strictly less than zero.
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the negative validator applied
Constrains the number to one of the specified literal values.
Narrows the inferred type from number to the union of the
provided literals.
a new schema builder restricted to the given values
Constrains the number to one of the specified literal values, with a custom error message or factory as the last argument.
Constrains the number to one of the specified literal values, with an optional custom error message or factory.
the allowed number literals as an array
OptionalerrorMessage: ValidationErrorMessageProvider<optional custom error message or factory function
a new schema builder restricted to the given values
Validates that the number is strictly greater than zero.
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the positive validator applied
Methods added to
NumberSchemaBuilderby the built-in number extension pack.WORKAROUND: This interface duplicates the method signatures from
numberExtensionsso that JSDoc survives into the published.d.tsfiles. TypeScript strips JSDoc when method signatures are reconstructed through theFixedMethodsmapped type (conditionalinferloses comments). Remove this interface once TypeScript preserves JSDoc through mapped types / conditional type inference.See
https://github.com/microsoft/TypeScript/issues/50715