import { NumberRule, NetworkPortRange } from './number/number-types'; import { Guard, IGuardOptions } from '../core/guard'; import { GuardResult } from '../core/guard-result'; export declare class NumberGuard extends Guard { constructor(options?: IGuardOptions); /** * Checks if two numbers are equals. * @remarks Chainable method. * @param value */ equals(value: number): this; /** * Checks if the fractional part of number is equal or smaller than the specified number. * @remarks Chainable method. * @param max - Max number of digits to the right of the decimal point in the number. */ hasMaxFractionDigits(max: number): this; /** * Checks if number is within a closed interval. * @remarks Chainable method. * @param min * @param max */ isBetween(min: number, max: number): this; /** * Checks if number is a composite number. * @remarks Chainable method. * @see {@link https://en.wikipedia.org/wiki/Composite_number} */ isComposite(): this; /** * Checks if number is even. * @remarks Chainable method. */ isEven(): this; /** * Checks if number is a Fibonacci or a NegaFibonacci number. * @remarks Chainable method. * @param allowNegative - Allows both positive and negative integers to be represented. Default is false. * @see {@link https://en.wikipedia.org/wiki/Fibonacci_number} * @see {@link https://en.wikipedia.org/wiki/NegaFibonacci_coding} */ isFibonacci(allowNegative?: boolean): this; /** * Checks if number is in an array of allowed number values. * @remarks Chainable method. * @param values - An array of allowed number values. */ isIn(values: number[]): this; /** * Checks if number is equal or smaller than to the specified number. * @remarks Chainable method. * @param max */ isMax(max: number): this; /** * Checks if number is equal or greater than to the specified number. * @remarks Chainable method. * @param min */ isMin(min: number): this; /** * Checks if number is a multiple of the specified number. * @remarks Chainable method. * @param value */ isMultiple(value: number): this; /** * Checks if number is smaller than zero. * @remarks Chainable method. */ isNegative(): this; /** * Checks if number is a Network Port. * @remarks Chainable method. * @param range - 'well-known' | 'registered' | 'private' */ isNetworkPort(range?: NetworkPortRange): this; /** * Checks if number is not in an array of disallowed number values. * @remarks Chainable method. * ```ts * Rule: * - Case sensitive. * ``` * @param values - An array of disallowed number values. */ isNotIn(values: number[]): this; /** * Checks if number is odd. * @remarks Chainable method. */ isOdd(): this; /** * Checks if number is greater than zero. * @remarks Chainable method. */ isPositive(): this; /** * Checks if number is a prime number. * @remarks Chainable method. * @see {@link https://en.wikipedia.org/wiki/Prime_number} */ isPrime(): this; /** * Checks if number is a whole number. * @remarks Chainable method. */ isWhole(): this; /** * @override * @param rule * @param value */ protected checkRule(rule: NumberRule, value: number): GuardResult; /** * @override */ protected typeGuard(): void; }