MCPcopy
hub / github.com/tldraw/tldraw / createShape

Method createShape

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

* Create a single shape. * * @example * ```ts * editor.createShape(myShape) * editor.createShape({ id: 'box1', type: 'text', props: { richText: toRichText("ok") } }) * ``` * * @param shape - The shape (or shape partial) to create. * * @public

(shape: TLCreateShapePartial<TShape>)

Source from the content-addressed store, hash-verified

8470 * @public
8471 */
8472 createShape<TShape extends TLShape>(shape: TLCreateShapePartial<TShape>): this {
8473 this.createShapes([shape])
8474 return this
8475 }
8476
8477 /**
8478 * Create shapes.

Callers

nothing calls this directly

Calls 1

createShapesMethod · 0.95

Tested by

no test coverage detected