import { AnchorPoint, Point } from '../../util/canvas-util'; import { DiagramElement, DiagramElementSet } from './diagram-element'; import { DiagramModel } from './diagram-model'; import { DiagramNode } from './diagram-node'; import { DiagramSection } from './diagram-section'; /** * A foreign object which is inserted with arbitrary SVG code into a diagram. * Similar to a diagram object, but it's part of a node or section and it moves and stretches as its geometry changes. * Diagram decorators are not serialized with other diagram elements. * @public * @see DiagramNode * @see DiagramObject * @see DiagramSection */ export declare class DiagramDecorator extends DiagramElement { /** * Element that this port belongs to. * @public */ rootElement?: DiagramNode | DiagramSection; /** * Coordinates of this decorator. * @public */ coords: Point; /** * Dimension of this decorator along the x axis. * @public */ width: number; /** * Dimension of this decorator along the y axis. * @public */ height: number; priority: number; svg: string; /** * Horizontal anchor point for this decorator. Determines how the decorator behaves when its root element is resized. * @public */ anchorPointX: AnchorPoint; /** * Vertical anchor point for this decorator. Determines how the decorator behaves when its root element is resized. * @public */ anchorPointY: AnchorPoint; constructor(model: DiagramModel, rootElement: DiagramNode | DiagramSection | undefined, coords: Point, width: number, height: number, priority: number, svg: string, id: string, anchorPointX?: AnchorPoint, anchorPointY?: AnchorPoint); get removed(): boolean; updateInView(): void; raise(): void; /** * Change the coordinates of this decorator to the given coordinates. * @public * @param coords A point in the diagram. */ move(coords: Point): void; getPriority(): number; } export declare class DiagramDecoratorSet extends DiagramElementSet { #private; /** * Instance a set of decorators for the given model. This method is used internally. * @private */ constructor(model: DiagramModel); /** * Instance a new decorator and add it to this set. * @public * @param coords The coordinates of the top left corner of the decorator in the diagram. * @param width The dimension of the decorator along the x axis. * @param height The dimension of the decorator along the y axis. * @param priority The priority of the decorator. Used when filtering by priority. * @param svg The SVG contents of the decorator. * @param id The id of the decorator. Cannot be an empty string. * @returns The instanced decorator. */ new(rootElement: DiagramNode | DiagramSection | undefined, coords: Point, width: number, height: number, priority: number, svg: string, id: string, anchorPointX?: AnchorPoint, anchorPointY?: AnchorPoint): DiagramDecorator; remove(id: string): void; }