import type { RefTable } from "./refs.js"; import type { CdpSend } from "./types.js"; export type ExtractFormat = "text" | "markdown" | "links"; export interface ExtractOptions { format?: ExtractFormat; selector?: string; maxChars?: number; } export interface ExtractResult { format: ExtractFormat; text: string; truncated: boolean; } export interface ScreenshotRegion { x: number; y: number; width: number; height: number; } export interface ScreenshotOptions { ref?: string; fullPage?: boolean; quality?: number; skipIfUnchanged?: boolean; /** Default jpeg. */ format?: "jpeg" | "png"; /** Part of the viewport to capture, in CSS pixels relative to the visible area. */ region?: ScreenshotRegion; /** Output pixels per CSS pixel. 0.5 halves the image; 2 doubles a zoomed region. */ scale?: number; } export interface ScreenshotResult { base64?: string; bytes: number; format: "jpeg" | "png"; unchanged: boolean; /** Image size in pixels; known for png. */ width?: number; height?: number; } export interface ViewportMetrics { width: number; height: number; scrollX: number; scrollY: number; devicePixelRatio: number; } /** Visible area size and scroll offset in CSS pixels, plus the device pixel ratio. */ export declare function readViewportMetrics(send: CdpSend, sessionId: string): Promise; /** Width and height from a base64 PNG header, without decoding the image. */ export declare function pngSize(base64: string): { width: number; height: number; } | null; /** Page content as plain text, markdown or a link list. Reading never needs refs. */ export declare function extractContent(send: CdpSend, sessionId: string, opts?: ExtractOptions): Promise; /** JPEG screenshot of the viewport, the full page, or one element. */ export declare function captureScreenshot(send: CdpSend, sessionId: string, refs: RefTable, opts?: ScreenshotOptions, previousHash?: string): Promise<{ result: ScreenshotResult; hash: string; }>; //# sourceMappingURL=read.d.ts.map