/** * hmem v2 — links table (typed cross-references by ULID). * * Replaces both v1's JSON `links` column and in-prose ID references. Edges are * stored by `uid`, so renaming a label never touches a link row (master-plan * Goal #1: retire the deep-rename subsystem). * * `resolveRefs` is the write-time complement to `entries.renderRefs`: it scans * free text for label-shaped tokens that resolve to a *live* entry and rewrites * them to `{{u:}}` so the stored form is rename-stable. Unknown labels are * left verbatim. Node-path refs (`P0048.2.1`) are out of scope for Phase 1 — * only root-entry labels are encoded. */ import type Database from 'better-sqlite3'; import type { EntriesApi } from './entries.js'; import type { LinkRow } from './types.js'; export interface LinksApi { addLink(src_uid: string, dst_uid: string, kind?: string): void; getLinks(src_uid: string): LinkRow[]; getBacklinks(dst_uid: string): LinkRow[]; removeLink(src_uid: string, dst_uid: string): boolean; resolveRefs(text: string): string; } export declare function createLinksApi(db: Database.Database, entries: EntriesApi): LinksApi;