LabelBehavior.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Calculates a reference point delta relative to a new position
  3. * of a certain element's bounds
  4. *
  5. * @param referencePoint
  6. * @param oldBounds
  7. * @param newBounds
  8. *
  9. * @return
  10. */
  11. export function getReferencePointDelta(referencePoint: Point, oldBounds: Rect, newBounds: Rect): Point;
  12. /**
  13. * Generates the nearest point (reference point) for a given point
  14. * onto given set of lines
  15. *
  16. * @param point
  17. * @param lines
  18. *
  19. * @return
  20. */
  21. export function getReferencePoint(point: Point, lines: Line[]): Point;
  22. /**
  23. * Convert the given bounds to a lines array containing all edges
  24. *
  25. * @param bounds
  26. *
  27. * @return
  28. */
  29. export function asEdges(bounds: Rect | Point): Line[];
  30. /**
  31. * A component that makes sure that external labels are added
  32. * together with respective elements and properly updated (DI wise)
  33. * during move.
  34. *
  35. */
  36. export default class LabelBehavior extends CommandInterceptor {
  37. /**
  38. * @param eventBus
  39. * @param modeling
  40. * @param bpmnFactory
  41. * @param textRenderer
  42. */
  43. constructor(eventBus: EventBus, modeling: Modeling, bpmnFactory: BpmnFactory, textRenderer: TextRenderer);
  44. }
  45. type EventBus = import('diagram-js/lib/core/EventBus').default;
  46. type Modeling = import('../Modeling').default;
  47. type BpmnFactory = import('../BpmnFactory').default;
  48. type TextRenderer = import('../../../draw/TextRenderer').default;
  49. type Point = import('diagram-js/lib/util/Types').Point;
  50. type Rect = import('diagram-js/lib/util/Types').Rect;
  51. export type Line = Point[];
  52. import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';