/**
 * M21 / M02 (m02fmidx): in-memory index of YAML frontmatter for every markdown
 * file under both `pagesDir` and `briefsDir`. Fed by both `PagesWatcher`
 * instances. Provides synchronous lookups for:
 *   - hidden-tree filter (`pagesRouter` excludes pages with `frontmatter.type === 'brief'`)
 *   - `briefService.listBriefs()` (find by `frontmatter.type === 'brief'`)
 *   - any future module that wants to discover pages by frontmatter type
 *
 * Pattern derived from `TodosIndexerService` / `PagesLinkIndexerService`:
 * debounced reindex per file, in-memory `Map<path, Record>`, WS broadcast.
 */
import type { PagesService } from './pages.js';
import type { WsGateway } from '../ws/gateway.js';
import type { PagesRootDir } from '../../shared/types.js';
export interface FrontmatterRecord {
    rootDir: PagesRootDir;
    frontmatter: Record<string, unknown>;
}
export interface FrontmatterFindOptions {
    rootDir?: PagesRootDir;
}
export declare class PagesFrontmatterIndexer {
    private pages;
    private briefs;
    private patches;
    private ws;
    private debounceMs;
    private pending;
    /** Composite key `${rootDir}:${path}` so the same path could theoretically
     * exist in both roots without collision (defensive — collision would be a
     * config-misconfiguration, but indexer must remain correct). */
    private byKey;
    constructor(pages: PagesService, briefs: PagesService, patches: PagesService, ws: WsGateway);
    private rootFor;
    /** Broadcast the rootDir-specific change event (briefs:changed / patches:changed). */
    private broadcastRootChange;
    private key;
    schedulePage(rootDir: PagesRootDir, relPath: string): void;
    handleUnlink(rootDir: PagesRootDir, relPath: string): void;
    indexAll(): Promise<void>;
    indexPage(rootDir: PagesRootDir, relPath: string, opts?: {
        silent?: boolean;
    }): Promise<void>;
    getFrontmatter(rootDir: PagesRootDir, relPath: string): Record<string, unknown> | null;
    /**
     * Find paths whose frontmatter has `type === <type>`. Optionally restrict
     * to a single rootDir (defaults to all). Returns sorted by path.
     */
    findByFrontmatterType(type: string, opts?: FrontmatterFindOptions): Array<{
        rootDir: PagesRootDir;
        path: string;
        frontmatter: Record<string, unknown>;
    }>;
}
