react-easy-diagram
Version:
<img src="https://github.com/tokarchyn/react-easy-diagram/blob/main/repo/logo-with-name.png?raw=true" alt="React Easy Diagram logo" height="50">
39 lines • 2.23 kB
TypeScript
import { LinkCreationState } from "./linkCreationState";
import { ILinkPortEndpoint } from "./linkPortEndpointState";
import { ILinkState, ILinkStateWithId, LinkState } from "./linkState";
import { PortState } from "./portState";
import { RootStore } from "./rootStore";
import { SuccessOrErrorResult } from "../utils/result";
export declare class LinksStore {
private _links;
private _nodesLinksCollection;
private _linkCreation;
private _rootStore;
constructor(rootStore: RootStore);
import: (newLinks?: ILinkState[] | undefined) => void;
export: () => ILinkState[];
get links(): ReadonlyMap<string, LinkState>;
get linkCreation(): LinkCreationState;
getNodeLinks: (nodeId: string) => LinkState[];
getLink: (id: string) => LinkState | undefined;
getPortLinks: (nodeId: string, portId: string) => LinkState[];
addLinks: (links: ILinkState[], rewriteIfAlreadyConnected?: boolean) => SuccessOrErrorResult<LinkState, ILinkState>[];
addLink: (link: ILinkState, rewriteIfAlreadyConnected?: boolean) => SuccessOrErrorResult<LinkState, ILinkState>;
removeLink: (linkId: string) => ILinkStateWithId | undefined;
removeLinks: (linkIds: string[]) => SuccessOrErrorResult<ILinkStateWithId, string>[];
removeNodeLinks: (nodeId: string) => void;
removePortLinks: (nodeId: string, portId: string) => void;
validateLink: (link: ILinkState, ignoreIfAlreadyConnected?: boolean) => SuccessOrErrorResult;
validateLinkProperties: (link: ILinkState, ignoreIfAlreadyConnected?: boolean) => SuccessOrErrorResult;
getEndpointPortOrError: (endpoint: ILinkPortEndpoint) => SuccessOrErrorResult<PortState>;
getEndpointPort: (endpoint: ILinkPortEndpoint) => PortState | undefined;
areEndpointsConnected: (source: ILinkPortEndpoint, target: ILinkPortEndpoint) => boolean;
getLinkForEndpointsIfExists: (source: ILinkPortEndpoint, target: ILinkPortEndpoint) => LinkState | undefined;
private _addLinksInternal;
private _addLinkInternal;
private _addLinkToNodeLinksCollection;
private _removeLinks;
private _removeLink;
private _removeLinkFromNodeLinksCollection;
}
//# sourceMappingURL=linksStore.d.ts.map