import { Meta, Source } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/figma/Functions/fetchFrameSelection - Fetching current selection'/>

# `fetchFrameSelection`

A utility for retrieving and observing the list of elements currently selected by the user in Figma. It provides detailed information about the current selection, including names, IDs, and screenshots.

**Parameters:**
- `callback: (value: UiFigmaFramesList) => void` — A function called whenever the selection is updated.

**Returns:**
`void`

## Usage Example

```typescript
import { fetchFrameSelection } from '@dxtmisha/figma'

fetchFrameSelection((frames) => {
  console.log('Current selection updated:', frames)
})
```

## Data Types

#### `UiFigmaFramesItem`
Represents a simplified frame element for the UI.
- `name: string` — The name of the frame.
- `id: string` — The unique identifier of the element.
- `image: Uint8Array | string` — The image of the frame (optional).

#### `UiFigmaFramesList`
A list of `UiFigmaFramesItem` objects.
