import type Database from 'better-sqlite3';
import type { SectionIndexEntry } from '../../shared/entities.js';
import type { PagesService } from './pages.js';
import type { PagesWatcher } from '../fs/watcher.js';
export interface SectionsListQuery {
    pagePath?: string;
    search?: string;
    limit?: number;
}
export interface SectionsServiceWriteDeps {
    pages: PagesService;
    watcher: PagesWatcher;
}
export declare class SectionsService {
    private db;
    private writeDeps;
    constructor(db: Database.Database);
    /** Wire write-side dependencies after construction (avoids circular deps with PagesService bootstrap). */
    setWriteDeps(deps: SectionsServiceWriteDeps): void;
    getByAnchor(anchor: string): SectionIndexEntry | null;
    has(anchor: string): boolean;
    listByPage(pagePath: string): SectionIndexEntry[];
    list(query?: SectionsListQuery): SectionIndexEntry[];
    count(): number;
    /**
     * Rewrite all `<section_ref anchor="oldAnchor"/>` occurrences across pagesDir to newAnchor.
     * Atomic per-file with rollback on error. Emits page:changed via watcher suppress on each write.
     * Page links `@path.md#anchor` (M14) live elsewhere — handled by M14's link rewriter.
     */
    propagateAnchorChange(oldAnchor: string, newAnchor: string): Promise<{
        changed: string[];
    }>;
    private hydrate;
}
