UNPKG

@typescript-package/history

Version:

A lightweight TypeScript package for tracking the history of values.

22 lines (21 loc) 1.07 kB
import { Data, DataCore, DataConstructorInput } from '@typescript-package/data'; import { HistoryPrepend } from '../core'; /** * @description Manages the redo history with prepend mechanism. * @export * @class RedoHistory * @template [Value=any] The type of elements stored in the history * @template {number} [Size=number] The maximum size of the history. * @template {DataCore<readonly Value[]>} [DataType=Data<readonly Value[]>] * @extends {HistoryPrepend<Value, Size, DataType>} */ export declare class RedoHistory<Value = any, Size extends number = number, DataType extends DataCore<readonly Value[]> = Data<readonly Value[]>> extends HistoryPrepend<Value, Size, DataType> { /** * Creates an instance of `RedoHistory`. * @constructor * @param {Size} [size=RedoHistory.size as Size] * @param {?readonly [Value]} [initialValue] * @param {?DataConstructorInput<readonly Value[], DataType>} [data] */ constructor(size?: Size, initialValue?: readonly Value[], data?: DataConstructorInput<readonly Value[], DataType>); }