/** * Minimal interfaces for Playwright's Page and BrowserContext. We use * structural types rather than importing from a specific Playwright package * so this works with any version of playwright, playwright-core, or * @playwright/test. */ interface PlaywrightBrowserContext { addCookies(cookies: Array<{ name: string; value: string; url?: string; domain?: string; path?: string; }>): Promise; cookies(): Promise>; clearCookies(options?: { name?: string; domain?: string; path?: string; }): Promise; } interface PlaywrightPage { url(): string; context(): PlaywrightBrowserContext; } /** * Runs a function with instant navigation enabled. Within this scope, * navigations render the prefetched UI immediately and wait for the * callback to complete before streaming in dynamic data. * * Uses the cookie-based protocol: setting the cookie acquires the * navigation lock (via CookieStore change event), and clearing it * releases the lock. * * If the page is already loaded, the URL is inferred * automatically. For a fresh page (before any navigation), pass * `baseURL` so the cookie can be scoped to the correct domain: * * await instant(page, async () => { * await page.goto(url) * // ... * }, { baseURL: 'http://localhost:3000' }) * * When `@playwright/test` is installed, acquire/release actions appear * as labeled steps in the Playwright UI. */ export declare function instant(page: PlaywrightPage, fn: () => Promise, options?: { baseURL?: string; }): Promise; export {};