@typescript-package/history
Version:
A lightweight TypeScript package for tracking the history of values.
22 lines (21 loc) • 1.06 kB
TypeScript
import { Data, DataCore, DataConstructorInput } from '@typescript-package/data';
import { HistoryAppend } from '../core';
/**
* @description Manages the undo history with append mechanism.
* @export
* @class UndoHistory
* @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 {HistoryAppend<Value, Size, DataType>}
*/
export declare class UndoHistory<Value = any, Size extends number = number, DataType extends DataCore<readonly Value[]> = Data<readonly Value[]>> extends HistoryAppend<Value, Size, DataType> {
/**
* Creates an instance of `UndoHistory`.
* @constructor
* @param {Size} [size=HistoryAppend.size as Size]
* @param {?readonly [Value]} [initialValue]
* @param {?DataConstructorInput<readonly Value[], DataType>} [data]
*/
constructor(size?: Size, initialValue?: readonly Value[], data?: DataConstructorInput<readonly Value[], DataType>);
}