UNPKG

@typescript-package/range

Version:

A lightweight TypeScript library for managing various types of ranges.

36 lines (35 loc) 1.96 kB
import { Inequality } from './inequality.class'; /** * The `Maximum` primitive wrapper object extended by the `Inequality` abstract primitive wrapper `object` represents the maximum number * greater or less than the given. */ export declare class Maximum<Value extends number> extends Inequality<Value> { /** * The `get` accessor, with the help of `toStringTag`, changes the default tag to `'Maximum'` for an instance of `Maximum`. It can be read * by the `typeOf()` function of `@angular-package/type`. */ get [Symbol.toStringTag](): string; /** * Creates the `Maximum` instance with the given primitive `value`. * @param value The maximum number of generic type variable `Value` to set with a new instance. * @returns The return value is the `Maximum` instance of the given primitive `value`. */ static create<Value extends number>(value: Value): Maximum<Value>; /** * Checks whether the value of any type is the `Maximum` instance of any or the given primitive value. * @param value The value of any type to test against the `Maximum` instance. * @param max Optional maximum of the generic type variable `Value` to check if it's the primitive value of the given `value`. * @returns The return value is a `boolean` indicating whether the provided value is an instance of `Maximum`. */ static isMaximum<Value extends number>(value: any, max?: Value): value is Maximum<Value>; /** * Creates the `Maximum` instance of the given primitive `value`. * @param value The value of the generic type variable `Value` is the primitive value of the new instance. */ constructor(value: Value); /** * The `valueOf()` method returns the primitive value of the generic type variable `Value` of the specified `Maximum` object. * @returns The return value is the primitive value of the generic type variable `Value`. */ valueOf(): Value; }