import { A as PortConfig, C as GraphStep, D as NodeUpdate, E as NodeConfig, I as VisualGraph, L as VisualGraphConfig, N as TransitionOptions, S as GraphPort, U as WalkOptions, W as WeightedWalkOptions, b as GraphPatch, c as EdgeUpdate, f as Graph, h as GraphEdge, i as DeleteNodeOptions, l as EntitiesConfig, m as GraphDiff, o as EdgeConfig, p as GraphConfig, r as CoverageStats, u as EntitiesUpdate, v as GraphMode, y as GraphNode } from "./types-BAEQTwK_.mjs"; //#region src/graph.d.ts /** * Create a resolved graph port from a config. Fills in defaults. * * @example * ```ts * const port = createGraphPort({ name: 'output', direction: 'out' }); * // { name: 'output', direction: 'out', data: null } * ``` */ declare function createGraphPort

(config: PortConfig

): GraphPort

; /** * Create a resolved graph node from a config. Fills in defaults. * * @example * ```ts * const node = createGraphNode({ id: 'a', data: { label: 'hi' } }); * // { type: 'node', id: 'a', label: '', data: { label: 'hi' } } * ``` */ declare function createGraphNode(config: NodeConfig): GraphNode; /** * Create a resolved graph edge from a config. Fills in defaults. * * @example * ```ts * const edge = createGraphEdge({ id: 'e1', sourceId: 'a', targetId: 'b' }); * // { type: 'edge', id: 'e1', sourceId: 'a', targetId: 'b', label: null, data: null } * ``` */ declare function createGraphEdge(config: EdgeConfig): GraphEdge; /** * Create a graph from a config. Resolves defaults for all fields. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * ``` */ declare function createGraph(config?: GraphConfig): Graph; /** * Create a visual graph with required position/size on all nodes and edges. * * @example * ```ts * const graph = createVisualGraph({ * nodes: [{ id: 'a', x: 0, y: 0, width: 100, height: 50 }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'a', x: 0, y: 0, width: 0, height: 0 }], * }); * // graph.nodes[0].x === 0 * ``` */ declare function createVisualGraph(config?: VisualGraphConfig): VisualGraph; /** * Create a graph by BFS exploration of a transition function. * Each unique state becomes a node; each (state, event) -> nextState becomes an edge. * * - Node IDs are determined by `serializeState` (default: `JSON.stringify`). * - Edge IDs use the format `sourceId|serializedEvent|targetId` for uniqueness * and debuggability. Edge labels are just the serialized event string. * * @example * ```ts * const graph = createGraphFromTransition( * (state, event) => { * if (state === 'green' && event === 'TIMER') return 'yellow'; * if (state === 'yellow' && event === 'TIMER') return 'red'; * if (state === 'red' && event === 'TIMER') return 'green'; * return state; * }, * { * initialState: 'green', * events: ['TIMER'], * serializeState: (s) => s, * serializeEvent: (e) => e, * }, * ); * // graph.nodes.length === 3 * ``` */ declare function createGraphFromTransition(transition: (state: TState, event: TEvent) => TState, options: TransitionOptions): Graph; /** * Get a node by id, or `undefined` if not found. * * @example * ```ts * const graph = createGraph({ nodes: [{ id: 'a' }] }); * const node = getNode(graph, 'a'); // GraphNode * const missing = getNode(graph, 'z'); // undefined * ``` */ declare function getNode(graph: Graph, id: string): GraphNode | undefined; /** * Get an edge by id, or `undefined` if not found. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * const edge = getEdge(graph, 'e1'); // GraphEdge * const missing = getEdge(graph, 'z'); // undefined * ``` */ declare function getEdge(graph: Graph, id: string): GraphEdge | undefined; /** * Check if a node exists in the graph. * * @example * ```ts * const graph = createGraph({ nodes: [{ id: 'a' }] }); * hasNode(graph, 'a'); // true * hasNode(graph, 'z'); // false * ``` */ declare function hasNode(graph: Graph, id: string): boolean; /** * Check if an edge exists in the graph. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * hasEdge(graph, 'e1'); // true * hasEdge(graph, 'z'); // false * ``` */ declare function hasEdge(graph: Graph, id: string): boolean; /** * **Mutable.** Add a node to the graph. Mutates `graph.nodes` in place. * @returns The resolved node that was added. * * @example * ```ts * const graph = createGraph(); * const node = addNode(graph, { id: 'a', label: 'Node A' }); * // graph.nodes.length === 1 * ``` */ declare function addNode(graph: Graph, config: NodeConfig): GraphNode; /** * **Mutable.** Add an edge to the graph. Mutates `graph.edges` in place. * @returns The resolved edge that was added. * * @example * ```ts * const graph = createGraph({ nodes: [{ id: 'a' }, { id: 'b' }] }); * const edge = addEdge(graph, { id: 'e1', sourceId: 'a', targetId: 'b' }); * // graph.edges.length === 1 * ``` */ declare function addEdge(graph: Graph, config: EdgeConfig): GraphEdge; /** * **Mutable.** Delete a node and its connected edges. Mutates `graph.nodes` * and `graph.edges` in place. * * By default, children are deleted recursively. * With `{ reparent: true }`, children are re-parented to the deleted node's parent. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * deleteNode(graph, 'a'); * // graph.nodes.length === 1, edge e1 also removed * ``` */ declare function deleteNode(graph: Graph, id: string, opts?: DeleteNodeOptions): void; /** * **Mutable.** Delete an edge. Mutates `graph.edges` in place. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * deleteEdge(graph, 'e1'); * // graph.edges.length === 0 * ``` */ declare function deleteEdge(graph: Graph, id: string): void; /** * **Mutable.** Update a node in place. * Optional fields (`x`, `y`, `width`, `height`, `shape`, `color`, `style`, * `ports`) accept `null` to unset; `undefined` leaves them unchanged. * @returns The updated node. * * @example * ```ts * const graph = createGraph({ nodes: [{ id: 'a', label: 'old' }] }); * const updated = updateNode(graph, 'a', { label: 'new', x: 100 }); * // updated.label === 'new', updated.x === 100 * ``` */ declare function updateNode(graph: Graph, id: string, update: NodeUpdate): GraphNode; /** * **Mutable.** Update an edge in place. * Optional fields (`weight`, `mode`, `sourcePort`, `targetPort`, `x`, `y`, * `width`, `height`, `color`, `style`) accept `null` to unset; `undefined` * leaves them unchanged. * @returns The updated edge. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b', label: 'old' }], * }); * const updated = updateEdge(graph, 'e1', { label: 'new', weight: 2 }); * // updated.label === 'new', updated.weight === 2 * ``` */ declare function updateEdge(graph: Graph, id: string, update: EdgeUpdate): GraphEdge; /** * **Mutable.** Add multiple nodes and edges to the graph. * Nodes are added first, then edges (so edges can reference new nodes). * * @example * ```ts * const graph = createGraph(); * addEntities(graph, { * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * // graph.nodes.length === 2, graph.edges.length === 1 * ``` */ declare function addEntities(graph: Graph, entities: EntitiesConfig): void; /** * **Mutable.** Delete entities by id(s). Automatically detects whether each id * is a node or edge. Node deletions cascade to children and connected edges. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * deleteEntities(graph, ['a', 'e1']); * // graph.nodes.length === 1, graph.edges.length === 0 * ``` */ declare function deleteEntities(graph: Graph, ids: string | string[], opts?: DeleteNodeOptions): void; /** * **Mutable.** Update multiple nodes and edges in place. * Each entry must include an `id` to identify which entity to update. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a', label: 'old' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'a', label: 'old' }], * }); * updateEntities(graph, { * nodes: [{ id: 'a', label: 'new' }], * edges: [{ id: 'e1', label: 'new' }], * }); * ``` */ declare function updateEntities(graph: Graph, updates: EntitiesUpdate): void; /** * OOP wrapper around a plain `Graph` object. * Delegates to the standalone mutable functions. * * @example * ```ts * const instance = new GraphInstance({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * instance.addNode({ id: 'c' }); * instance.hasNode('c'); // true * instance.toJSON(); // plain Graph object * ``` */ declare class GraphInstance { graph: Graph; constructor(config?: GraphConfig); /** * Wrap an existing plain graph object. * * @example * ```ts * const graph = createGraph({ nodes: [{ id: 'a' }] }); * const instance = GraphInstance.from(graph); * instance.hasNode('a'); // true * ``` */ static from(graph: Graph): GraphInstance; get id(): string; /** Default directedness for all edges. */ get mode(): GraphMode; get nodes(): GraphNode[]; get edges(): GraphEdge[]; get data(): G; getNode(id: string): GraphNode | undefined; getEdge(id: string): GraphEdge | undefined; hasNode(id: string): boolean; hasEdge(id: string): boolean; addNode(config: NodeConfig): GraphNode; addEdge(config: EdgeConfig): GraphEdge; deleteNode(id: string, opts?: DeleteNodeOptions): void; deleteEdge(id: string): void; updateNode(id: string, update: NodeUpdate): GraphNode; updateEdge(id: string, update: EdgeUpdate): GraphEdge; addEntities(entities: EntitiesConfig): void; deleteEntities(ids: string | string[], opts?: DeleteNodeOptions): void; updateEntities(updates: EntitiesUpdate): void; toJSON(): Graph; } //#endregion //#region src/mode.d.ts /** * Resolve an edge's effective directedness. Falls back to the graph's * {@link Graph.mode} when the edge has no per-edge override. */ declare function getEdgeMode(graph: Graph, edge: GraphEdge): GraphMode; /** Whether an edge points only from source to target. */ declare function isEdgeDirected(graph: Graph, edge: GraphEdge): boolean; //#endregion //#region src/validate.d.ts /** * A structural problem found in a graph by {@link getGraphIssues}. */ interface GraphIssue { /** Stable machine-readable code, e.g. `'duplicate-node-id'`. */ code: string; /** What is wrong, which entity is affected, and how to fix it. */ message: string; /** Location of the offending value, e.g. `['nodes', 0, 'id']`. */ path?: (string | number)[]; } /** * Validates the structural invariants of a graph and returns the issues * found, or `[]` when the graph is valid. Pure — never throws, never mutates. * * This is the recommended gate for untrusted or imported graphs (e.g. parsed * from a file or received over the wire) before handing them to queries and * algorithms: the mutation APIs (`addNode`, `addEdge`, `updateNode`, …) * validate incrementally, but `createGraph` does **not** — it accepts * dangling `parentId`/edge references and even `parentId` cycles as-is. * * For Zod-based shape validation of arbitrary unknown values, see * `validateGraph` in `@statelyai/graph/schemas` (which reuses these checks). * * Issue codes: `duplicate-node-id`, `duplicate-edge-id`, * `missing-initial-node`, `missing-parent`, `missing-node-initial`, * `duplicate-port-name`, `parent-cycle`, `dangling-edge-endpoint`, * `missing-source-port`, `missing-target-port`. * * @example * ```ts * const graph = createGraph({ * nodes: [{ id: 'a', parentId: 'ghost' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * getGraphIssues(graph); * // => [ * // { code: 'missing-parent', message: '...', path: ['nodes', 0, 'parentId'] }, * // { code: 'dangling-edge-endpoint', message: '...', path: ['edges', 0, 'targetId'] }, * // ] * ``` */ declare function getGraphIssues(graph: Graph): GraphIssue[]; //#endregion //#region src/indexing.d.ts /** * Clear the cached index. Call this if you mutate fields of existing * nodes/edges in place (e.g. `edge.targetId = 'a'`) — such mutations are not * auto-detected. Array replacement and length changes are auto-detected. * * @example * ```ts * import { createGraph, getSuccessors, invalidateIndex } from '@statelyai/graph'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }], * edges: [{ id: 'e1', sourceId: 'a', targetId: 'b' }], * }); * graph.edges[0].targetId = 'a'; // in-place field mutation * invalidateIndex(graph); // forces rebuild on next indexed read * getSuccessors(graph, 'a'); * ``` */ declare function invalidateIndex(graph: Graph): void; //#endregion //#region src/generators.d.ts /** * Create the complete graph K_n: every pair of distinct nodes connected by * one undirected edge. Nodes are `n0..n{n-1}` (`options.idPrefix` overrides * the `n` prefix); edges are `e0..`. */ declare function createCompleteGraph(n: number, options?: { idPrefix?: string; }): Graph; /** * Create a `rows × cols` grid graph: node `(r, c)` is connected to its right * and down neighbors by undirected edges. Nodes are `n{r}_{c}` * (`options.idPrefix` overrides the `n` prefix); edges are `e0..`. */ declare function createGridGraph(rows: number, cols: number, options?: { idPrefix?: string; }): Graph; /** * Create an Erdős–Rényi G(n, p) random graph: each of the n·(n-1)/2 node * pairs gets an undirected edge with probability `probability`. With * `options.seed` the result is deterministic per seed (mulberry32); * otherwise `Math.random` is used. Nodes are `n0..n{n-1}` * (`options.idPrefix` overrides the `n` prefix); edges are `e0..`. */ declare function createRandomGraph(n: number, probability: number, options?: { seed?: number; idPrefix?: string; }): Graph; //#endregion //#region src/equivalence.d.ts declare const LAYOUT_KEYS: { node: readonly ["x", "y", "width", "height", "style", "color", "shape"]; edge: readonly ["x", "y", "width", "height", "points", "routing", "style", "color"]; }; /** * Compare two entities on a given set of keys. * If `keys` is omitted or empty, compares all own keys of `a`. * * @example * ```ts * import { createGraphNode, areEntitiesEqual, LAYOUT_KEYS } from '@statelyai/graph'; * * const a = createGraphNode({ id: 'n1', label: 'hello', x: 0 }); * const b = createGraphNode({ id: 'n1', label: 'hello', x: 100 }); * * areEntitiesEqual(a, b, LAYOUT_KEYS.node); // false (x differs) * areEntitiesEqual(a, b, NON_LAYOUT_KEYS.node); // true * areEntitiesEqual(a, b); // false (compares all keys) * ``` */ declare function areEntitiesEqual(a: T, b: T, keys?: readonly (keyof T)[]): boolean; /** * Compare two entities on layout keys only (position, size, style, color, shape). * * @example * ```ts * import { createGraphNode, isLayoutEqual } from '@statelyai/graph'; * * const a = createGraphNode({ id: 'n1', x: 0, y: 0 }); * const b = createGraphNode({ id: 'n1', x: 100, y: 200 }); * * isLayoutEqual(a, b); // false * ``` */ declare function isLayoutEqual(a: T, b: T): boolean; /** * Compare two entities on non-layout keys only (id, data, connections, labels, etc.). * * @example * ```ts * import { createGraphNode, isNonLayoutEqual } from '@statelyai/graph'; * * const a = createGraphNode({ id: 'n1', label: 'hello', x: 0 }); * const b = createGraphNode({ id: 'n1', label: 'hello', x: 100 }); * * isNonLayoutEqual(a, b); // true (layout changed, but non-layout didn't) * ``` */ declare function isNonLayoutEqual(a: T, b: T): boolean; //#endregion //#region src/diff.d.ts /** * Compute a structured diff from graph `a` to graph `b` by matching IDs. * * @example * ```ts * import { createGraph, getDiff } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n1', label: 'hello' }, { id: 'n2' }], edges: [] }); * * const diff = getDiff(a, b); * // diff.nodes.added → [{ id: 'n2' }] * // diff.nodes.updated → [{ id: 'n1', old: { label: '' }, new: { label: 'hello' } }] * ``` */ declare function getDiff(a: Graph, b: Graph): GraphDiff; /** * Check if a diff has zero changes. * * @example * ```ts * import { createGraph, getDiff, isEmptyDiff } from '@statelyai/graph'; * * const g = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const diff = getDiff(g, g); * isEmptyDiff(diff); // true * ``` */ declare function isEmptyDiff(diff: GraphDiff): boolean; /** * Invert a diff: swap added/removed, swap old/new in updates. * * @example * ```ts * import { createGraph, getDiff, getInvertedDiff } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n2' }], edges: [] }); * * const diff = getDiff(a, b); * const inv = getInvertedDiff(diff); * // inv.nodes.added contains n1 (was removed) * // inv.nodes.removed contains n2 (was added) * ``` */ declare function getInvertedDiff(diff: GraphDiff): GraphDiff; /** * @deprecated Use {@link getInvertedDiff}. */ declare function invertDiff(diff: GraphDiff): GraphDiff; /** * Compute an ordered patch list from graph `a` to graph `b`. * Order (see {@link toPatches}): add nodes → update edges → delete edges → * delete nodes → add edges → update nodes. * * @example * ```ts * import { createGraph, getPatches } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n1' }, { id: 'n2' }], edges: [] }); * * const patches = getPatches(a, b); * // patches → [{ op: 'addNode', node: { id: 'n2' } }] * ``` */ declare function getPatches(a: Graph, b: Graph): GraphPatch[]; /** * **Mutable.** Apply patches to a graph in order. * Delegates to addNode/deleteNode/updateNode/addEdge/deleteEdge/updateEdge. * * @example * ```ts * import { createGraph, getPatches, updateGraphWithPatches } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n1' }, { id: 'n2' }], edges: [] }); * * const patches = getPatches(a, b); * updateGraphWithPatches(a, patches); * // a now contains both n1 and n2 * ``` */ declare function updateGraphWithPatches(graph: Graph, patches: GraphPatch[]): void; /** * @deprecated Use {@link updateGraphWithPatches}. */ declare function applyPatches(graph: Graph, patches: GraphPatch[]): void; /** * Flatten a structured diff into an ordered patch list. * Order: add nodes → update edges → delete edges → delete nodes → add edges → update nodes. * This avoids cascading deletes removing edges that are being updated, * and ensures new nodes exist before edges reference them. * * @example * ```ts * import { createGraph, getDiff, toPatches } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n2' }], edges: [] }); * * const diff = getDiff(a, b); * const patches = toPatches(diff); * // patches → [{ op: 'addNode', ... }, { op: 'deleteNode', ... }] * ``` */ declare function toPatches(diff: GraphDiff): GraphPatch[]; /** * Group a patch list into a structured diff. * * @example * ```ts * import { createGraph, getPatches, toDiff } from '@statelyai/graph'; * * const a = createGraph({ nodes: [{ id: 'n1' }], edges: [] }); * const b = createGraph({ nodes: [{ id: 'n1' }, { id: 'n2' }], edges: [] }); * * const patches = getPatches(a, b); * const diff = toDiff(patches); * // diff.nodes.added → [{ id: 'n2' }] * ``` */ declare function toDiff(patches: GraphPatch[]): GraphDiff; //#endregion //#region src/transforms.d.ts /** * Flattens a hierarchical graph into a flat graph with only leaf nodes. * * - Edges targeting a compound node resolve to its initial child (recursively). * - Edges originating from a compound node expand to all leaf descendants. * - Only leaf nodes (nodes with no children) appear in the result. * - Duplicate edges (same source + target) are deduplicated. * * @example * ```ts * import { createGraph, getFlattenedGraph } from '@statelyai/graph'; * * const graph = createGraph({ * nodes: [ * { id: 'parent', initialNodeId: 'child1' }, * { id: 'child1', parentId: 'parent' }, * { id: 'child2', parentId: 'parent' }, * { id: 'other' }, * ], * edges: [{ id: 'e1', sourceId: 'other', targetId: 'parent' }], * }); * * const flat = getFlattenedGraph(graph); * // flat.nodes → [child1, child2, other] (leaf nodes only) * // flat.edges → edge from 'other' → 'child1' (resolved via initialNodeId) * ``` */ declare function getFlattenedGraph(graph: Graph): Graph; /** * @deprecated Use {@link getFlattenedGraph}. */ declare function flatten(graph: Graph): Graph; /** * Returns the induced subgraph containing only the given node IDs * and edges whose endpoints are both in the set. * * Parent references to nodes outside the set are removed. * * @example * ```ts * import { createGraph, getSubgraph } from '@statelyai/graph'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }, { id: 'c' }], * edges: [ * { id: 'ab', sourceId: 'a', targetId: 'b' }, * { id: 'bc', sourceId: 'b', targetId: 'c' }, * ], * }); * * const sub = getSubgraph(graph, ['a', 'b']); * // sub.nodes: [a, b], sub.edges: [ab] * ``` */ declare function getSubgraph(graph: Graph, nodeIds: string[]): Graph; /** * Returns a new graph with all edge directions flipped (source ↔ target). * Optionally filters which edges to include. * * @example * ```ts * import { createGraph, getReversedGraph } from '@statelyai/graph'; * * const graph = createGraph({ * nodes: [{ id: 'a' }, { id: 'b' }, { id: 'c' }], * edges: [ * { id: 'ab', sourceId: 'a', targetId: 'b' }, * { id: 'bc', sourceId: 'b', targetId: 'c' }, * ], * }); * * const rev = getReversedGraph(graph); * // rev edges: b→a, c→b * * const filtered = getReversedGraph(graph, (e) => e.id !== 'bc'); * // filtered edges: b→a (only ab reversed, bc excluded) * ``` */ declare function getReversedGraph(graph: Graph, filterEdge?: (edge: GraphEdge) => boolean): Graph; /** * @deprecated Use {@link getReversedGraph}. */ declare function reverseGraph(graph: Graph, filterEdge?: (edge: GraphEdge) => boolean): Graph; //#endregion //#region src/walks.d.ts /** * Random walk. At each node, picks a uniformly random traversable edge * (outgoing edges, plus non-directed edges both ways). * Yields steps indefinitely (may revisit nodes) until a sink node is reached. */ declare function genRandomWalk(graph: Graph, options?: WalkOptions): Generator>; /** * Weighted random walk. Edge selection probability proportional to weight. */ declare function genWeightedRandomWalk(graph: Graph, options?: WeightedWalkOptions): Generator>; /** * Quick random walk targeting unvisited edges. * If unvisited traversable edges exist at the current node, picks one randomly. * Otherwise, walks the fewest-hop path (BFS, honoring `filter` and edge modes) * to the nearest unvisited edge. Ends when no unvisited edge is reachable. */ declare function genQuickRandomWalk(graph: Graph, options?: WalkOptions): Generator>; /** * Walk a predefined sequence of edge IDs. * Validates each edge exists and connects from the current position. * Edges whose effective mode is not `'directed'` may be traversed * target → source as well. */ declare function genPredefinedWalk(graph: Graph, edgeIds: string[], options?: Pick, 'from'>): Generator>; /** * Yield at most `n` steps from the source generator. */ declare function genWalkSteps(gen: Generator>, n: number): Generator>; /** * @deprecated Use {@link genWalkSteps}. */ declare function takeSteps(gen: Generator>, n: number): Generator>; /** * Yield steps until a specific node is reached. */ declare function genWalkUntilNode(gen: Generator>, nodeId: string): Generator>; /** * @deprecated Use {@link genWalkUntilNode}. */ declare function takeUntilNode(gen: Generator>, nodeId: string): Generator>; /** * Yield steps until a specific edge is traversed. */ declare function genWalkUntilEdge(gen: Generator>, edgeId: string): Generator>; /** * @deprecated Use {@link genWalkUntilEdge}. */ declare function takeUntilEdge(gen: Generator>, edgeId: string): Generator>; /** * Yield steps until node coverage reaches the target (0–1). */ declare function genWalkUntilNodeCoverage(gen: Generator>, graph: Graph, coverage: number, options?: { from?: string; }): Generator>; /** * @deprecated Use {@link genWalkUntilNodeCoverage}. */ declare function takeUntilNodeCoverage(gen: Generator>, graph: Graph, coverage: number, options?: { from?: string; }): Generator>; /** * Yield steps until edge coverage reaches the target (0–1). */ declare function genWalkUntilEdgeCoverage(gen: Generator>, graph: Graph, coverage: number): Generator>; /** * @deprecated Use {@link genWalkUntilEdgeCoverage}. */ declare function takeUntilEdgeCoverage(gen: Generator>, graph: Graph, coverage: number): Generator>; /** * Compute coverage statistics for a completed walk. */ declare function getCoverage(graph: Graph, steps: GraphStep[], options?: { from?: string; }): CoverageStats; //#endregion export { deleteEntities as $, LAYOUT_KEYS as A, getEdgeMode as B, getInvertedDiff as C, toDiff as D, isEmptyDiff as E, createGridGraph as F, addNode as G, GraphInstance as H, createRandomGraph as I, createGraphFromTransition as J, createGraph as K, invalidateIndex as L, isLayoutEqual as M, isNonLayoutEqual as N, toPatches as O, createCompleteGraph as P, deleteEdge as Q, GraphIssue as R, getDiff as S, invertDiff as T, addEdge as U, isEdgeDirected as V, addEntities as W, createGraphPort as X, createGraphNode as Y, createVisualGraph as Z, getFlattenedGraph as _, genWalkUntilEdge as a, updateEdge as at, reverseGraph as b, genWalkUntilNodeCoverage as c, takeSteps as d, deleteNode as et, takeUntilEdge as f, flatten as g, takeUntilNodeCoverage as h, genWalkSteps as i, hasNode as it, areEntitiesEqual as j, updateGraphWithPatches as k, genWeightedRandomWalk as l, takeUntilNode as m, genQuickRandomWalk as n, getNode as nt, genWalkUntilEdgeCoverage as o, updateEntities as ot, takeUntilEdgeCoverage as p, createGraphEdge as q, genRandomWalk as r, hasEdge as rt, genWalkUntilNode as s, updateNode as st, genPredefinedWalk as t, getEdge as tt, getCoverage as u, getReversedGraph as v, getPatches as w, applyPatches as x, getSubgraph as y, getGraphIssues as z };