import type { MeticulousClient } from "@alwaysmeticulous/client"; export declare const getOrFetchReplay: (client: MeticulousClient, replayId: string) => Promise<{ fileName: string; }>; /** * The scope of the download. This is used to determine what to download from the replay. * - `everything`: Download everything. * - `screenshots-only`: Download only the screenshots. * - `timeline-only`: Download only the timeline data. * - `post-test-run-processing-files-only`: Download only the files that are needed for post-test-run processing * - `post-process-including-unmapped-ranges`: Download everything needed for post-process including unmapped ranges. * - `post-process-including-css-coverage`: Same as post-process-including-unmapped-ranges, plus * the replay's mapped CSS coverage and — for replays that did not map their own — the raw CSS * coverage, whose baked-in stylesheet text — where the artifact still carries any — is all * post-processing can map from. Deliberately excludes snapshotted assets: a coverage entry * whose text could not be read is dropped before it can carry ranges, so the snapshotted * stylesheet body is never the source; and a replay whose stylesheet source maps were * snapshotted also mapped its own CSS on the pod, which short-circuits the fallback before * it looks for a map. */ declare const DOWNLOAD_SCOPES: readonly ["everything", "screenshots-only", "timeline-only", "post-test-run-processing-files-only", "post-process-including-unmapped-ranges", "post-process-including-css-coverage"]; export type DownloadScope = (typeof DOWNLOAD_SCOPES)[number]; /** * Known file-type keys returned by the v3 download-urls endpoint. The server * is the source of truth and may include additional keys; this union covers * the ones the SDK references explicitly plus the common excludable * artifacts. Used to give callers compile-time safety on `excludeFileTypes` * so a typo (e.g. `playbackdata`) is caught at the type level rather than * silently failing at runtime. */ export type ReplayFileType = "screenshots" | "diffs" | "snapshottedAssets" | "rawCoverage" | "rawPerScreenshotCssCoverage" | "rawPerScreenshotJsCoverage" | "mappedCoverage" | "mappedPerScreenshotJsCoverage" | "cssCoverage" | "mappedCssCoverage" | "playbackData" | "timeline" | "metadata" | "accuracy" | "stackTraces" | "cookies" | "launchBrowserAndReplayParams" | "logs" | "appContainerLogs" | "chromeDiagnostics"; /** * The subset of {@link ReplayFileType}s that are downloaded as unzipped archive * directories and are therefore eligible for best-effort handling (see * {@link ReplayArchiveOptions.bestEffortFileTypes}). Best-effort wrapping is * only applied to these artifacts; the other file types (e.g. `timeline`, * `logs`, `screenshots`, `diffs`) always fail hard, so they're excluded from * this type to make misuse a compile-time error rather than a silent no-op. */ export type BestEffortFileType = "chromeDiagnostics" | "snapshottedAssets" | "rawPerScreenshotCssCoverage" | "rawPerScreenshotJsCoverage" | "mappedPerScreenshotJsCoverage"; export interface ReplayArchiveOptions { /** * File-type keys to skip during download (e.g. `playbackData`, `rawCoverage`, * `diffs`). Useful when the caller knows it will not need certain artifacts * and wants to avoid the bandwidth/time cost of fetching them. * * When set, the cross-tool replay cache is bypassed: the cache short-circuit * is skipped and the `previously-downloaded.txt` marker is not written, so * subsequent unfiltered callers will re-download into the cache. */ excludeFileTypes?: ReadonlySet; /** * File-type keys whose download is attempted but treated as best-effort: a * failure is logged and swallowed instead of failing the whole archive. Use * for artifacts that are merely enriching and may legitimately be absent * (e.g. `snapshottedAssets` for an old replay whose assets were pruned by an * S3 lifecycle policy). Mandatory artifacts must NOT be listed here. * * Best-effort handling is only wired up for the unzipped-archive artifacts * (see {@link BestEffortFileType}); other file types always fail hard, which * is why the key type is restricted to that subset. * * Like `excludeFileTypes`, setting this bypasses the cross-tool cache (the * marker is not written), since a swallowed failure may leave the replay * directory incomplete. */ bestEffortFileTypes?: ReadonlySet; } export declare const getOrFetchReplayArchive: (client: MeticulousClient, replayId: string, downloadScope?: DownloadScope, formatJsonFiles?: boolean, options?: ReplayArchiveOptions) => Promise<{ fileName: string; }>; export declare const getReplayDir: (replayId: string) => string; export {};