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

    Class SheetSelection

    The sheet-backed ISelection: a thin adapter over the sdk IRangeSelection so the new selection layers (and the editor, via ICellAnchor) drive the real sheet.getSelection() instead of the dumb in-memory DefaultSelection.

    The architecture deliberately pushes the smart selection logic (merge / hidden / contentful awareness, bounds clamping) into the model, so this adapter is almost pure delegation — navigate / traverse / modify / append map straight onto the sdk's implementations. The two non-trivial seams:

    • Reads are stable. IRangeSelection.getCoords() returns its internal _coords reference, replaced only on a real change (its updateCoords short-circuits on isEqualSelectionCoords), so getSelection() satisfies the useSyncExternalStore stable-snapshot invariant with no caching.
    • Subscription is ref-counted. A single sdk onChange listener is attached while any React subscriber is present and detached when the last leaves — no dangling sdk listener, no dispose().

    deselect is the one intent the sdk has no native method for; it is computed here as a pure range split (mirroring DefaultSelection.deselect) and written back through updateCoords.

    The Direction / RangeAxis unions are the same as const string literals the sdk's IRange.* use, so they pass through without mapping.

    Implements

    • ISelection
    Index
    • get selection(): IRangeSelection

      The wrapped sdk selection (for callers that need sheet-specific APIs the model doesn't expose).

      Returns IRangeSelection

    • Parameters

      • start: CellCoords
      • end: CellCoords = start

      Returns void

    • Parameters

      • rangeToRemove: RangeCoords

      Returns void

    • Returns CellCoords

    • Returns SelectionCoords

    • Parameters

      • cell: Partial<CellCoords>
      • Optionalpivot: Partial<CellCoords>

      Returns void

    • Parameters

      • direction: Direction
      • select: boolean = false
      • contentful: boolean = false
      • Optionalincrement: number

      Returns void

    • Parameters

      • next: SelectionCoords

      Returns void

    • Parameters

      • listener: () => void

      Returns () => void

    • Parameters

      • axis: RangeAxis = RangeAxis.Row
      • reverse: boolean = false
      • Optionalregion: RangeCoords

      Returns void