export interface WikiLink { /** Full slug (filename without .md), e.g. "202502071922-my-note-title" */ slug: string; /** Note ID extracted from slug, e.g. "202502071922" */ id: string; /** Optional heading anchor, e.g. "Sprint 1" */ heading?: string; /** Optional display text */ display?: string; } export interface WikiLinkFormatOptions { /** Note ID (timestamp), e.g. "202502071922" */ id: string; /** Note slug suffix (kebab-case title), e.g. "opencode-tool-development-patterns" */ slugSuffix?: string; /** Optional heading anchor */ heading?: string; /** Display text - strongly recommended */ display?: string; } /** * Build a full slug from id + slugSuffix. * e.g. ("202502071922", "opencode-tool-dev") => "202502071922-opencode-tool-dev" */ export declare function buildSlug(id: string, slugSuffix?: string): string; /** * Format a wiki-link string: [[slug#heading|Display Text]] * * Always uses the pipe-display format when display text is provided. */ export declare function formatWikiLink(opts: WikiLinkFormatOptions): string; /** * Convenience: build a wiki-link from a NoteMetadata-like object. * Extracts slug suffix from the note's path or falls back to slugifying the title. */ export declare function formatNoteLink(note: { id: string; path?: string; title?: string; }, opts?: { heading?: string; display?: string; }): string; /** Regex that matches any [[...]] wiki-link */ export declare const WIKILINK_PATTERN: RegExp; /** * Parse a single wiki-link inner text (without brackets) into components. * * "202502071922-opencode-tool-dev#Heading|Display" * => { slug: "202502071922-opencode-tool-dev", id: "202502071922", heading: "Heading", display: "Display" } */ export declare function parseWikiLink(inner: string): WikiLink; /** * Extract all wiki-links from content, returning parsed components. */ export declare function extractWikiLinks(content: string): WikiLink[]; /** * Extract just the target IDs from wiki-links in content. * This is the most common use case for link resolution. */ export declare function extractWikiLinkIds(content: string): string[]; /** * Extract just the target slugs from wiki-links in content. * Useful for broken-link detection (match against filenames). */ export declare function extractWikiLinkSlugs(content: string): string[]; /** * Strip wiki-link brackets for plain text display. * Uses display text when available, otherwise the slug. * * "some text [[202502071922-foo|Foo Bar]] here" * => "some text Foo Bar here" */ export declare function stripWikiLinks(content: string): string; /** * Extract the slug suffix from a note path. * e.g. "/.kb/202502071922-opencode-tool-development-patterns.md" => "opencode-tool-development-patterns" */ export declare function extractSlugSuffix(noteId: string, notePath?: string): string | undefined; declare const _default: { formatWikiLink: typeof formatWikiLink; formatNoteLink: typeof formatNoteLink; parseWikiLink: typeof parseWikiLink; extractWikiLinks: typeof extractWikiLinks; extractWikiLinkIds: typeof extractWikiLinkIds; extractWikiLinkSlugs: typeof extractWikiLinkSlugs; stripWikiLinks: typeof stripWikiLinks; buildSlug: typeof buildSlug; extractSlugSuffix: typeof extractSlugSuffix; WIKILINK_PATTERN: RegExp; }; export default _default; //# sourceMappingURL=wikilink.d.ts.map