@gravity-ui/graph
Version:
Modern graph editor component
28 lines (27 loc) • 1.18 kB
TypeScript
import { GraphComponent } from "../../../components/canvas/GraphComponent";
import { Graph } from "../../../graph";
import { Component } from "../../../lib";
import { RootStore } from "../../index";
import { PortState, TPortId } from "./Port";
export declare class PortsStore {
rootStore: RootStore;
protected graph: Graph;
$ports: import("@preact/signals-core").ReadonlySignal<PortState[]>;
$portsMap: import("@preact/signals-core").Signal<Map<TPortId, PortState>>;
constructor(rootStore: RootStore, graph: Graph);
createPort(id: TPortId, component: Component): PortState;
getPort(id: TPortId): PortState | undefined;
getOrCreatePort(id: TPortId, component?: Component): PortState;
deletePort(id: TPortId): boolean;
deletePorts(ids: TPortId[]): void;
clearPorts(): void;
protected notifyPortMapChanged: (() => void) & {
cancel: () => void;
flush: () => void;
isScheduled: () => boolean;
};
getPortsByComponent(component: GraphComponent): PortState[];
ownPort(port: PortState, component: GraphComponent): void;
unownPort(port: PortState, component: GraphComponent): void;
reset(): void;
}