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

    Interface IRangeSelection

    Interface representing a range selection within a sheet.

    interface IRangeSelection {
        isIRangeSelection: true;
        addListeners(
            listeners: IRangeSelection.IListeners,
            options?: IListener.Options,
        ): Remove;
        append(
            start: CellCoords,
            end?: CellCoords,
            anchor?: Partial<CellCoords>,
        ): void;
        clear(): void;
        clearAndModify(
            start: Partial<IRange.CellCoords>,
            end?: Partial<CellCoords>,
            anchor?: Partial<CellCoords>,
        ): void;
        clearHidden(): this;
        createSelection(options?: CreateTemporaryOptions): IRangeSelection;
        getAdjusting(): IRangeSelection | null;
        getCell(): ICell;
        getCoords(): SelectionCoords;
        getRange(options?: ICellRange.GetRangeOptions): ICellRange;
        getRanges(options?: ICellRange.GetRangeOptions): ICellRanges;
        getSelectedRuns(axis: Axis): readonly RunCoordValue<boolean>[];
        getSheet(): ISheet;
        hasTopOrLeft(): boolean;
        isEntire(): boolean;
        isEquals(other: IRangeSelection): boolean;
        modify(
            cellAnchor: Partial<IRange.CellCoords>,
            cellPivot?: Partial<CellCoords>,
            resetAnchor?: boolean,
        ): void;
        navigate(
            direction: Direction,
            select?: boolean,
            contentful?: boolean,
            incrementAmount?: number,
        ): this;
        selectRegion(options?: SelectRegionOptions): Promise<ICellRange>;
        setAdjusting(range: SelectionCoords | null): void;
        traverse(axis?: Axis, reverse?: boolean, region?: Coords): this;
        traverseCorners(): this;
        updateCoords(coords: SelectionCoords): this;
    }
    Index
    isIRangeSelection: true

    For runtime type checking.

    • Appends a selection to the current selection.

      Parameters

      • start: CellCoords

        The start cell.

      • Optionalend: CellCoords

        The end cell. Default is the start cell.

      • Optionalanchor: Partial<CellCoords>

        The anchor cell.

      Returns void

      This is used to support the CMD key behavior in the UI.

    • Clears the range selections.

      Returns void

      This does not affect the cell.

    • Updates the selection using a new start and end.

      Parameters

      • start: Partial<IRange.CellCoords>

        The start cell.

      • Optionalend: Partial<CellCoords>

        The end cell. Default is the start cell.

      • Optionalanchor: Partial<CellCoords>

        The anchor cell.

      Returns void

    • 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.

      Returns this

    • Creates a detached, transient selection over the same sheet.

      Parameters

      Returns IRangeSelection

      The 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 selected cell.

      Returns ICell

    • Returns the coordinates of the selection.

      Returns SelectionCoords

      The selection coordinates.

    • Projects the selection onto a header axis as contiguous runs of selected headers.

      Parameters

      • axis: Axis

      Returns readonly RunCoordValue<boolean>[]

      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.

      Returns ISheet

      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.

      Returns boolean

    • Checks if the entire range is selected.

      Returns boolean

      True if the entire range is selected, otherwise false.

    • Checks if the selection is equal to another selection.

      Parameters

      Returns boolean

    • Modifies the selection around the anchor.

      Parameters

      • cellAnchor: Partial<IRange.CellCoords>

        The anchor cell.

      • OptionalcellPivot: Partial<CellCoords>

        The pivot cell.

      • OptionalresetAnchor: boolean

        Whether to reset the anchor. Default is false.

      Returns void

    • Navigates the sheet.

      Parameters

      • direction: Direction

        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.

      Returns this

    • A special range used during drag.

      Parameters

      • range: SelectionCoords | null

        The range or null.

      Returns void

      This fires an event.

    • Traverses the selection, moving to the next cell based on the axis.

      Parameters

      • 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.

      Returns this

      Useful for pressing tab or enter from the UI.

      A bare cursor in a table wraps a row traverse (Tab) within the table's data range without being given a region; a column traverse (Enter) moves on out of the table.

    • 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.

      Returns this

      Useful for pressing Ctrl+. from the UI.

    • Updates the selection coordinates.

      Parameters

      • coords: SelectionCoords

        The new coordinates.

      Returns this

      The current instance.