import { Component } from '@hatiolab/things-scene' import ControlBase, { DIRECTION, INOUT, NODE, PIPELINE } from './base/control-base' const IMAGE = new URL('../icons/composed-message-processor.png', import.meta.url).href const NATURE = { mutable: false, resizable: false, rotatable: false, properties: [], help: '/eipatterns/composed-message-processor/composed-message-processor' } export default class ComposedMessageProcessor extends ControlBase { static IMAGE: HTMLImageElement static get nature() { return NATURE } get nodes(): NODE[] { return [ { name: 'In', description: 'Message inlet', inout: INOUT.IN, type: PIPELINE.MESSAGE, direction: DIRECTION.WEST, multiplicity: 1 }, { name: 'Out', description: 'Message outlet', inout: INOUT.OUT, type: PIPELINE.MESSAGE, direction: DIRECTION.EAST, multiplicity: 1 } ] } getImageElement(): HTMLImageElement { if (!ComposedMessageProcessor.IMAGE) { ComposedMessageProcessor.IMAGE = new Image() ComposedMessageProcessor.IMAGE.src = IMAGE } return ComposedMessageProcessor.IMAGE } } Component.register('composed-message-processor', ComposedMessageProcessor)