UNPKG

@typescript-package/range

Version:

A lightweight TypeScript library for managing various types of ranges.

36 lines (35 loc) 2.05 kB
import { Inequality } from './inequality.class'; /** * The `Minimum` primitive wrapper object extended by the `Inequality` abstract primitive wrapper `object` represents the minimum number * greater or less than the given. */ export declare class Minimum<Value extends number> extends Inequality<Value> { /** * The property, with the help of `toStringTag`, changes the default tag to `'Minimum'` for an instance of `Minimum`. It can be read by * the `typeOf()` function of `@angular-package/type`. */ get [Symbol.toStringTag](): string; /** * The static `create()` method creates the `Minimum` instance with the given primitive `value`. * @param value The minimum number of generic type variable `Value` to set with a new instance. * @returns The return value is the `Minimum` instance with the primitive value of the given `value`. */ static create<Value extends number>(value: Value): Minimum<Value>; /** * The static `isMinimum()` method checks the provided `value` of any type whether is an instance of `Minimum` of any or the given `min`. * @param value The value of any type to test against the `Minimum` instance. * @param max Optional minimum 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 `Minimum` of any or the given `min`. */ static isMinimum<Value extends number>(value: any, min?: Value): value is Minimum<Value>; /** * Creates the `Minimum` 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 generic type variable `Value` of the specified `Minimum` object. * @returns The return value is the primitive value of generic type variable `Value`. */ valueOf(): Value; }