UNPKG

@typescript-package/core

Version:

A TypeScript library with features used across other `typescript-package` libraries.

44 lines (43 loc) 1.42 kB
/** * @description The class to manage the value of generic type variable `Type`. * @export * @abstract * @class Value * @template Type The type of the privately stored `#value`. */ export declare abstract class Value<Type> { #private; /** * @description Returns the `string` tag representation of the `Value` class when used in `Object.prototype.toString.call(instance)`. * The `tag` getter returns the actual class name defined with the `Symbol.toStringTag()` of the child class. * @public * @readonly * @type {string} */ get [Symbol.toStringTag](): string; /** * @description Returns the string tag of the current instance defined by the `Symbol.toStringTag`. * @public * @returns {string | undefined} The extracted class name, such as `'Value'`, or `undefined` if extraction fails. */ get tag(): string | undefined; /** * @description Returns the privately stored value of generic type variable `Type`. * @public * @readonly * @type {Type} */ get value(): Type; /** * Creates an instance of child class. * @constructor * @param {Type} value The value of generic type variable `Type`. */ constructor(value: Type); /** * @description Sets the value of generic type variable `Type`. * @protected * @returns {this} */ protected setValue(value: Type): this; }