import type { ChromeWithPipeConnection, ProtocolConnection, SessionConnection } from 'chrome-debugging-client'; import type { Protocol } from 'devtools-protocol'; import { IConditions } from './conditions'; import { Marker } from '../create-trace-navigation-benchmark'; export declare function getBrowserArgs(explictArgs?: string[]): string[]; export declare function wait(dur: number): Promise; export declare function filterObjectByKeys(obj: { [key: string]: any; }, keyArray: string[]): { [key: string]: any; }; export declare function createBrowser(browserArgs?: string[], headless?: boolean): Promise; export declare function getNewTab(browser: ProtocolConnection, url?: string): Promise; export declare function getTab(browser: ProtocolConnection): Promise; export declare function emulate(client: ProtocolConnection, conditions: IConditions): Promise; export declare function setCookies(page: ProtocolConnection, cookies: Protocol.Network.CookieParam[]): Promise; export declare const enforcePaintEventFn = "\nfunction enforcePaintEvent() {\n\n const docElem = document.documentElement;\n const refNode = docElem.firstElementChild;\n const fakeBody = document.createElement('body');\n const div = document.createElement('div');\n\n div.id = 'mq-test-1';\n div.style.cssText = 'position:absolute;top:-100em';\n fakeBody.style.background = 'none';\n fakeBody.appendChild(div);\n div.innerHTML = '­';\n docElem.insertBefore(fakeBody, refNode);\n\n try {\n return div.offsetWidth === 42;\n } finally {\n fakeBody.removeChild(div);\n docElem.removeChild(fakeBody);\n }\n\n}\n"; export declare const LCP_EVENT_NAME = "largestContentfulPaint::Candidate"; export declare const LCP_EVENT_NAME_ALIAS = "largestContentfulPaint"; /** * check if the last marker.start is largestContentfulPaint:Candidate * That means user want trace to end at LCP * @param markers - markers array * @returns true if markers end at LCP event */ export declare function isTraceEndAtLCP(markers: Marker[]): boolean; /** * if the config or commandline has marker name as largestContentfulPaint * convert it to the actual event name largestContentfulPaint:Candidate * return a new marker list, Keep input markers immutable. * @param markers - marker array * @returns renamed marker array */ export declare function uniformLCPEventName(markers: Marker[]): Marker[]; /** * check if an event name is largestContentfulPaint:Candidate * @param marker - event name * @returns - true or false */ export declare function isLCPEvent(marker: string): boolean; //# sourceMappingURL=utils.d.ts.map