Skip to content

Reference ​

ts
import { applyDrawingEdit, toSvg } from '@adecore/drawing';
import { migrateDrawing, type DrawingDocument } from '@adecore/drawing/protocol';

Limits and constants ​

NameValueExplained in
DRAWING_VERSION1Documents
DRAWING_TEXT_SIZE_MIN12Documents
DRAWING_TEXT_SIZE_MAX96Documents
DRAWING_EDIT_LIMITS{ perEdit: 200, elements: 5000 }Edits and rebasing
DEFAULT_SVG_MARGIN32Paths and SVG
LINE_HEIGHT1.25Text
NOTE_PADDING16Text

The element fields are on Documents and the SvgOptions on Paths and SVG.

Exports ​

Every name each entry point exports, read from its source. Anything not listed is internal and may change in any release.

@adecore/drawing ​

Edits, rebasing, geometry, paths, the SVG export, text and reading order.

NameKindSource
Pointtypegeometry
Recttypegeometry
RESIZE_HANDLESconstgeometry
ResizeHandletypegeometry
boundsOffunctiongeometry
centerOffunctiongeometry
roundPointfunctiongeometry
rotatePointfunctiongeometry
unionOffunctiongeometry
boundsOfElementsfunctiongeometry
intersectsfunctiongeometry
rectFromPointsfunctiongeometry
elementAtfunctiongeometry
elementsInfunctiongeometry
handlePointfunctiongeometry
resizeRectfunctiongeometry
scaleElementfunctiongeometry
DRAWING_EDIT_LIMITSconstedits
NewDrawingElementSchemaconstedits
NewDrawingElementtypeedits
DrawingElementPatchSchemaconstedits
DrawingElementPatchtypeedits
DrawingEditSchemaconstedits
DrawingEdittypeedits
DrawingEditProblemtypeedits
DrawingEditOutcometypeedits
DrawingEditMinttypeedits
applyDrawingEditfunctionedits
ElementPathtypepaths
pathsOfElementfunctionpaths
DrawingRebasetyperebase
rebaseDrawingElementsfunctionrebase
readingOrderfunctionreading-order
SvgOptionstypesvg
DEFAULT_SVG_MARGINconstsvg
DEFAULT_PALETTEconstsvg
DEFAULT_PAPERconstsvg
DEFAULT_EDGEconstsvg
escapeXmlfunctionsvg
toSvgfunctionsvg
LINE_HEIGHTconsttext
DEFAULT_FONT_STACKSconsttext
WrittenElementtypetext
NOTE_PADDINGconsttext
writingFrameOffunctiontext
MeasureLinetypetext
approximateMeasurefunctiontext
linesOffunctiontext
fontOffunctiontext

@adecore/drawing/protocol ​

The schemas and types of a drawing, and migrateDrawing. Loads Zod and nothing else.

NameKindSource
DrawingFontSchemaconstprotocol
DrawingFonttypeprotocol
DrawingColorSchemaconstprotocol
DrawingColortypeprotocol
DRAWING_COLORSconstprotocol
DrawingFillSchemaconstprotocol
DrawingFilltypeprotocol
DrawingStrokeStyleSchemaconstprotocol
DrawingStrokeStyletypeprotocol
DrawingStrokeWidthSchemaconstprotocol
DrawingStrokeWidthtypeprotocol
DrawingRoughnessSchemaconstprotocol
DrawingRoughnesstypeprotocol
DrawingAlignSchemaconstprotocol
DrawingAligntypeprotocol
DRAWING_TEXT_SIZE_MINconstprotocol
DRAWING_TEXT_SIZE_MAXconstprotocol
DrawingElementSchemaconstprotocol
DrawingElementtypeprotocol
DrawingElementKindtypeprotocol
DRAWING_VERSIONconstprotocol
DrawingContentSchemaconstprotocol
DrawingContenttypeprotocol
DrawingDocumentSchemaconstprotocol
DrawingDocumenttypeprotocol
EMPTY_DRAWINGconstprotocol
migrateDrawingfunctionprotocol
duplicateElementIdInfunctionprotocol

Licenses and third-party notices are listed in each package.