@cowwoc/requirements
Version:
A fluent API for enforcing design contracts with automatic message generation.
27 lines (26 loc) • 793 B
text/typescript
/**
* Methods that validators for numbers that may be positive must contain.
*/
interface PositiveNumberComponent {
/**
* Ensures that the value is positive.
*
* @throws TypeError if the value is `undefined` or `null`
* @throws RangeError if the value is:
* <ul>
* <li>not positive</li>
* <li>not a number</li>
* </ul>
* @returns this
*/
isPositive(): this;
/**
* Ensures that the value is not a positive number.
*
* @throws TypeError if the value is `undefined` or `null`
* @throws RangeError if the value is a positive number
* @returns this
*/
isNotPositive(): this;
}
export type { PositiveNumberComponent };