/** * Utilities for handling CDP (Chrome DevTools Protocol) responses * * When using playwright-mcp in extension mode with CDP relay, some methods * that normally return primitive types (strings, Buffers, arrays) may instead * return CDP response objects. These utilities handle both cases gracefully. */ /** * Extract HTML content from various response formats including CDP responses * * This function handles the case where page.content() returns a CDP response object * instead of a string when using extension mode with CDP relay. * * @param response - The response which could be a string or CDP response object * @returns The HTML content as a string */ export declare function extractContentFromCDPResponse(response: any): any; /** * Extract string data from CDP responses * * Handles page.content() and similar string-returning methods * * @param response - The response that should contain string data * @returns The extracted string */ export declare function extractStringFromCDPResponse(response: any): string; /** * Extract elements array from CDP responses * * Specifically handles locator.all() responses that may come back as CDP objects * * @param response - The response from locator.all() or similar methods * @returns An array of elements */ export declare function extractElementsFromCDPResponse(response: any): any[]; /** * Extract Buffer data from CDP responses * * Handles screenshot and other binary data that may come back as CDP objects * * @param response - The response from page.screenshot() or similar methods * @returns A Buffer containing the binary data */ export declare function extractBufferFromCDPResponse(response: any): Buffer; /** * Extract boolean data from CDP responses * * @param response - The response that should contain boolean data * @returns The extracted boolean */ export declare function extractBooleanFromCDPResponse(response: any): boolean; /** * Extract number data from CDP responses * * @param response - The response that should contain number data * @returns The extracted number */ export declare function extractNumberFromCDPResponse(response: any): number;