@typescript-package/range
Version:
A lightweight TypeScript library for managing various types of ranges.
54 lines (53 loc) • 2.84 kB
TypeScript
/**
* The `Less` primitive wrapper `object` represents the primitive value of `number` type less than the given.
*/
export declare class Less<Value extends number> extends Number {
/**
* The `get` accessor, with the help of `toStringTag`, changes the default tag to `Less` for an instance of `Less`. It can be read
* by the `typeOf()` function of `@angular-package/type`.
* @returns The return value is the word 'Less` of a `string`.
*/
get [Symbol.toStringTag](): string;
/**
* Creates the `Less` instance with the given primitive `value`.
* @param value The value of generic type variable `Value` to set with a newly created instance.
* @returns The return value is the `Less` instance with the primitive value of the given `value`.
*/
static create<Value extends number>(value: Value): Less<Value>;
/**
* Checks whether the given `value` is the `Less` instance of any or given primitive value.
* @param value The value of any type to test against the `Less` instance.
* @param lessValue An optional value of generic type variable `Value` to check whether it's the primitive value of the given `value`.
* @returns The return value is a `boolean` indicating whether the given `value` is the `Less` instance of any or given primitive
* value.
*/
static isLess<Value extends number>(value: any, lessValue?: Value): value is Less<Value>;
/**
* Creates the `Less` instance with the given `value`.
* @param value The value of generic type variable `Value` to set with a new instance.
*/
constructor(value: Value);
/**
* Checks whether the primitive value of a specified `object` is less than the given `value`.
* @param value The value of number type to test.
* @returns The return value is a `boolean` indicating whether the primitive value is less than the given value.
*/
than(value: number): boolean;
/**
* Checks whether the primitive value of a specified `object` is less than every given value.
* @param values A rest parameter of the numbers to test.
* @returns The return value is a `boolean` indicating whether the primitive value is less than every value of the given `values`.
*/
thanEvery(...values: number[]): boolean;
/**
* Checks whether the primitive value of a specified `object` is less than some given `values`.
* @param values A rest parameter of the numbers to test.
* @returns The return value is a `boolean` indicating whether the primitive value is less than some given `values`.
*/
thanSome(...values: number[]): boolean;
/**
* Returns the primitive value of a specified `object`.
* @returns The return value is the primitive value of generic type variable `Value`.
*/
valueOf(): Value;
}