UNPKG

1.67 kBTypeScriptView Raw
1/**
2 * Return true if the given semantic has an external label.
3 *
4 * @param semantic
5 *
6 * @return
7 */
8export function isLabelExternal(semantic: Element): boolean;
9
10/**
11 * Return true if the given element has an external label.
12 *
13 * @param element
14 *
15 * @return
16 */
17export function hasExternalLabel(element: Element): boolean;
18
19/**
20 * Get the position of a sequence flow label.
21 *
22 * @param waypoints
23 *
24 * @return
25 */
26export function getFlowLabelPosition(waypoints: Point[]): Point;
27
28/**
29 * Get the middle of a number of waypoints.
30 *
31 * @param waypoints
32 *
33 * @return
34 */
35export function getWaypointsMid(waypoints: Point[]): Point;
36
37/**
38 * Get the middle of the external label of an element.
39 *
40 * @param element
41 *
42 * @return
43 */
44export function getExternalLabelMid(element: Element): Point;
45
46/**
47 * Return the bounds of an elements label, parsed from the elements DI or
48 * generated from its bounds.
49 *
50 * @param di
51 * @param element
52 *
53 * @return
54 */
55export function getExternalLabelBounds(di: ModdleElement, element: Element): Rect;
56
57/**
58 * @param element
59 *
60 * @return
61 */
62export function getLabel(element: Element): string;
63
64/**
65 * @param element
66 * @param text
67 *
68 * @return
69 */
70export function setLabel(element: Element, text: string): Element;
71
72export { isLabel } from "diagram-js/lib/util/ModelUtil";
73
74export namespace DEFAULT_LABEL_SIZE {
75 const width: number;
76 const height: number;
77}
78
79export const FLOW_LABEL_INDENT: number;
80type Point = import('diagram-js/lib/util/Types').Point;
81type Rect = import('diagram-js/lib/util/Types').Rect;
82type Element = import('../model/Types').Element;
83type ModdleElement = import('../model/Types').ModdleElement;