/** * @license * Copyright 2017 Google Inc. * SPDX-License-Identifier: Apache-2.0 */ import type { Protocol } from 'devtools-protocol'; import type { Browser } from '../api/Browser.js'; import type { BrowserContext } from '../api/BrowserContext.js'; import { type CDPSession } from '../api/CDPSession.js'; import type { Frame, WaitForOptions } from '../api/Frame.js'; import type { HTTPResponse } from '../api/HTTPResponse.js'; import type { JSHandle } from '../api/JSHandle.js'; import type { Credentials, ReloadOptions } from '../api/Page.js'; import { Page, type GeolocationOptions, type MediaFeature, type Metrics, type NewDocumentScriptEvaluation, type ScreenshotOptions, type WaitTimeoutOptions } from '../api/Page.js'; import type { Cookie, DeleteCookiesRequest, CookieParam, CookiePartitionKey } from '../common/Cookie.js'; import { FileChooser } from '../common/FileChooser.js'; import type { PDFOptions } from '../common/PDFOptions.js'; import type { Viewport } from '../common/Viewport.js'; import { CdpCDPSession } from './CdpSession.js'; import { Coverage } from './Coverage.js'; import type { DeviceRequestPrompt } from './DeviceRequestPrompt.js'; import type { CdpFrame } from './Frame.js'; import { CdpKeyboard, CdpMouse, CdpTouchscreen } from './Input.js'; import type { NetworkConditions } from './NetworkManager.js'; import type { CdpTarget } from './Target.js'; import { Tracing } from './Tracing.js'; import { CdpWebWorker } from './WebWorker.js'; /** * @internal */ export declare class CdpPage extends Page { #private; static _create(client: CdpCDPSession, target: CdpTarget, defaultViewport: Viewport | null): Promise; constructor(client: CdpCDPSession, target: CdpTarget); resize(params: { contentWidth: number; contentHeight: number; }): Promise; _client(): CDPSession; isServiceWorkerBypassed(): boolean; isDragInterceptionEnabled(): boolean; isJavaScriptEnabled(): boolean; openDevTools(): Promise; waitForFileChooser(options?: WaitTimeoutOptions): Promise; setGeolocation(options: GeolocationOptions): Promise; target(): CdpTarget; browser(): Browser; browserContext(): BrowserContext; mainFrame(): CdpFrame; get keyboard(): CdpKeyboard; get touchscreen(): CdpTouchscreen; get coverage(): Coverage; get tracing(): Tracing; frames(): Frame[]; workers(): CdpWebWorker[]; setRequestInterception(value: boolean): Promise; setBypassServiceWorker(bypass: boolean): Promise; setDragInterception(enabled: boolean): Promise; setOfflineMode(enabled: boolean): Promise; emulateNetworkConditions(networkConditions: NetworkConditions | null): Promise; setDefaultNavigationTimeout(timeout: number): void; setDefaultTimeout(timeout: number): void; getDefaultTimeout(): number; getDefaultNavigationTimeout(): number; queryObjects(prototypeHandle: JSHandle): Promise>; cookies(...urls: string[]): Promise; deleteCookie(...cookies: DeleteCookiesRequest[]): Promise; setCookie(...cookies: CookieParam[]): Promise; exposeFunction(name: string, pptrFunction: Function | { default: Function; }): Promise; removeExposedFunction(name: string): Promise; authenticate(credentials: Credentials | null): Promise; setExtraHTTPHeaders(headers: Record): Promise; setUserAgent(userAgentOrOptions: string | { userAgent?: string; userAgentMetadata?: Protocol.Emulation.UserAgentMetadata; platform?: string; }, userAgentMetadata?: Protocol.Emulation.UserAgentMetadata): Promise; metrics(): Promise; reload(options?: ReloadOptions): Promise; createCDPSession(): Promise; goBack(options?: WaitForOptions): Promise; goForward(options?: WaitForOptions): Promise; bringToFront(): Promise; setJavaScriptEnabled(enabled: boolean): Promise; setBypassCSP(enabled: boolean): Promise; emulateMediaType(type?: string): Promise; emulateCPUThrottling(factor: number | null): Promise; emulateMediaFeatures(features?: MediaFeature[]): Promise; emulateTimezone(timezoneId?: string): Promise; emulateIdleState(overrides?: { isUserActive: boolean; isScreenUnlocked: boolean; }): Promise; emulateVisionDeficiency(type?: Protocol.Emulation.SetEmulatedVisionDeficiencyRequest['type']): Promise; setViewport(viewport: Viewport | null): Promise; viewport(): Viewport | null; evaluateOnNewDocument unknown = (...args: Params) => unknown>(pageFunction: Func | string, ...args: Params): Promise; removeScriptToEvaluateOnNewDocument(identifier: string): Promise; setCacheEnabled(enabled?: boolean): Promise; _screenshot(options: Readonly): Promise; createPDFStream(options?: PDFOptions): Promise>; pdf(options?: PDFOptions): Promise; close(options?: { runBeforeUnload?: boolean; }): Promise; isClosed(): boolean; get mouse(): CdpMouse; /** * This method is typically coupled with an action that triggers a device * request from an api such as WebBluetooth. * * :::caution * * This must be called before the device request is made. It will not return a * currently active device prompt. * * ::: * * @example * * ```ts * const [devicePrompt] = Promise.all([ * page.waitForDevicePrompt(), * page.click('#connect-bluetooth'), * ]); * await devicePrompt.select( * await devicePrompt.waitForDevice(({name}) => name.includes('My Device')), * ); * ``` */ waitForDevicePrompt(options?: WaitTimeoutOptions): Promise; } /** * @internal */ export declare function convertCookiesPartitionKeyFromPuppeteerToCdp(partitionKey: CookiePartitionKey | string | undefined): Protocol.Network.CookiePartitionKey | undefined; //# sourceMappingURL=Page.d.ts.map