@typescript-package/history
Version:
A TypeScript package for tracking the history of values.
1 lines • 29.3 kB
Source Map (JSON)
{"version":3,"file":"typescript-package-history.mjs","sources":["../../../package/history/src/lib/peek/redo-history-peek.class.ts","../../../package/history/src/lib/peek/undo-history-peek.class.ts","../../../package/history/src/lib/peek/history-peek.class.ts","../../../package/history/src/lib/history-core.abstract.ts","../../../package/history/src/lib/history-prepend.abstract.ts","../../../package/history/src/lib/redo-history.class.ts","../../../package/history/src/lib/history-append.abstract.ts","../../../package/history/src/lib/undo-history.class.ts","../../../package/history/src/lib/history.abstract.ts","../../../package/history/src/public-api.ts","../../../package/history/src/typescript-package-history.ts"],"sourcesContent":["// Abstract.\nimport { History } from '../history.abstract';\n/**\n * @description \n * @export\n * @class RedoHistoryPeek\n * @template Type \n */\nexport class RedoHistoryPeek<Type> {\n /**\n * Creates an instance of `RedoHistoryPeek` child class.\n * @constructor\n * @param {History<Type>} history \n */\n constructor(private readonly history: History<Type>) {}\n\n /**\n * @description\n * @public\n * @param {number} [index=0] \n * @returns {(Type | undefined)} \n */\n public index(index: number = 0): Type | undefined {\n return this.history.redoHistory.peek(index);\n }\n\n /**\n * @description\n * @public\n * @returns {(Type | undefined)} \n */\n public last(): Type | undefined {\n return this.history.redoHistory.peekLast();\n }\n\n /**\n * @description\n * @public\n * @returns {(Type | undefined)} \n */\n public next(): Type | undefined {\n return this.history.redoHistory.peekNext();\n }\n}\n","// Abstract.\nimport { History } from '../history.abstract';\n/**\n * @description The class \n * @export\n * @class UndoHistoryPeek\n * @template Type \n */\nexport class UndoHistoryPeek<Type> {\n /**\n * Creates an instance of `UndoHistoryPeek` child class.\n * @constructor\n * @param {History<Type>} history \n */\n constructor(private readonly history: History<Type>) {}\n\n /**\n * @description\n * @public\n * @param {number} [index=this.history.undoHistory.length - 1] \n * @returns {(Type | undefined)} \n */\n public index(index: number = this.history.undoHistory.length - 1): Type | undefined {\n return this.history.undoHistory.peek(index);\n }\n\n /**\n * @description\n * @public\n * @returns {(Type | undefined)} \n */\n public last(): Type | undefined {\n return this.history.undoHistory.peekLast();\n }\n\n /**\n * @description\n * @public\n * @returns {(Type | undefined)} \n */\n public next(): Type | undefined {\n return this.history.undoHistory.peekNext();\n }\n}\n","// Abstract.\nimport { History } from \"../history.abstract\";\nimport { RedoHistoryPeek } from \"./redo-history-peek.class\";\nimport { UndoHistoryPeek } from \"./undo-history-peek.class\";\n/**\n * @description\n * @export\n * @class HistoryPeek\n * @template Type \n */\nexport class HistoryPeek<Type> {\n /**\n * @description\n * @public\n * @readonly\n * @type {*}\n */\n public get redo() {\n return this.#redo;\n }\n\n /**\n * @description\n * @public\n * @readonly\n * @type {*}\n */\n public get undo() {\n return this.#undo;\n }\n\n /**\n * @description\n * @readonly\n * @type {*}\n */\n readonly #undo;\n\n /**\n * @description\n * @readonly\n * @type {*}\n */\n readonly #redo;\n\n /**\n * Creates an instance of `HistoryPeek`.\n * @constructor\n * @param {History<Type>} history \n */\n constructor(history: History<Type>) {\n this.#redo = new RedoHistoryPeek(history);\n this.#undo = new UndoHistoryPeek(history);\n }\n}\n","/**\n * @description The core class for history append and prepend.\n * @export\n * @abstract\n * @class HistoryCore\n * @template Type \n * @template {number} [Size=number] \n */\nexport abstract class HistoryCore<Type, Size extends number = number> {\n /**\n * @description A private property for history of `WeakMap` type.\n * @static\n * @readonly\n * @type {WeakMap}\n */\n static readonly #history = new WeakMap<any, any[]>();\n\n /**\n * @description Returns the `string` tag representation of the `HistoryCore` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n * @type {string}\n */\n public get [Symbol.toStringTag](): string {\n return HistoryCore.name;\n }\n \n /**\n * @description Gets the history.\n * @protected\n * @readonly\n * @type {Type[]}\n */\n protected get history(): Type[] {\n return HistoryCore.#history.get(this) as Type[];\n }\n\n /**\n * @description The length of the history.\n * @public\n * @readonly\n * @type {number}\n */\n public get length(): number {\n return this.history.length;\n }\n\n /**\n * @description The maximum size of the history.\n * @public\n * @readonly\n * @type {Size}\n */\n public get size(): Size {\n return this.#size;\n }\n\n /**\n * @description The maximum size of the history.\n * @type {number}\n */\n #size\n\n /**\n * Creates an instance of `HistoryCore` child class.\n * @constructor\n * @param {Size} size \n */\n constructor(size: Size) {\n this.#initialize();\n this.#size = size;\n }\n\n /**\n * @description Adds the value to the history.\n * @public\n * @param {Type} value The value to store.\n * @returns {this} The current instance.\n */\n public abstract add(value: Type): this;\n\n /**\n * @description Clears the history.\n * @public\n * @returns {this} The current instance.\n */\n public clear(): this {\n const history = this.history;\n history.length = 0;\n return this;\n }\n\n /**\n * @description Destroys the history of this instance.\n * @public\n * @returns {this} The current instance.\n */\n public destroy(): this {\n HistoryCore.#history.delete(this);\n return this;\n }\n\n /**\n * @description Gets the history.\n * @public\n * @returns {Readonly<Type[]>} \n */\n public get(): Readonly<Type[]> {\n return this.history;\n }\n\n /**\n * @description Returns the value at the specified index in the history.\n * @public\n * @param {number} index The position in the history (0-based index).\n * @returns {Type | undefined} The value at the specified position.\n */\n public peek(index: number): Type | undefined {\n return this.history[index];\n }\n\n /**\n * @description Returns the next value that would be undone without modifying history.\n * @public\n * @abstract\n * @returns {(Type | undefined)} \n */\n public abstract peekLast(): Type | undefined;\n\n /**\n * @description Returns the next value that would be redone without modifying history.\n * @public\n * @abstract\n * @returns {(Type | undefined)} \n */\n public abstract peekNext(): Type | undefined;\n\n /**\n * @description Takes the first value.\n * @public\n * @abstract\n * @returns {(Type | undefined)} \n */\n public abstract take(): Type | undefined;\n\n /**\n * @description Initializes the history by setting an empty `Array`.\n * @private\n * @returns {this} The current instance.\n */\n #initialize(): this {\n HistoryCore.#history.set(this, []);\n return this;\n }\n}\n","// Abstract.\nimport { HistoryCore } from './history-core.abstract';\n/**\n * @description Class extends the `HistoryCore` class to maintain a history of values in a prepend manner.\n * This means that new entries are added to the beginning of the history, and older entries are shifted out as the history size exceeds its limit.\n * @export\n * @abstract\n * @class HistoryPrepend\n * @template Type \n * @template {number} [Size=number] \n */\nexport abstract class HistoryPrepend<Type, Size extends number = number> extends HistoryCore<Type, Size> {\n /**\n * @description The default value of maximum history size.\n * @public\n * @static\n * @type {number}\n */\n public static size = 10;\n\n /**\n * @description Returns the `string` tag representation of the `HistoryPrepend` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n * @type {string}\n */\n public override get [Symbol.toStringTag](): string {\n return HistoryPrepend.name;\n }\n\n /**\n * Creates an instance of `HistoryPrepend` child class.\n * @constructor\n * @param {Size} [size=HistoryPrepend.size as Size] \n */\n constructor(size: Size = HistoryPrepend.size as Size) {\n super(size);\n }\n\n /**\n * @description Adds the value to the history in a backward manner.\n * @public\n * @param {Type} value The value to store.\n * @returns {this} The current instance.\n */\n public add(value: Type): this {\n const history = super.history;\n history.length >= super.size && history.pop();\n history.unshift(value);\n return this;\n }\n\n /**\n * @description Returns the last value that would be redone without modifying history.\n * @public\n * @returns {Type | undefined} The next redo value.\n */\n public peekLast(): Type | undefined {\n return super.history[super.history.length - 1];\n }\n\n /**\n * @description Returns the next value that would be redone without modifying history.\n * @public\n * @returns {Type | undefined} The next redo value.\n */\n public peekNext(): Type | undefined {\n return super.history[0];\n }\n\n /**\n * @description Takes the first value.\n * @public\n * @returns {(Type | undefined)} \n */\n public take(): Type | undefined {\n return super.history.shift();\n }\n}\n","// Abstract.\nimport { HistoryPrepend } from \"./history-prepend.abstract\";\n/**\n * @description Manages the redo history with prepend mechanism.\n * @export\n * @class RedoHistory\n * @template [Type=any] The type of elements stored in the history\n * @template {number} [Size=number] The maximum size of the history.\n * @extends {HistoryPrepend<Type, Size>}\n */\nexport class RedoHistory<Type = any, Size extends number = number> extends HistoryPrepend<Type, Size>{};","// Abstract.\nimport { HistoryCore } from './history-core.abstract';\n/**\n * @description Class extends the `HistoryCore` class to maintain a history of values in a append manner.\n * This means that new entries are added to the end of the history, and as the history exceeds its size limit, entries from the beginning are removed.\n * - LIFO(Last in, First out).\n * @export\n * @abstract\n * @class HistoryAppend\n * @template Type \n * @template {number} [Size=number] \n */\nexport abstract class HistoryAppend<Type, Size extends number = number> extends HistoryCore<Type, Size> {\n /**\n * @description The default value of maximum history size.\n * @public\n * @static\n * @type {number}\n */\n public static size = 10;\n\n /**\n * @description Returns the `string` tag representation of the `HistoryAppend` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n * @type {string}\n */\n public override get [Symbol.toStringTag](): string {\n return HistoryAppend.name;\n }\n\n /**\n * Creates an instance of `HistoryAppend` child class.\n * @constructor\n * @param {Size} [size=HistoryAppend.size as Size] \n */\n constructor(size: Size = HistoryAppend.size as Size) {\n super(size);\n }\n\n /**\n * @description Adds the value to the history.\n * @public\n * @param {Type} value The value to store.\n * @returns {this} The current instance.\n */\n public add(value: Type): this {\n const history = super.history;\n history.length >= super.size && history.shift();\n history.push(value);\n return this;\n }\n\n /**\n * @description Returns the last value that would be use to redo or undo without modifying history.\n * @public\n * @returns {Type | undefined} The next redo value.\n */\n public peekLast(): Type | undefined {\n return super.history[0];\n }\n\n /**\n * @description Returns the next value that would be use to redo or undo without modifying history.\n * @public\n * @returns {Type | undefined} The next redo value.\n */\n public peekNext(): Type | undefined {\n return super.history[super.history.length - 1];\n }\n\n /**\n * @description Takes the last value.\n * @public\n * @returns {(Type | undefined)} \n */\n public take(): Type | undefined {\n return super.history.pop();\n }\n}\n","// Abstract.\nimport { HistoryAppend } from \"./history-append.abstract\";\n/**\n * @description Manages the undo history with append mechanism.\n * @export\n * @class UndoHistory\n * @template [Type=any] The type of elements stored in the history\n * @template {number} [Size=number] The maximum size of the history.\n * @extends {HistoryAppend<Type, Size>}\n */\nexport class UndoHistory<Type = any, Size extends number = number> extends HistoryAppend<Type, Size>{};","// Abstract.\nimport { HistoryPeek } from './peek';\nimport { RedoHistory } from './redo-history.class';\nimport { UndoHistory } from './undo-history.class';\n/**\n * @description The class to manage the value changes.\n * @export\n * @abstract\n * @class History\n * @template Type \n * @template {number} [Size=number] \n */\nexport abstract class History<Type, Size extends number = number> {\n /**\n * @description The max size for undo history.\n * @public\n * @static\n * @type {number}\n */\n public static size = Infinity;\n\n /**\n * @description Returns the `string` tag representation of the `History` class when used in `Object.prototype.toString.call(instance)`.\n * @public\n * @readonly\n * @type {string}\n */\n public get [Symbol.toStringTag](): string {\n return History.name;\n }\n\n /**\n * @description Gets the current value stored in history.\n * @public\n * @readonly\n * @type {Type}\n */\n public get current(): Type {\n return this.#current.value as Type;\n }\n\n /**\n * @description\n * @public\n * @readonly\n * @type {HistoryPeek<Type>}\n */\n public get peek() {\n return this.#peek;\n }\n\n /**\n * @description Returns the redo history.\n * @public\n * @readonly\n * @type {RedoHistory<any, number>}\n */\n public get redoHistory() {\n return this.#redo;\n }\n\n /**\n * @description Returns the undo history.\n * @public\n * @readonly\n * @type {UndoHistory<any, number>}\n */\n public get undoHistory() {\n return this.#undo;\n }\n\n /**\n * @description A private field to store the current value.\n * @type {{ value?: Type }}\n */\n #current: { value?: Type } = {};\n\n /**\n * @description \n * @type {boolean}\n */\n #hasSetBeenCalled = false;\n\n /**\n * @description Privately stored callback function invoked on redo.\n * @type {(value: Type) => void}\n */\n #onRedoCallback?: (value: Type) => void;\n\n /**\n * @description Privately stored callback function invoked on undo.\n * @type {(value: Type) => void}\n */\n #onUndoCallback?: (value: Type) => void;\n\n /**\n * @description\n * @type {HistoryPeek}\n */\n #peek;\n\n /**\n * @description The class to manage the redo history.\n * @type {RedoHistory}\n */\n #redo;\n\n /**\n * @description The class to manage the undo history.\n * @type {UndoHistory}\n */\n #undo\n\n /**\n * Creates an instance of `History` child class. \n * @constructor\n * @param {{value?: Type, size?: Size}} param0 \n * @param {Type} param0.value \n * @param {Size} param0.size \n */\n constructor({value, size}: {value?: Type, size?: Size} = {}) {\n this.#peek = new HistoryPeek<Type>(this);\n this.#redo = new RedoHistory<Type>(Infinity);\n this.#undo = new UndoHistory<Type, Size>(size || History.size as Size);\n Object.hasOwn(arguments[0] || {}, 'value') && ((this.#hasSetBeenCalled = true), (this.#current = {value}));\n }\n\n /**\n * @description Clears the `undo` and `redo` history, removes the current value, and resets the `hasSetBeenCalled`.\n * @public\n * @returns {this} The current instance.\n */\n public clear(): this {\n delete this.#current.value;\n this.#hasSetBeenCalled = false;\n this.#redo.clear();\n this.#undo.clear();\n return this;\n }\n\n /**\n * @description Destroys the history of this instance.\n * @public\n * @returns {this} The current instance.\n */\n public destroy(): this {\n this.clear();\n this.#undo.destroy();\n this.#redo.destroy();\n return this;\n }\n\n /**\n * @description Gets the undo and redo history.\n * @public\n * @returns {{ undo: Readonly<Type[]>; redo: Readonly<Type[]> }} \n */\n public get(): { undo: Readonly<Type[]>; redo: Readonly<Type[]> } {\n return {\n undo: this.#undo.get(),\n redo: this.#redo.get(),\n };\n }\n \n /**\n * @description The instance method returns read-only redo history.\n * @public\n * @template Type\n * @returns {(Readonly<Type[]> | undefined)} \n */\n public getRedo(): Readonly<Type[]> | undefined {\n return this.#redo.get();\n }\n\n /**\n * @description The instance method returns read-only undo history.\n * @public\n * @template Type \n * @returns {(Readonly<Type[]> | undefined)} \n */\n public getUndo(): Readonly<Type[]> | undefined {\n return this.#undo.get();\n }\n\n /**\n * @description Checks whether the current value is set.\n * @public\n * @returns {boolean} \n */\n public hasCurrent() {\n return Object.hasOwn(this.#current, 'value');\n }\n\n /**\n * @description Sets the callback function invoked on redo.\n * @public\n * @param {(value: Type) => void} callbackFn The callback function to invoke.\n * @returns {this} \n */\n public onRedo(callbackFn: (value: Type) => void): this {\n this.#onRedoCallback = callbackFn;\n return this;\n }\n\n /**\n * @description Sets the callback function invoked on undo.\n * @public\n * @param {(value: Type) => void} callbackFn The callback function to invoke.\n * @returns {this} \n */\n public onUndo(callbackFn: (value: Type) => void): this {\n this.#onUndoCallback = callbackFn;\n return this;\n }\n\n /**\n * @description Returns the specified by index value from redo history.\n * @public\n * @param {number} [index=0] \n * @returns {(Type | undefined)} \n */\n public peekRedo(index: number = 0): Type | undefined {\n return this.#redo.peek(index);\n }\n\n /**\n * @description Returns the specified by index value from undo history.\n * @public\n * @param {number} [index=this.#undo.length - 1] \n * @returns {(Type | undefined)} \n */\n public peekUndo(index: number = this.#undo.length - 1): Type | undefined {\n return this.#undo.peek(index);\n }\n\n /**\n * @description Returns the last value that would be redone without modifying history.\n * @public\n * @returns {Type | undefined} The last redo value.\n */\n public peekLastRedo(): Type | undefined {\n return this.#redo.peekLast();\n }\n\n /**\n * @description Returns the last value that would be undone without modifying history.\n * @public\n * @returns {Type | undefined} The last undo value.\n */\n public peekLastUndo(): Type | undefined {\n return this.#undo.peekLast();\n }\n\n /**\n * @description Returns the next value that would be redone without modifying history.\n * @public\n * @returns {Type | undefined} The next redo value.\n */\n public peekNextRedo(): Type | undefined {\n return this.#redo.peekNext();\n }\n\n /**\n * @description Returns the next value that would be undone without modifying history.\n * @public\n * @returns {Type | undefined} The next undo value.\n */\n public peekNextUndo(): Type | undefined {\n return this.#undo.peekNext();\n }\n\n /**\n * @description Pick the undo or redo history.\n * @public\n * @param {('undo' | 'redo')} type \n * @returns {Readonly<Type[]>} \n */\n public pick(type: 'undo' | 'redo'): Readonly<Type[]> {\n return (type === 'undo' ? this.#undo : this.#redo).get();\n }\n\n /**\n * @description Redoes the last undone action.\n * @public\n * @returns {this} The current instance.\n */\n public redo(): this {\n const redo = this.#redo;\n if (redo.get()?.length) {\n const value = redo.take();\n this.#undo.add(this.#current.value as Type);\n this.#current = {value};\n this.#onRedoCallback?.(value as Type);\n }\n return this;\n }\n\n /**\n * @description Sets a new value and updates the undo history.\n * @public\n * @param {Type} value \n * @returns {this} The current instance.\n */\n public set(value: Type): this {\n this.#hasSetBeenCalled === true && this.#undo.add(this.#current.value as Type);\n this.#current = {value};\n this.#redo.clear();\n this.#hasSetBeenCalled === false && (this.#hasSetBeenCalled = true);\n return this;\n }\n\n /**\n * @description Undoes the last action and moves it to redo history.\n * @public\n * @returns {this} The current instance.\n */\n public undo(): this {\n const undo = this.#undo;\n if (undo.get()?.length) {\n const value = undo.take();\n this.#redo.add(this.#current.value as Type);\n this.#current = {value};\n this.#onUndoCallback?.(value as Type);\n }\n return this;\n }\n}\n","/*\n * Public API Surface of history\n */\nexport {\n History,\n HistoryAppend,\n HistoryCore,\n HistoryPrepend,\n} from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAEA;;;;;AAKG;MACU,eAAe,CAAA;AAMG,IAAA,OAAA;AAL7B;;;;AAIG;AACH,IAAA,WAAA,CAA6B,OAAsB,EAAA;QAAtB,IAAO,CAAA,OAAA,GAAP,OAAO;;AAEpC;;;;;AAKG;IACI,KAAK,CAAC,QAAgB,CAAC,EAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;;AAG7C;;;;AAIG;IACI,IAAI,GAAA;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE;;AAG5C;;;;AAIG;IACI,IAAI,GAAA;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE;;AAE7C;;ACzCD;;;;;AAKG;MACU,eAAe,CAAA;AAMG,IAAA,OAAA;AAL7B;;;;AAIG;AACH,IAAA,WAAA,CAA6B,OAAsB,EAAA;QAAtB,IAAO,CAAA,OAAA,GAAP,OAAO;;AAEpC;;;;;AAKG;IACI,KAAK,CAAC,KAAgB,GAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAA;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;;AAG7C;;;;AAIG;IACI,IAAI,GAAA;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE;;AAG5C;;;;AAIG;IACI,IAAI,GAAA;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE;;AAE7C;;ACvCD;;;;;AAKG;MACU,WAAW,CAAA;AACtB;;;;;AAKG;AACH,IAAA,IAAW,IAAI,G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