> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# getSelectedBlocks

> `const` **getSelectedBlocks**: `EditorSelector`\<`object`[]\>

Defined in: selector.get-selected-blocks.ts:23

Returns the root-level blocks the selection covers.

Only looks at direct children of the editor. If the selection is inside
an editable container, the container itself is returned - not its inner
blocks. Containers are preserved whole.

Use for block-level operations like `move.block up/down` and
drag-and-drop. For "selection as portable text" use `getSelectedValue`;
for "text blocks at any depth" use `getSelectedTextBlocks`.