import type { BrowserContext } from "playwright"; export declare const SNAPSHOT_FORMAT_VERSION = 1; /** Default TTL: 30 minutes. Sessions older than this re-authenticate. */ export declare const DEFAULT_SNAPSHOT_TTL_MS: number; export interface RecipeSnapshot { /** Schema version. Bump on incompatible changes. */ formatVersion: number; /** Recipe name this snapshot was captured from. */ recipeName: string; /** Recipe version at capture time — invalidates on recipe edits. */ recipeVersion: number; /** UTC ms when the snapshot was taken. */ capturedAt: number; /** Browser origin the snapshot was captured against. URLs outside this origin should not consume it. */ origin: string | null; /** Raw Playwright storage state, including cookies + localStorage. */ storageState: Awaited>; } export interface CaptureOptions { /** Recipe name. */ name: string; recipeVersion: number; /** Directory the snapshot is written to. Usually the recipe's local dir. */ dir: string; /** Origin to record on the snapshot (host of the page). */ origin: string | null; } /** Capture a snapshot from the live BrowserContext + write to disk. */ export declare function captureSnapshot(context: BrowserContext, opts: CaptureOptions): Promise; /** * Return the snapshot if present, valid (matching format + recipeVersion), * and within `ttlMs`. Otherwise null — caller falls back to running the * recipe. Stale / mismatched snapshots are deleted opportunistically. */ export declare function loadSnapshot(dir: string, name: string, opts: { recipeVersion: number; ttlMs?: number; }): RecipeSnapshot | null; /** * Inject the snapshot's cookies + localStorage into the given context. * Returns true if applied, false if the snapshot's origin mismatches * the page's current origin (we refuse to cross-contaminate). * * The caller is responsible for navigating to the recipe's start URL * AFTER this returns true so the injected localStorage takes effect. */ export declare function applySnapshot(context: BrowserContext, snapshot: RecipeSnapshot, options?: { currentOrigin?: string | null; }): Promise; export declare function deleteSnapshot(dir: string, name: string): void; export declare function snapshotPath(dir: string, name: string): string; //# sourceMappingURL=snapshot.d.ts.map