/** * Wikilink index views shared between api and web (issue #47/#48). The index * (`page_links`) is maintained on every content change; these are the read * shapes for the backlinks panel and the pond's missing-pages view. */ /** A page that links to the page being viewed (its backlink). */ export interface BacklinkView { pageId: string; title: string; slug: string; /** A short plain-text preview of the linking page, for context (#48). */ snippet: string; } /** A referenced-but-missing target and the pages that link to it. */ export interface PhantomLinkView { targetSlug: string; referencedBy: BacklinkView[]; } /** * The pond's readable wikilink graph (issue #111, `GET /ponds/:id/links`): * nodes are the caller-readable pages, edges the resolved wikilinks whose * BOTH endpoints are readable, and phantoms the missing targets with their * readable referrers — an unreadable page's existence never leaks through * any of the three collections. Consumed by the knowledge-graph views * (#112/#113). */ export interface GraphNodeView { id: string; title: string; slug: string; /** For label-based node coloring; resolved via the pond's label tree. */ labelIds: string[]; } /** One resolved wikilink, by page ids (deduplicated per direction). */ export interface GraphEdgeView { from: string; to: string; } /** A phantom target with the node ids that reference it. */ export interface GraphPhantomView { targetSlug: string; referencedBy: string[]; } export interface PondGraphView { nodes: GraphNodeView[]; edges: GraphEdgeView[]; phantoms: GraphPhantomView[]; }