Referencia de API

@univerjs-pro/engine-shape

Esta página de API está disponible actualmente en inglés. Las firmas y los identificadores no cambian con el idioma.

Shape rendering models, shape definitions, editable SmartArt data, z-order updates, and conversion utilities for Web SDK.

TypeScript
import { ShapeModel, ShapeTypeEnum } from '@univerjs-pro/engine-shape'

Import @univerjs-pro/engine-shape/facade for live FShape APIs, including SmartArt node and layout editing and setZOrder(index). See the Shape Facade reference for the insertion workflow.

Closed shape geometry

mergeShapeContours(operands, operation, primaryIndex = 0) combines 2–10 IShapeGeometryOperand values. Each contains closed polygon contours and an optional 'nonzero' or 'evenodd' fill rule. ShapeMergeOperation supports 'union', 'combine', 'intersect', 'subtract', and 'fragment'; subtraction removes the other operands from the primary operand. The result is an array of IShapeGeometryResult values containing contours and sourceIndices. Empty intersections can return an empty array. Invalid inputs or excessive geometry complexity throw RangeError.

getShapeGeometryContours(shapeType, shapeData, width, height, tolerance?) extracts supported filled geometry, and createMergedShapeGeometry(contours) produces a custom geometry and its bounds. These helpers do not edit a document or manage text, selection, permissions, or undo. For user-facing Slides editing, use the shape merge command.

¿Cómo es esta guía?

© 2026 DreamNum Co., Ltd.