import type { Page, WaitForOptions } from "puppeteer-core"; declare module "puppeteer-core" { interface Frame { /** CDP lifecycle events the frame's current document has reached (`@internal` upstream, stripped from published types). */ readonly _lifecycleEvents: ReadonlySet; } } /** Navigation lifecycle accepted by history traversal and reload helpers. */ export type NavigationWaitUntil = "load" | "domcontentloaded" | "networkidle0" | "networkidle2"; /** Invoke `history.back()` inside a browser page. */ export declare function historyBackInPage(): void; /** Invoke `history.forward()` inside a browser page. */ export declare function historyForwardInPage(): void; /** Invoke `location.reload()` inside a browser page. */ export declare function reloadInPage(): void; /** Read `location.href` inside a browser page. */ export declare function locationHrefInPage(): string; /** Read `document.readyState` inside a browser page. */ export declare function readyStateInPage(): string; /** * Whether one of our own page evaluations failed because a navigation replaced the document whose execution context * it targeted: the context was destroyed, was already gone, or a handle belongs to the replaced document's world. */ export declare function isNavigatedContextError(error: unknown): boolean; /** * Wait, at most `timeoutMs`, for a main-frame navigation in flight to replace the document and for the new document * to finish parsing. Returns at once when `navigating()` is false, unless `contextLost` says a navigation already * took the document an evaluation targeted. Returns false when the wait ran out with `navigating()` still true; a * wait that runs out otherwise, or a page that stops answering (a dialog), leaves the page as it is. */ export declare function waitForMainFrameDocument(page: Page, navigating: () => boolean, timeoutMs: number, signal: AbortSignal, contextLost?: boolean): Promise; /** Perform Next.js or History API navigation inside a browser page. */ export declare function pushStateInPage(destination: string): Promise; /** * Run `navigate` and wait for the main document to reach `waitUntil`. * * Puppeteer's `load` and `domcontentloaded` also wait for that event in every child frame * that started loading, so one iframe that never finishes (ad, chat widget, challenge) times * out a page whose own document is ready. Puppeteer therefore only waits for the commit, and * the main frame's lifecycle events, which Puppeteer's own wait reads too, decide the rest. * Any other `waitUntil` (`networkidle*`, arrays, invalid values) keeps Puppeteer's own wait, * which also validates the value. */ export declare function navigateMainFrame(page: Page, waitUntil: NonNullable, timeout: number, signal: AbortSignal | undefined, navigate: (options: WaitForOptions) => Promise): Promise; /** Navigate through session history and return the resulting page URL. */ export declare function traverseHistory(page: Page, direction: "back" | "forward", waitUntil: NavigationWaitUntil, timeout: number, signal?: AbortSignal): Promise; /** Reload the current document and return the resulting page URL. */ export declare function reloadPage(page: Page, waitUntil: NavigationWaitUntil, timeout: number, signal?: AbortSignal): Promise; /** Perform client-side navigation through Next.js when available, otherwise the History API. */ export declare function pushState(page: Page, url: string, signal?: AbortSignal): Promise;