import { FoamGraph } from '../model/graph'; import { Resource } from '../model/note'; import { FoamWorkspace } from '../model/workspace'; import { URI } from '../model/uri'; export interface LinkEntry { id: string; uri: URI; title: string; label?: string; } export interface LinksResult { id: string; uri: URI; outgoing: LinkEntry[]; incoming: LinkEntry[]; } /** * Returns outgoing and incoming links for a resource. */ export declare function linksData(workspace: FoamWorkspace, graph: FoamGraph, resource: Resource): LinksResult; export type TraversalDirection = 'links' | 'backlinks' | 'both'; export interface TraversalNode { uri: URI; title: string; type: string; /** Distance in hops from the start URI (0 for the start node itself). */ distance: number; } export interface TraversalEdge { source: URI; target: URI; label?: string; } export interface TraversalResult { nodes: TraversalNode[]; edges: TraversalEdge[]; } /** * Performs a breadth-first traversal of the graph starting at `start`, * following links, backlinks, or both up to `depth` hops. * * Each node is visited at most once; the reported `distance` is the * shortest hop count to reach it. Edges are reported once per direction * even if encountered through multiple paths. * * Traversal is at note granularity: fragments (`#section`, `#^block`) are * not part of node identity. Two links to `[[other#a]]` and `[[other#b]]` * visit `other` once, and the URIs in the returned `nodes` / `edges` are * fragment-free so consumers can dedupe / look up by URI consistently. */ export declare function traverseGraph(workspace: FoamWorkspace, graph: FoamGraph, start: URI, depth: number, direction: TraversalDirection): TraversalResult; //# sourceMappingURL=links.d.ts.map