SheetXL - v1.0.2
    Preparing search index...

    Interface Event<S>

    What a range listener is told. See ICellRange.addListener.

    interface Event<S extends ICellRange | ICellRanges = ICellRange> {
        getCommit(): ICommit | null;
        getEdits(): readonly ICellRange.Edit[];
        getPreviousAddress(): string | null;
        getRanges(): ICellRanges | null;
        getSource(): S;
        getTimeStamp(): number;
        getTrigger(): Trigger;
        isUndo(): boolean;
        toString(): string;
    }

    Type Parameters

    Index
    • The commit that made the change, or null when none did: a recalculation landing.

      Returns ICommit | null

      A transactional listener is told before the commit is sealed, so this is the commit it is writing into (ListenerOptions.transactional).

    • The edits that changed the range's cells, in the order they were made, for an 'address' event of a listener that asked for them (ListenerOptions.edits); empty otherwise.

      Returns readonly ICellRange.Edit[]

      Where getSource says where the range landed, these say what happened to its cells on the way: each band inserted or deleted, and each cut that took some of them. A listener that keeps something per cell of the range - a reference, a mark - reads these to take each cell through on its own. An undo or a redo restores a revision rather than repeating the edits, so it has none.

    • Where the source was before an 'address' event moved it; null for any other event, and for a sheet rename, which moves no cells.

      Returns string | null

      An address rather than a range, because the cells at it now are other cells.

    • The cells that changed within the source, for a 'data' event; null for any other.

      Returns ICellRanges | null

      A batch is one change: every range of it that reached the listener arrives in one event.

    • The range that was listened to, where it is now.

      Returns S

      After an 'address' or 'restore' event this is the range at its new address or extent: rows or columns inserted or deleted around it, or an undo that moved it back. The range addListener was called on keeps the address it was made with, so this is where to read the range from.

      A range whose cells were deleted is invalid (ICellRange.isInvalid) and spells #REF!; one restored to a revision from before the listener was added is invalid and spells #N/A.

    • When the event was made, in milliseconds since the epoch.

      Returns number

    • What happened to the range.

      Returns Trigger

      • 'data': Cells within the range changed: written, recalculated, or undone. The range's address and extent are as they were. getCommit is null for a recalculation, which belongs to no commit; isUndo tells an undo from a write.
      • 'address': The range's address or extent changed: rows or columns inserted or deleted, cells moved, its cells deleted (the source spells #REF!), or, for a sheet-qualified range (one from IWorkbook.getRange, or a sheet's range naming another sheet), a rename of the sheet it names. A bare range on its own sheet has no qualifier, so a rename is not a change to it. A listener anchored IAnchored.Type.Absolute never moves and never has one.
      • 'restore': The workbook was restored to a revision from before the listener was added, so the range is not in it (the source spells #N/A). Never delivered to a transactional listener.
    • true when the change is an undo. A redo is not an undo: it is told as the forward change was.

      Returns boolean

    • The trigger and the source, for logging.

      Returns string