import type { Bounds2D } from '@math.gl/types'; import type { Graph, EdgeInterface, NodeInterface } from "../graph/graph.js"; import { ClassicGraph } from "../graph/classic-graph.js"; import { GraphLayout, type GraphLayoutEventDetail } from "./graph-layout.js"; import { GraphStylesheetEngine, type GraphStyleRule, type GraphStyleRuleParsed } from "../style/graph-style-engine.js"; type ClassicGraphEngineProps = { graph: ClassicGraph; layout: GraphLayout; onLayoutStart?: (detail?: GraphLayoutEventDetail) => void; onLayoutChange?: (detail?: GraphLayoutEventDetail) => void; onLayoutDone?: (detail?: GraphLayoutEventDetail) => void; onLayoutError?: (error?: unknown) => void; onTransactionStart?: () => void; onTransactionEnd?: () => void; onNodeAdded?: (node: NodeInterface) => void; onNodeRemoved?: (node: NodeInterface) => void; onNodeUpdated?: (node: NodeInterface) => void; onEdgeAdded?: (edge: EdgeInterface) => void; onEdgeRemoved?: (edge: EdgeInterface) => void; onEdgeUpdated?: (edge: EdgeInterface) => void; }; type InterfaceGraphEngineProps = { graph: Graph; layout: GraphLayout; onLayoutStart?: (detail?: GraphLayoutEventDetail) => void; onLayoutChange?: (detail?: GraphLayoutEventDetail) => void; onLayoutDone?: (detail?: GraphLayoutEventDetail) => void; onLayoutError?: (error?: unknown) => void; onTransactionStart?: () => void; onTransactionEnd?: () => void; onNodeAdded?: (node: NodeInterface) => void; onNodeRemoved?: (node: NodeInterface) => void; onNodeUpdated?: (node: NodeInterface) => void; onEdgeAdded?: (edge: EdgeInterface) => void; onEdgeRemoved?: (edge: EdgeInterface) => void; onEdgeUpdated?: (edge: EdgeInterface) => void; }; export type GraphEngineProps = ClassicGraphEngineProps | InterfaceGraphEngineProps; /** Graph engine controls the graph data and layout calculation */ export declare class GraphEngine { private _props; private readonly _graph; private readonly _layout; private readonly _cache; private _layoutDirty; private _transactionInProgress; private _graphCallbacksAttached; private _layoutCallbacksAttached; constructor(props: GraphEngineProps); /** @deprecated Use props constructor: new GraphEngine(props) */ constructor(graph: ClassicGraph, layout: GraphLayout); get props(): GraphEngineProps; setProps(props: Partial>): void; /** Getters */ getNodes: () => NodeInterface[]; getEdges: () => EdgeInterface[]; getNodePosition: (node: NodeInterface) => [number, number]; getEdgePosition: (edge: EdgeInterface) => { type: string; sourcePosition: number[]; targetPosition: number[]; controlPoints: any[]; }; getGraphVersion: () => number; getLayoutLastUpdate: () => number; getLayoutState: () => import("./graph-layout").GraphLayoutState; getLayoutBounds: () => Bounds2D | null; /** Operations on the graph */ lockNodePosition: (node: NodeInterface, x: number, y: number) => void; unlockNodePosition: (node: NodeInterface) => void; findNode(nodeId: string | number): NodeInterface | undefined; /** Creates a stylesheet engine for a single validated or raw style rule. */ createStylesheetEngine(style: GraphStyleRule | GraphStyleRuleParsed, options?: { stateUpdateTrigger?: unknown; }): GraphStylesheetEngine; /** * @fires GraphEngine#onLayoutStart */ _onLayoutStart: (detail?: GraphLayoutEventDetail) => void; /** * @fires GraphEngine#onLayoutChange */ _onLayoutChange: (detail?: GraphLayoutEventDetail) => void; /** * @fires GraphEngine#onLayoutDone */ _onLayoutDone: (detail?: GraphLayoutEventDetail) => void; /** * @fires GraphEngine#onLayoutError */ _onLayoutError: (error?: unknown) => void; _onGraphStructureChanged: () => void; _onTransactionStart: () => void; _onTransactionEnd: () => void; /** Layout calculations */ run: () => void; clear: () => void; resume: () => void; stop: () => void; _graphChanged: () => void; _updateLayout: () => void; _updateCache(key: any, updateValue: any): void; private _attachGraphCallbacks; private _detachGraphCallbacks; private _attachLayoutCallbacks; private _detachLayoutCallbacks; } export {}; //# sourceMappingURL=graph-engine.d.ts.map