ComPDFKit Web SDK
    Preparing search index...

    Class ContentEditHistoryManager

    Undo and redo history of content editing, separate from the annotation history.

    Hierarchy (View Summary)

    • EventHandler<ContentEditHistoryManagerEvents>
      • ContentEditHistoryManager
    Index
    • Adds a listener for an event. Adding the same function twice for one event has no effect.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K

        Event name.

      • fn: (...args: ContentEditHistoryManagerEvents[K]) => void

        Listener, called with the event arguments.

      • Optionaloptions: { once?: boolean }

        Listener options.

        • Optionalonce?: boolean

          When true, the listener is removed after it runs once.

      Returns void

    • Checks whether there is an entry to redo.

      Returns boolean

      true when redo is available.

    • Checks whether there is an entry to undo.

      Returns boolean

      true when undo is available.

    • Merges the latest count entries into one (such as creating a paragraph + writing its content, or all replacements of one find and replace); returns the entry.

      Parameters

      • count: number

      Returns Entry | undefined

    • Returns a snapshot of the logical undo and redo entry counts; native commands inside composite entries are not counted separately.

      Returns { redoCount: number; undoCount: number }

      • redoCount: number

        Number of entries that can be redone.

      • undoCount: number

        Number of entries that can be undone.

    • Redoes the latest undone entry; does nothing when there is none. Fires undoRedoStatusChanged.

      Returns Promise<void>

    • Removes a listener, or every listener of the event when fn is omitted.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K

        Event name.

      • Optionalfn: (...args: ContentEditHistoryManagerEvents[K]) => void

        The function that was passed to addEventListener.

      Returns void

    • A listener that throws does not affect the others; the error is reported through logger.error.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K
      • Optionalargs: ContentEditHistoryManagerEvents[K]

      Returns void

    • Like trigger, but awaits the Promise returned by each listener in turn; a failing listener does not affect the others.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K
      • Optionalargs: ContentEditHistoryManagerEvents[K]

      Returns Promise<void>

    • Undoes the latest entry; does nothing when there is none. Fires undoRedoStatusChanged.

      Returns Promise<void>