/** * Defines an abstract class with number utilities. */ export declare abstract class Numbers { /** * Contains the max safe integer. */ static readonly MAX_SAFE_INT: number; /** * Contains the min safe integer. */ static readonly MIN_SAFE_INT: number; /** * @constructor * * @private */ private constructor(); /** * Gets the absolute value of the given number. * * @param {Number} num Contains some number. * @return {Number} the absolute value of the given number. */ static abs(num: number): number; /** * Compares two numbers. Useful for array sorting. * * @param {Number} a Contains some number. * @param {Number} b Contains some other number. * @return {Number} * * `-1` if `a` is smaller than `b`. * * `0` if `a` equals `b`. * * `1` if `a` is greater than `b`. */ static compare(a: number, b: number): number; /** * Checks whether the specified value is a `bigint` primitive. * * @param {*} value Contains some value. * @return {Boolean} whether the specified value is a `bigint` primitive. */ static isBigInt(value?: any): value is bigint; /** * Checks whether the specified value is a `BigInt` object. * * @param {*} value Contains some value. * @return {Boolean} whether the specified value is a `BigInt` object. */ static isBigIntObject(value?: any): value is (typeof BigInt extends undefined ? false : BigInt); /** * Checks whether the given value is a positive integer. * * @param {*} value Contains some value. * @param {Boolean} safeInt Contains whether the integer should be between * `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`. Defaults to * `false`. * @return {Boolean} whether the given value is an integer. */ static isInteger(value?: any, safeInt?: boolean): value is number; /** * Checks whether the given value is greater than or equal 0. * * @param {*} value Contains some value. * @param {Boolean} safeInt Contains whether the integer should be between * 1 and `Number.MAX_SAFE_INTEGER`. Defaults to * `false`. * @return {Boolean} whether the given value is a natural number * i. e. greater than or equal 0. */ static isNatural(value?: any, safeInt?: boolean): value is number; /** * Checks whether the specified value equals `NaN`. * * @param {*} value * @return {Boolean} whether the specified value is not a number. * * @since v1.5.6 */ static isNotNumber(value?: any): value is typeof Number.NaN; /** * Checks whether the given value is a number. * * @param {*} value Contains some value. * @return {Boolean} whether the given value is a number. */ static isNumber(value?: any): value is number; /** * Checks whether the specified value is an instance of the `Number` * object. * * **Usage Examples:** * ```typescript * Numbers.isNumberObject(); // false * Numbers.isNumberObject(5); // false * Numbers.isNumberObject("44"); // false * Numbers.isNumberObject(new Number(12)); // true * ``` * * @param {*} value Contains some value. * @return {Boolean} whether the specified value is an instance * of the `Number` object. */ static isNumberObject(value?: any): value is Number; /** * Checks whether the given value is a positive integer. * * @param {*} value Contains some value. * @param {Boolean} safeInt Contains whether the integer should be between * 1 and `Number.MAX_SAFE_INTEGER`. Defaults to * `false`. * @return {Boolean} whether the given value is a positive integer. */ static isPositiveInteger(value?: any, safeInt?: boolean): value is number; /** * Checks whether the specified number is a prime number. * * @param {Number} num Contains some number. * @return {Boolean} whether the specified number is a prime number. */ static isPrime(num: number): boolean; /** * Pads the specified number. * * @param {Number} num Contains some number. * @return {String} a string. * * @since v1.5.13 */ static pad(num: number): string; /** * Get a random integer in the specified range. * * @param {Number} min Contains the minimum for the random integer. * @param {Number} max Contains the maximum for the random integer. * @param {Boolean} incl Contains whether to include `min` and `max`. * Defaults to `false`; * @return {Number} a random integer in the specified range. */ static randomInt(min: number, max: number, incl?: boolean): number; /** * Converts the specified number to string. * * **Usage Examples:** * ```typescript * Numbers.toString(123); // "123" * Numbers.toString(12.3); // "12.3" * ``` * * @param {Number} num Contains some number. * @return {String} a string. */ static toString(num: number): string; }