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