ElementFactory.d.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /**
  2. * A BPMN-specific element factory.
  3. *
  4. *
  5. * @extends {BaseElementFactory<T, U, V, W>}
  6. *
  7. */
  8. export default class ElementFactory<T extends import("../../model/Types").Connection = import("../../model/Types").Connection, U extends import("../../model/Types").Label = import("../../model/Types").Label, V extends import("../../model/Types").Root = import("../../model/Types").Root, W extends import("../../model/Types").Shape = import("../../model/Types").Shape> extends BaseElementFactory<T, U, V, W> {
  9. static $inject: string[];
  10. /**
  11. * @param bpmnFactory
  12. * @param moddle
  13. * @param translate
  14. */
  15. constructor(bpmnFactory: BpmnFactory, moddle: Moddle, translate: Translate);
  16. /**
  17. * Create a label.
  18. *
  19. * @param elementType
  20. * @param attrs
  21. * @return
  22. */
  23. create(elementType: 'label', attrs?: Partial<Label> & Partial<BpmnAttributes>): U;
  24. /**
  25. * Create a connection.
  26. *
  27. * @param elementType
  28. * @param attrs
  29. * @return
  30. */
  31. create(
  32. elementType: 'connection',
  33. attrs?: Partial<Connection> & Partial<BpmnAttributes>
  34. ): T;
  35. /**
  36. * Create a shape.
  37. *
  38. * @param elementType
  39. * @param attrs
  40. * @return
  41. */
  42. create(elementType: 'shape', attrs?: Partial<Shape> & Partial<BpmnAttributes>): W;
  43. /**
  44. * Create a root element.
  45. *
  46. * @param elementType
  47. * @param attrs
  48. * @return
  49. */
  50. create(elementType: 'root', attrs?: Partial<Root> & Partial<BpmnAttributes>): V;
  51. /**
  52. * Create a BPMN connection.
  53. *
  54. * @param elementType
  55. * @param attrs
  56. * @return
  57. */
  58. createElement(
  59. elementType: 'connection',
  60. attrs?: Partial<Connection> & Partial<BpmnAttributes>
  61. ): T;
  62. /**
  63. * Create a BPMN shape.
  64. *
  65. * @param elementType
  66. * @param attrs
  67. * @return
  68. */
  69. createElement(elementType: 'shape', attrs?: Partial<Shape> & Partial<BpmnAttributes>): W;
  70. /**
  71. * Create a BPMN root element.
  72. *
  73. * @param elementType
  74. * @param attrs
  75. * @return
  76. */
  77. createElement(elementType: 'root', attrs?: Partial<Root> & Partial<BpmnAttributes>): V;
  78. /**
  79. * Get the default size of a diagram element.
  80. *
  81. * @param element The element.
  82. * @param di The DI.
  83. *
  84. * @return Default width and height of the element.
  85. */
  86. getDefaultSize(element: Element, di: ModdleElement): Dimensions;
  87. /**
  88. * Create participant.
  89. *
  90. * @param attrs
  91. * Attributes or whether the participant is expanded.
  92. *
  93. * @return The created participant.
  94. */
  95. createParticipantShape(attrs?: boolean | (Partial<Shape> & Partial<BpmnAttributes>)): W;
  96. }
  97. export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
  98. type Dimensions = import('diagram-js/lib/util/Types').Dimensions;
  99. type BpmnFactory = import('./BpmnFactory').default;
  100. type BpmnAttributes = import('../../model/Types').BpmnAttributes;
  101. type Connection = import('../../model/Types').Connection;
  102. type Element = import('../../model/Types').Element;
  103. type Label = import('../../model/Types').Label;
  104. type Root = import('../../model/Types').Root;
  105. type Shape = import('../../model/Types').Shape;
  106. type Moddle = import('../../model/Types').Moddle;
  107. type ModdleElement = import('../../model/Types').ModdleElement;
  108. import BaseElementFactory from 'diagram-js/lib/core/ElementFactory';