import type { Manifest, Page } from './types.js';
export type IssueKind = 'orphan' | 'dead-link' | 'fm-gap' | 'stale';
export type IssueSeverity = 'warn' | 'error';
export interface LintIssue {
    readonly kind: IssueKind;
    readonly severity: IssueSeverity;
    /** Page id where issue was found; null when issue is repo-level (e.g. stale source) */
    readonly pageId: string | null;
    /** One-line message */
    readonly message: string;
    /** Optional context: target page id / source path / field name */
    readonly target?: string;
}
export interface LintReport {
    readonly issues: readonly LintIssue[];
    /** Counts grouped by kind for fast summary */
    readonly counts: Record<IssueKind, number>;
    readonly errorCount: number;
    readonly warnCount: number;
}
export interface LintInput {
    readonly pages: readonly Page[];
    readonly manifest: Manifest;
    readonly repoDir: string;
}
export declare function lintWiki(input: LintInput): LintReport;
/**
 * Orphan = page that nobody links to (via frontmatter related[] OR body wikilink).
 *
 * A solo page can still be valuable (e.g. just-written lesson) — orphan is **warn**,
 * not error.
 */
export declare function checkOrphans(pages: readonly Page[]): LintIssue[];
/**
 * Dead link = wikilink "[[X]]" where X (resolved) is not in the page set.
 *
 * Errors for related[] (frontmatter); warnings for body links (in-flight writing).
 */
export declare function checkDeadLinks(pages: readonly Page[]): LintIssue[];
/**
 * Catches missing soft-required fields the zod schema can't enforce
 * (e.g. empty title, empty TL;DR, all default tags). Schema-level errors
 * are caught at parse time — this is a content sniff.
 */
export declare function checkFrontmatterGaps(pages: readonly Page[]): LintIssue[];
/**
 * Compare manifest's stored sha256 against current file hash on disk.
 * Mismatch = source has drifted since last ingest → its derived pages may be stale.
 *
 * Files that don't exist on disk anymore are flagged as 'stale' too (they should
 * be removed from manifest via finalize).
 */
export declare function checkStaleSources(manifest: Manifest, repoDir: string): LintIssue[];
/**
 * Resolve a "[[X]]" or "[[type/X]]" wikilink against the known pageId set.
 *
 * Strategy:
 *   - "[[type/X]]" → look up exact pageId
 *   - "[[X]]" → look up any pageId ending with "/X" (any type matches)
 *
 * Returns the resolved pageId, or null if unresolvable.
 */
export declare function resolveLinkToId(wikilink: string, ids: ReadonlySet<string>): string | null;
export declare function extractBodyWikilinks(body: string): string[];
/**
 * Compare source mtime vs page mtime. Returns paths whose source is newer.
 *
 * Best-effort — file mtime precision varies (ext4 ns vs HFS+ 1s); we use a
 * 60s threshold to avoid false positives.
 */
export declare function findOutdatedPages(manifest: Manifest, pages: readonly Page[], repoDir: string, thresholdMs?: number): {
    sourcePath: string;
    pageIds: string[];
    sourceMtime: Date;
}[];
//# sourceMappingURL=linter.d.ts.map