import type { Config } from '../config/schema.js';
import { type OpenPR } from '../github/client.js';
import { type PRStatus, type PRStatusLogEvent } from './pr-status.js';
export type BacktraceScope = {
    org: string;
} | {
    owner: string;
    repo: string;
};
export interface BacktracePR extends OpenPR {
    owner: string;
    repo: string;
}
export interface BacktraceResult {
    queued: BacktracePR[];
    alreadyReviewed: number;
    skippedAuthor: number;
}
export interface ScanFailure {
    owner?: string;
    repo?: string;
    pr?: number;
    stage: 'scope' | 'repo' | 'pr';
    message: string;
}
export interface ScanOptions {
    logEvents?: PRStatusLogEvent[];
    staleAfter?: number;
}
export interface ScanResult {
    statuses: PRStatus[];
    failures: ScanFailure[];
    skippedAuthor: number;
    scannedRepos: number;
    scannedPRs: number;
}
export declare function buildScopesFromConfig(config: Config, token: string): Promise<BacktraceScope[]>;
export declare function scanUnreviewedPRs(scopes: BacktraceScope[], config: Config, token: string): Promise<BacktraceResult>;
export declare function scanOpenPRStatuses(scopes: BacktraceScope[], config: Config, token: string, opts?: ScanOptions): Promise<ScanResult>;
//# sourceMappingURL=backtrace.d.ts.map