| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- /**
- * BPMN-specific modeling rules.
- *
- */
- export default class BpmnRules extends RuleProvider {
- canConnectMessageFlow: typeof canConnectMessageFlow;
- canConnectSequenceFlow: typeof canConnectSequenceFlow;
- canConnectDataAssociation: typeof canConnectDataAssociation;
- canConnectAssociation: typeof canConnectAssociation;
- canConnectCompensationAssociation: typeof canConnectCompensationAssociation;
- canMove: typeof canMove;
- canAttach: typeof canAttach;
- canReplace: typeof canReplace;
- canDrop: typeof canDrop;
- canInsert: typeof canInsert;
- canCreate: typeof canCreate;
- canConnect: typeof canConnect;
- canResize: typeof canResize;
- canCopy: typeof canCopy;
- }
- type EventBus = import('diagram-js/lib/core/EventBus').default;
- type Connection = import('../../model/Types').Connection;
- type Element = import('../../model/Types').Element;
- type Shape = import('../../model/Types').Shape;
- type ModdleElement = import('../../model/Types').ModdleElement;
- type Point = import('diagram-js/lib/util/Types').Point;
- type Rect = import('diagram-js/lib/util/Types').Rect;
- export type CanConnectResult = {
- associationDirection?: 'None' | 'One' | 'Both';
- type: string;
- } | boolean | null;
- export type CanReplaceResult = {
- id: string;
- type: string;
- } | boolean;
- import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';
- /**
- * @param source
- * @param target
- *
- * @return
- */
- declare function canConnectMessageFlow(source: Element, target: Element): boolean;
- /**
- * @param source
- * @param target
- *
- * @return
- */
- declare function canConnectSequenceFlow(source: Element, target: Element): boolean;
- /**
- * @param source
- * @param target
- *
- * @return
- */
- declare function canConnectDataAssociation(source: Element, target: Element): CanConnectResult;
- /**
- * @param source
- * @param target
- *
- * @return
- */
- declare function canConnectAssociation(source: Element, target: Element): CanConnectResult;
- /**
- * @param source
- * @param target
- *
- * @return
- */
- declare function canConnectCompensationAssociation(source: Element, target: Element): boolean;
- /**
- * @param elements
- * @param target
- *
- * @return
- */
- declare function canMove(elements: Element[], target: Shape): boolean;
- /**
- * TODO(philippfromme): remove `source` parameter
- *
- * @param elements
- * @param target
- * @param source
- * @param position
- *
- * @return
- */
- declare function canAttach(elements: Element[], target: Shape, source: Element, position?: Point): boolean | 'attach';
- /**
- * Check whether the given elements can be replaced. Return all elements which
- * can be replaced.
- *
- * @example
- *
- * ```javascript
- * [{
- * id: 'IntermediateEvent_1',
- * type: 'bpmn:StartEvent'
- * },
- * {
- * id: 'Task_1',
- * type: 'bpmn:ServiceTask'
- * }]
- * ```
- *
- * @param elements
- * @param target
- * @param position
- *
- * @return
- */
- declare function canReplace(elements: Element[], target?: Shape, position?: Point): CanReplaceResult;
- /**
- * Can an element be dropped into the target element.
- *
- * @param element
- * @param target
- *
- * @return
- */
- declare function canDrop(element: Element, target: Shape): boolean;
- /**
- * @param shape
- * @param connection
- * @param position
- *
- * @return
- */
- declare function canInsert(shape: Shape, connection: Connection, position: Point): boolean;
- /**
- * @param shape
- * @param target
- * @param source
- * @param position
- *
- * @return
- */
- declare function canCreate(shape: Shape, target: Shape, source: Element, position: Point): boolean;
- /**
- * @param source
- * @param target
- * @param connection
- *
- * @return
- */
- declare function canConnect(source: Element, target: Element, connection: Connection): CanConnectResult;
- /**
- * @param shape
- * @param newBounds
- *
- * @return
- */
- declare function canResize(shape: Shape, newBounds: Rect): boolean;
- /**
- * @param elements
- * @param element
- *
- * @return
- */
- declare function canCopy(elements: Element[], element: Element): boolean;
- export {};
|