Skip to content

SelectionResult

Since v0.4.2

Unified selection result returned by getSelection(). Provides a consistent interface regardless of selection mode.

const selection = plugin.getSelection();
if (selection.ranges.length > 0) {
const firstRange = selection.ranges[0];
console.log(`Selected from (${firstRange.from.row}, ${firstRange.from.col}) to (${firstRange.to.row}, ${firstRange.to.col})`);
}
PropertyTypeDescription
modeSelectionMode | SelectionMode[]The current selection mode (or modes if array-configured)
activeAxisSelectionAxisWhich axis owns the active selection. v2.8.0+
rangesCellRange[]All selected ranges. Empty if nothing is selected on the row/cell/range axis.
selectedColumnsreadonly string[]Selected column field names. Empty unless the column axis is active. v2.8.0+
anchorobject | unknownThe anchor cell for range extension (Shift+click/arrow). Null if no anchor is set.
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt