# SelectionResult

> _Since v0.4.2_

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

#### Example

```ts
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})`);
}
```

## Properties

| Property | Type | Description |
| -------- | ---- | ----------- |
| `mode` | <code><a href="/grid/plugins/selection/types/selectionmode/">SelectionMode</a> &#124; <a href="/grid/plugins/selection/types/selectionmode/">SelectionMode</a>[]</code> | The current selection mode (or modes if array-configured) |
| `activeAxis` | <code><a href="/grid/plugins/selection/types/selectionaxis/">SelectionAxis</a></code> | Which axis owns the active selection. <span class="since-badge" title="Introduced in v2.8.0">v2.8.0+</span> |
| `ranges` | <code><a href="/grid/plugins/selection/interfaces/cellrange/">CellRange</a>[]</code> | All selected ranges. Empty if nothing is selected on the row/cell/range axis. |
| `selectedColumns` | <code>readonly string[]</code> | Selected column field names. Empty unless the column axis is active. <span class="since-badge" title="Introduced in v2.8.0">v2.8.0+</span> |
| `anchor` | <code>object &#124; unknown</code> | The anchor cell for range extension (Shift+click/arrow). Null if no anchor is set. |
