MCPcopy
hub / github.com/tldraw/tldraw / select

Method select

packages/editor/src/lib/editor/Editor.ts:2111–2118  ·  view source on GitHub ↗

* Select one or more shapes. * * @example * ```ts * editor.select('id1') * editor.select('id1', 'id2') * ``` * * @param shapes - The shape (or the shape ids) to select. * * @public

(...shapes: TLShapeId[] | TLShape[])

Source from the content-addressed store, hash-verified

2109 * @public
2110 */
2111 select(...shapes: TLShapeId[] | TLShape[]): this {
2112 const ids =
2113 typeof shapes[0] === 'string'
2114 ? (shapes as TLShapeId[])
2115 : (shapes as TLShape[]).map((shape) => shape.id)
2116 this.setSelectedShapes(ids)
2117 return this
2118 }
2119
2120 /**
2121 * Remove a shape from the existing set of selected shapes.

Callers 15

popFocusedGroupIdMethod · 0.95
setEditingShapeMethod · 0.95
groupShapesMethod · 0.95
ungroupShapesMethod · 0.95
copyErrorFunction · 0.80
Editor.test.tsFile · 0.80
onPointerMoveMethod · 0.80
createShapesForAssetsFunction · 0.80
createEmptyBookmarkShapeFunction · 0.80

Calls 1

setSelectedShapesMethod · 0.95

Tested by 9

startDraggingHandleFunction · 0.64
testCloneHandlesFunction · 0.64
testDragCloneHandlesFunction · 0.64
rotateXFunction · 0.64
startDraggingHandleFunction · 0.64
handlePositionFunction · 0.64
startDraggingOwnHandleFunction · 0.64
ownHandlePositionFunction · 0.64