Skip to content

SelectionResult

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
modeSelectionModeThe current selection mode
rangesCellRange[]All selected ranges. Empty if nothing is selected.
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://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt