UNPKG

@typescript-package/range

Version:

A lightweight TypeScript library for managing various types of ranges.

54 lines (53 loc) 2.94 kB
/** * The `Greater` primitive wrapper `object` represents the primitive value of the `number` type greater than the given. */ export declare class Greater<Value extends number> extends Number { /** * The `get` accessor, with the help of `toStringTag`, changes the default tag to `'Greater'` for an instance of `Greater`. It can be read * by the `typeOf()` function of `@angular-package/type`. * @returns The return value is the word 'Greater` of a `string`. */ get [Symbol.toStringTag](): string; /** * Creates the `Greater` 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 `Greater` instance with the primitive value of the given `value`. */ static create<Value extends number>(value: Value): Greater<Value>; /** * Checks whether the given `value` is the `Greater` instance of any or given primitive value. * @param value The value of any type to test against the `Greater` instance. * @param greaterValue 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 `Greater` instance of any or given primitive * value. */ static isGreater<Value extends number>(value: any, greaterValue?: Value): value is Greater<Value>; /** * Creates the `Greater` instance with the given primitive `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 greater 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 greater than the given value. */ than(value: number): boolean; /** * Checks whether the primitive value of a specified `object` is greater than every value of the 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 greater than every value of the given `values`. */ thanEvery(...values: number[]): boolean; /** * Checks whether the primitive value of a specified `object` is greater 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 greater 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; }