import type { AnalyticsConfig } from "./config.js";
import type { DatabaseAdapter } from "./db.js";
import { type AnalyticsSource } from "./sources.js";
interface WarningEntry {
    code: string;
    message_code: string;
    severity: "info" | "warning" | "error";
    source_file_id?: string;
    source?: AnalyticsSource;
    file_outcome?: "recovered" | "failed";
    details?: Record<string, number | string | boolean>;
}
interface ScanInput {
    sources?: AnalyticsSource[];
    since?: string;
    force: boolean;
    dry_run: boolean;
}
export declare function parseScanInput(args: unknown): ScanInput;
export declare function upsertSourceFilePending(db: DatabaseAdapter, sourceFileId: string, source: AnalyticsSource, pathHash: string, sizeBytes: number, mtimeMs: number, now: string): Promise<void>;
export declare function finalizeSourceFile(db: DatabaseAdapter, source: AnalyticsSource, pathHash: string, status: "imported" | "failed", now: string, fileHash?: string, errorCode?: string, errorSeverity?: WarningEntry["severity"], warnings?: WarningEntry[]): Promise<void>;
export declare function markRunningScansInterrupted(db: DatabaseAdapter): Promise<void>;
export declare function runAnalyticsScan(context: {
    config: AnalyticsConfig;
    db: DatabaseAdapter;
}, args: unknown): Promise<Record<string, unknown>>;
export {};
