Modeling.d.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * The BPMN 2.0 modeling entry point.
  3. *
  4. *
  5. * @extends {BaseModeling<T, U, V, W, X>}
  6. *
  7. */
  8. export default class Modeling<T extends import("../../model/Types").Connection = import("../../model/Types").Connection, U extends import("../../model/Types").Element = import("../../model/Types").Element, V extends import("../../model/Types").Label = import("../../model/Types").Label, W extends import("../../model/Types").Parent = import("../../model/Types").Parent, X extends import("../../model/Types").Shape = import("../../model/Types").Shape> extends BaseModeling<T, U, V, W, X> {
  9. /**
  10. * @param eventBus
  11. * @param elementFactory
  12. * @param commandStack
  13. * @param bpmnRules
  14. */
  15. constructor(eventBus: EventBus, elementFactory: ElementFactory, commandStack: CommandStack, bpmnRules: BpmnRules);
  16. getHandlers(): any;
  17. /**
  18. * Update an element's label.
  19. *
  20. * @param element The element.
  21. * @param newLabel The new label.
  22. * @param newBounds The optional bounds of the label.
  23. * @param hints The optional hints.
  24. */
  25. updateLabel(element: Element, newLabel: string, newBounds?: Rect, hints?: UpdateLabelHints): void;
  26. /**
  27. * @param source
  28. * @param target
  29. * @param attrs
  30. * @param hints
  31. *
  32. * @return
  33. */
  34. connect(source: Element, target: Element, attrs: Partial<Connection>, hints?: ModelingHints): T;
  35. /**
  36. * Update a model element's properties.
  37. *
  38. * @param element The element.
  39. * @param moddleElement The model element.
  40. * @param properties The updated properties.
  41. */
  42. updateModdleProperties(element: Element, moddleElement: ModdleElement, properties: any): void;
  43. /**
  44. * Update an element's properties.
  45. *
  46. * @param element The element.
  47. * @param properties The updated properties.
  48. */
  49. updateProperties(element: Element, properties: any): void;
  50. /**
  51. * Resize a lane.
  52. *
  53. * @param laneShape The lane.
  54. * @param newBounds The new bounds of the lane.
  55. * @param balanced Wether to resize neighboring lanes.
  56. */
  57. resizeLane(laneShape: Shape, newBounds: Rect, balanced?: boolean): void;
  58. /**
  59. * Add a lane.
  60. *
  61. * @param targetLaneShape The shape to add the lane to.
  62. * @param location The location.
  63. *
  64. * @return The added lane.
  65. */
  66. addLane(targetLaneShape: Shape, location: string): Shape;
  67. /**
  68. * Split a lane.
  69. *
  70. * @param targetLane The lane to split.
  71. * @param count The number of lanes to split the lane into. Must not
  72. * exceed the number of existing lanes.
  73. */
  74. splitLane(targetLane: Shape, count: number): void;
  75. /**
  76. * Turn a process into a collaboration.
  77. *
  78. * @return The root of the collaboration.
  79. */
  80. makeCollaboration(): Root;
  81. /**
  82. * Transform a collaboration into a process.
  83. *
  84. * @return The root of the process.
  85. */
  86. makeProcess(): Root;
  87. /**
  88. * Update the referenced lanes of each flow node.
  89. *
  90. * @param flowNodeShapes The flow nodes to update.
  91. * @param laneShapes The lanes.
  92. */
  93. updateLaneRefs(flowNodeShapes: Shape[], laneShapes: Shape[]): void;
  94. /**
  95. * Claim an ID.
  96. *
  97. * @param id The ID to claim.
  98. * @param moddleElement The model element the ID is claimed for.
  99. */
  100. claimId(id: string, moddleElement: ModdleElement): void;
  101. /**
  102. * Unclaim an ID.
  103. *
  104. * @param id The ID to unclaim.
  105. * @param moddleElement The model element the ID is claimed for.
  106. */
  107. unclaimId(id: string, moddleElement: ModdleElement): void;
  108. /**
  109. * Set the color(s) of one or many elements.
  110. *
  111. * @param elements The elements to set the color(s) for.
  112. * @param colors The color(s) to set.
  113. */
  114. setColor(elements: Element[], colors: Colors): void;
  115. }
  116. type BpmnRules = import('../rules/BpmnRules').default;
  117. type CommandStack = import('diagram-js/lib/command/CommandStack').default;
  118. type ElementFactory = import('./ElementFactory').default;
  119. type EventBus = import('diagram-js/lib/core/EventBus').default;
  120. type ModelingHints = import('diagram-js/lib/features/modeling/Modeling').ModelingHints;
  121. type Connection = import('../../model/Types').Connection;
  122. type Element = import('../../model/Types').Element;
  123. type Label = import('../../model/Types').Label;
  124. type Parent = import('../../model/Types').Parent;
  125. type Root = import('../../model/Types').Root;
  126. type Shape = import('../../model/Types').Shape;
  127. type ModdleElement = import('../../model/Types').ModdleElement;
  128. type Rect = import('diagram-js/lib/util/Types').Rect;
  129. type Colors = import('../../util/Types').Colors;
  130. export type UpdateLabelHints = {
  131. removeShape?: boolean;
  132. };
  133. import BaseModeling from 'diagram-js/lib/features/modeling/Modeling';