import type { SpecClause } from "../parser/sections.js"; /** Lightweight section row for list / search results. */ export interface SectionSummary { id: string; anchors: string[]; title: string | null; level: number; path: string; url: string; } export declare function toSectionSummary(c: SpecClause): SectionSummary; /** * Fetch one clause by id or by any of its anchors (exact, * case-sensitive — anchors are stable lowercase fragment ids). */ export declare function getClause(clauses: SpecClause[], idOrAnchor: string): SpecClause | null; export interface SectionListFilter { /** Source-path prefix, e.g. `exec`, `binary`, `syntax/types`. */ path?: string; /** Only clauses whose primary anchor / id starts with this prefix. */ anchor_prefix?: string; /** Only clauses with a heading (drop anchor-only content blocks). */ titled_only?: boolean; /** Cap heading depth (1 = page titles only). */ max_level?: number; } /** Enumerate sections, optionally filtered. Preserves source order. */ export declare function listSections(clauses: SpecClause[], filter?: SectionListFilter): SectionSummary[]; export interface SpecSearchHit extends SectionSummary { /** Which field produced the strongest match. */ matched_on: "anchor-exact" | "title" | "anchor" | "prose"; /** Relevance score (0–100). Higher = stronger. */ score: number; /** A short prose snippet around the first match, when matched in prose. */ snippet?: string; } /** * Full-text-ish search over the section index. Ranking (high → low): * exact anchor/id match > title substring > anchor substring > * prose substring. Returns lightweight hits; follow up with * section_get for the full clause. */ export declare function searchSpec(clauses: SpecClause[], query: string, limit?: number): SpecSearchHit[];