UNPKG

@typescript-package/data

Version:

A lightweight TypeScript library for basic data management.

32 lines (31 loc) 1.04 kB
import { ReadonlyData } from './readonly-data.class'; /** * @description A class that stores and returns an immutable version of the provided value. * The value is frozen at runtime and marked as `readonly` at type level. * @export * @class ImmutableData * @template Type The original input type. * @extends {ReadonlyData<Type>} */ export declare class ImmutableData<Type> extends ReadonlyData<Type> { /** * @description Returns the `string` tag representation of the `ImmutableData` class when used in `Object.prototype.toString.call(instance)`. * @public * @readonly * @type {string} */ get [Symbol.toStringTag](): string; /** * Creates an instance of `ImmutableData`. * @constructor * @param {Type} value Initial value to store. */ constructor(value: Type); /** * @description Sets the data value. * @public * @param {Type} value The data value of `Type` to set. * @returns {this} The `this` current instance. */ set(value: Type): this; }