Skip to content

Vibe coding a plugin? Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

Selection

The current selection. Changing it doesn’t need an operation and isn’t undoable. Only live drawing elements in the active editing context can be selected.

readonly length: number

Number of selected elements.

[iterator](): Iterator<AnyDrawingElement>

Iterator<AnyDrawingElement>

Iterable.[iterator]


add(entity): boolean

Adds an element. Returns whether it wasn’t selected before.

DrawingElement

boolean


at(index): AnyDrawingElement | undefined

Returns the selected element at index, counting from the end when negative.

number

AnyDrawingElement | undefined


clear(): void

Deselects everything.

void


has(entity): boolean

Whether the element is selected.

DrawingElement

boolean


remove(entity): boolean

Removes an element. Returns whether it was selected.

DrawingElement

boolean


toArray(): AnyDrawingElement[]

A snapshot of the selected elements.

AnyDrawingElement[]


toJSON(): AnyDrawingElement[]

JSON.stringify writes the selected elements as an array.

AnyDrawingElement[]