@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
24 lines (23 loc) • 648 B
JavaScript
import { localId, newLocalId } from '@selenite/commons';
export class Port {
socket;
id;
multipleConnections;
label = $state();
description = $state();
index = $state();
constructor(params) {
this.id = localId('port');
this.socket = params.socket;
this.socket.port = this;
this.multipleConnections = params.multipleConnections ?? false;
this.label = params.label;
this.description = params.description;
this.index = params.index;
}
}
export class Output extends Port {
constructor(params) {
super({ multipleConnections: true, ...params });
}
}