Skip to content

Commit fa8d1ec

Browse files
docs: add JSDoc to storeDataForVersion, clearRedoStack, clearUndoStack
1 parent 3381234 commit fa8d1ec

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/UndoRedo.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ export class UndoRedo {
527527
this.batchUndoEntry = undefined
528528
}
529529

530+
/**
531+
* Stores a formula AST hash snapshot for the given LazilyTransformingAstService version.
532+
* Skipped when `undoLimit` is 0 (undo disabled) to avoid storing data that would never be used.
533+
*/
530534
public storeDataForVersion(version: number, address: SimpleCellAddress, astHash: string) {
531535
if (this.undoLimit === 0) {
532536
return
@@ -538,11 +542,13 @@ export class UndoRedo {
538542
currentOldData.push([address, astHash])
539543
}
540544

545+
/** Clears the redo stack and removes oldData entries no longer referenced by any remaining entry. */
541546
public clearRedoStack() {
542547
this.cleanupOldDataForEntries(this.redoStack, this.undoStack)
543548
this.redoStack = []
544549
}
545550

551+
/** Clears the undo stack and removes oldData entries no longer referenced by any remaining entry. */
546552
public clearUndoStack() {
547553
this.cleanupOldDataForEntries(this.undoStack, this.redoStack)
548554
this.undoStack = []

0 commit comments

Comments
 (0)