Adds listeners to the selection.
The listeners to add.
Optionaloptions: IListener.Options
Options for the listeners.
A function to remove the listeners.
Updates the selection using a new start and end.
The start cell.
Optionalend: Partial<CellCoords>
The end cell. Default is the start cell.
Optionalanchor: Partial<CellCoords>
The anchor cell.
Clear the hidden cells from the selection. Each selected range is split around the hidden row/column runs it spans (the clear/deselect operation, targeting hidden cells), leaving the selection over only its visible cells, as separate rectangles. The anchor cell stays put when it is visible and snaps to the first visible piece when it isn't. A no-op when the whole selection is hidden.
Creates a detached, transient selection over the same sheet.
Optionaloptions: CreateTemporaryOptionsThe returned selection is not the sheet's primary selection and is not registered on any view.
It shares the sheet for all coordinate math (merges, hidden headers, bounds) but its coords are
independent — mutating it never affects sheet.getSelection() and vice versa. Nothing needs to
be disposed: it holds no sheet-level listeners, so it is reclaimed when the last reference is
dropped.
Unspecified options default to this selection's own (shapePolicy, navigationPolicy); coords
default to empty.
Returns the adjusting range.
Returns the selected cell.
Returns the coordinates of the selection.
The selection coordinates.
Returns ranges of cells for the current selection.
Optionaloptions: ICellRange.GetRangeOptionsProjects the selection onto a header axis as contiguous runs of selected headers.
Each run's value is isSelectedAll — whether that span covers the opposite axis entirely (an
entire-row/column selection). Derived purely from the selection's coords (and the sheet's entire
range), so it works for any selection — the primary or a detached IRangeSelection.create
picker — and is what the header selection layer renders.
Returns the anchor sheet — the sheet this selection is bound to for all coordinate math (merges,
hidden headers, bounds) and the sheet a coord with no explicit scope belongs to.
A selection's ranges may span multiple sheets (each range/cell carries its own optional scope
sheet name — e.g. a formula's cross-sheet references), but the selection itself is always anchored to
one sheet: the one it was constructed with (or, for a create picker, the sheet it was
derived from). This is that sheet — the analog of ICellRange.getSheet for a selection.
Checks if the top row or left column is selected.
Checks if the entire range is selected.
True if the entire range is selected, otherwise false.
Checks if the selection is equal to another selection.
The other selection to compare against.
Modifies the selection around the anchor.
The anchor cell.
OptionalcellPivot: Partial<CellCoords>
The pivot cell.
OptionalresetAnchor: boolean
Whether to reset the anchor. Default is false.
Navigates the sheet.
The direction to navigate.
Optionalselect: boolean
Whether to select the cell after navigating.
Optionalcontentful: boolean
Whether to navigate to contentful cells only.
OptionalincrementAmount: number
The amount to increment.
Selects the surrounding region and returns the new range.
Optionaloptions: SelectRegionOptionsTraverses the selection, moving to the next cell based on the axis.
Optionalaxis: Axis
The axis to traverse. Default is ICellRange.Axis.Row.
Optionalreverse: boolean
Whether to traverse in reverse. Default is false.
Optionalregion: Coords
An optional bounding region to wrap within when there is no explicit selection (a bare cursor), so the move cycles inside it instead of walking off its edge. Omit it and a bare-cursor traverse is a plain move.
Cycles the active cell around the four visible corners of the active range: TL → TR → BL → BR → TL. Each corner is snapped inward past hidden rows/columns (via the same hidden-skip the sheet uses for navigate/traverse), so the active cell never lands on an unseen header. A no-op when there is no selection.
Updates the selection coordinates.
The new coordinates.
The current instance.
Interface representing a range selection within a sheet.