/** Prune `pr-/` report folders from the report branch through the GitHub * git-data API. * * Two callers, one mechanism: * - on PR close, delete that PR's folder; * - on a daily schedule, sweep by retention and then by a hard size budget. * * The budget is what actually bounds the branch. Retention alone cannot: a * single PR can publish hundreds of megabytes of crops, so the folders that * blow the budget are routinely younger than any reasonable retention window, * and one missed close event otherwise leaks a folder forever. The sweep * deletes oldest-closed first until the branch fits, and never touches a * folder whose PR is still open — those are the live review links. * * Like publish, this never clones the branch: deleting gigabytes of * screenshots must not require downloading them first, and even a blobless * clone re-fetches the retained blobs at push time. */ export type ReportFolderPruneSelection = { foldersToDelete: string[]; /** Blob bytes that remain on the branch after the selected deletions. */ branchSizeAfterBytes: number; /** True when even deleting every closed folder leaves the branch over * budget — everything left belongs to open PRs. */ openFoldersExceedBudget: boolean; }; /** Pure selection policy: retention first, then oldest-closed-first until the * branch fits the budget. Folders with no closed-at entry belong to open PRs * (or to nothing the API knows about) and are never selected. */ export declare function selectReportFoldersToPrune(options: { folderSizesBytesByPath: Map; closedAtEpochSecondsByPath: Map; retentionCutoffEpochSeconds: number; budgetBytes: number; }): ReportFolderPruneSelection; export type ReportPruneApiOptions = { apiBaseUrl: string; repository: string; token: string; branch: string; maximumAttempts?: number; fetchImplementation?: typeof fetch; sleepImplementation?: (milliseconds: number) => Promise; log?: (line: string) => void; }; /** Delete the given top-level folders in one commit and fast-forward the ref. * Retries the whole read-select-delete cycle when the ref moves under us. */ export declare function deleteReportFolders(options: ReportPruneApiOptions & { selectFolders: (folderSizesBytesByPath: Map) => string[] | Promise; commitMessage: (deletedFolderCount: number) => string; }): Promise<{ deletedFolders: string[]; }>; /** Closed-at timestamps for every closed PR, keyed `pr-`, via the paginated * pulls listing. Open PRs are deliberately absent. */ export declare function readClosedPullRequestTimestamps(options: ReportPruneApiOptions): Promise>;