import type { Page, BrowserContext } from 'playwright-core'; export interface BrowserContextCookie { name: string; value: string; domain: string; path: string; expires?: number; httpOnly?: boolean; secure?: boolean; sameSite?: 'Strict' | 'Lax' | 'None'; } export interface BrowserContextOrigin { origin: string; localStorage: Array<{ name: string; value: string; }>; } export interface BrowserContextData { cookies: BrowserContextCookie[]; origins: BrowserContextOrigin[]; } /** * Load and validate a browser context JSON file (Playwright storageState format). */ export declare function loadContextFile(filePath: string): BrowserContextData; /** * Inject cookies into a BrowserContext. Context-level operation — applies to all pages. */ export declare function injectCookies(context: BrowserContext, cookies: BrowserContextCookie[]): Promise; /** * Inject localStorage for each origin using a temporary page. * Context-level operation — localStorage persists for all pages visiting the same origin. */ export declare function injectLocalStorage(context: BrowserContext, origins: BrowserContextOrigin[]): Promise; /** * Inject cookies and localStorage into a BrowserContext. * Both are context-level — only needs to be called once. */ export declare function injectContextToContext(context: BrowserContext, contextData: BrowserContextData): Promise<{ cookieCount: number; originCount: number; }>; /** * Inject cookies and localStorage into a page's context. * Convenience wrapper for the inject_context MCP tool. */ export declare function injectContext(page: Page, contextData: BrowserContextData): Promise<{ cookieCount: number; originCount: number; }>; /** * Load a context file and inject it into a page's context. */ export declare function injectContextFromFile(page: Page, filePath: string): Promise<{ cookieCount: number; originCount: number; filePath: string; }>; /** * Export cookies and localStorage from a BrowserContext to BrowserContextData. * Collects cookies via context.cookies() and localStorage by navigating * a temp page to each cookie origin. */ export declare function saveContext(context: BrowserContext): Promise; /** * Export cookies and localStorage from a BrowserContext and write to a JSON file. */ export declare function saveContextToFile(context: BrowserContext, outputPath: string): Promise<{ cookieCount: number; originCount: number; outputPath: string; }>; /** * Merge multiple context files into a single BrowserContextData. */ export declare function mergeContextFiles(filePaths: string[]): BrowserContextData; //# sourceMappingURL=context.d.ts.map