import { Subject } from 'rxjs' ; import { CamelElement } from "../model/CamelModel" ; import { InOut } from "../model/ConnectionModels" ; const positions = new Subject < DslPosition > ( ) ; const flowsPosition = new Subject < DOMRect > ( ) ; export class DslPosition { step : CamelElement = new CamelElement ( "" ) ; rect : DOMRect = new DOMRect ( ) ; constructor ( step , rect ) { this . step = step ; this . rect = rect ; } } export class InOutPosition { inout : InOut = new InOut ( 'in' , '' , 0 , 0 , 0 ) ; rect : DOMRect = new DOMRect ( ) ; constructor ( inout , rect ) { this . inout = inout ; this . rect = rect ; } } export const EventBus = { sendPosition : ( step , rect ) => positions . next ( new DslPosition ( step , rect ) ) , onPosition : ( ) => positions . asObservable ( ) , sendFlowPosition : ( rect ) => flowsPosition . next ( rect ) , onFlowPosition : ( ) => flowsPosition . asObservable ( ) , } ;