* 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[])
| 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. |