@mocanvas/editor · function

getShapeAndDescendantIds

declare function getShapeAndDescendantIds(editor: Editor, ids: readonly ShapeId[]): Set<ShapeId>

Every id in ids, plus every descendant of each of them.

The set a delete, a duplicate or a page move operates on: acting on a parent without its children leaves orphans behind, which is the bug this function exists to make unwritable.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.