/**
 * SEO audit orchestration: gather content from the DB, run the pure analysis
 * engine, and persist a `SeoAuditRun` snapshot plus the live `SeoIssue` set.
 *
 * Issue lifecycle (carried across runs by `issueKey`):
 *   - newly detected            -> status `open`
 *   - detected + was `ignored`  -> stays `ignored`
 *   - detected + was `resolved` -> `recurring`
 *   - detected + open/recurring -> unchanged (lastDetectedAt bumped)
 *   - NOT detected + open/recurring -> auto `resolved` (resolvedAt set)
 *   - NOT detected + ignored/resolved -> unchanged
 *
 * The run row stores the score + counts snapshot, so audit *history* is the
 * sequence of runs while the issue table reflects current state.
 */
import { type AuditEntityInput, type AuditExtraSignals } from './audit-engine.js';
import type { SiteSEOConfig } from '../config/types.js';
import type { ActuateDB } from '../db/client-types.js';
/**
 * True for internal/system collections that must never be exposed on public
 * surfaces (audit, `/llms.txt`, etc.). Covers the explicit exclude list plus
 * any `__`-prefixed convention collection (e.g. `__seo_config__`, `__seo_perf__`).
 */
export declare function isInternalCollection(collection: string): boolean;
/** Map of front-end content collection slug -> its page/post entity type. */
export type ContentCollectionTypes = Record<string, 'page' | 'post'>;
/**
 * Derive the set of front-end **content** collections (and each one's page/post
 * type) from the resolved CMS config. These are the only collections the SEO
 * tools (Content SEO list, audit, scan, internal-link candidates) operate on.
 *
 * A collection qualifies only when it is:
 *   - explicitly typed `page` or `post` (i.e. a publicly-rendered content type),
 *   - not hidden from the admin (`admin.hidden`),
 *   - not excluded from the sitemap (collection- or site-level).
 *
 * This deliberately excludes structural/utility collections (navigation menus,
 * footers, tags, templates, redirects) — which have no `type` — as well as any
 * document whose collection isn't declared in the config at all (e.g. benchmark
 * or other ad-hoc rows that only exist in the database). The result is that the
 * SEO surfaces show real front-end pages/posts/landing pages and nothing else.
 */
export declare function frontEndContentCollectionTypes(cfg: unknown): ContentCollectionTypes;
/** Map a published document row into the audit engine's entity shape. */
export declare function documentToAuditEntity(doc: any, collectionTypes?: ContentCollectionTypes, siteSeo?: SiteSEOConfig): AuditEntityInput;
export interface GatherAuditOptions {
    /**
     * Restrict the gather to these front-end content collections (slug -> type),
     * as produced by `frontEndContentCollectionTypes(config)`. When supplied, only
     * documents in these collections are loaded and their entity type is taken
     * from the map. When omitted, the legacy `isInternalCollection` filter applies
     * (used by callers without access to the resolved config, e.g. some tests).
     */
    collectionTypes?: ContentCollectionTypes;
}
export declare function gatherAuditEntities(db: ActuateDB, options?: GatherAuditOptions): Promise<AuditEntityInput[]>;
export interface RunAuditOptions {
    scope?: string;
    startedById?: string | null;
    /** Cross-cutting signals (broken links, redirect chains/loops) from callers. */
    signals?: AuditExtraSignals;
    /**
     * Front-end content collections to audit (slug -> type). Forwarded to
     * `gatherAuditEntities` so the audit only covers real pages/posts and never
     * structural or benchmark documents. See `frontEndContentCollectionTypes`.
     */
    collectionTypes?: ContentCollectionTypes;
}
export interface PersistedAuditRun {
    id: string;
    status: string;
    siteScoreAfter: number;
    issuesFound: number;
    criticalCount: number;
    warningCount: number;
    infoCount: number;
    pagesScanned: number;
}
/**
 * Run an audit and persist the run + issue snapshot. Returns the run summary.
 * Throws if the SEO models aren't available (caller maps to 501).
 */
export declare function runAndPersistAudit(db: ActuateDB, options?: RunAuditOptions): Promise<PersistedAuditRun>;
//# sourceMappingURL=audit-runner.d.ts.map