SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Class TransactionSaveStateManager

    Tracks whether a transactional root — a Workbook, or a standalone Sheet — has unsaved changes, by comparing the store's current commit against a saved bookmark commit.

    A peer to TransactionUndoManager: both attach to an ITransaction.IStore and interpret its commits. This one answers "am I dirty relative to the last save?".

    Dirty is a pure commit-id comparison, which has two nice consequences for free:

    • Undoing back to the saved commit becomes clean again (the store restores the prior commit id).
    • Selection / view-only changes are non-transactional, so they never create a commit and never mark the root dirty.

    It is consumer-owned: construct it, and call close when done. It is intentionally never attached to the model. Pass an ITransaction.ICommitSource (e.g. WorkbookIO) and it marks itself clean automatically on a matching persist; otherwise call markSaved directly.

    Implements

    Index
    • Detach the store / commit listeners and release listeners.

      Returns void

    • The commit id currently treated as saved, or null.

      Returns string | null

    • The store this manager tracks.

      Returns IStore

    • true when the current commit differs from the saved bookmark.

      Returns boolean

    • Move the saved bookmark, marking the root clean as of commitId.

      Parameters

      • commitId: string | null = ...

        The commit that was persisted. Defaults to the current commit.

      Returns void

      Pass the commit captured when the bytes were encoded (not when the write completed), so edits made during an async write correctly leave the root dirty.