import type { CodeLocationDetails, StepError, TestSystemInfo } from '@testim/root-cause-types'; import type { AbortSignal } from 'abort-controller'; import ProtocolMapping from 'devtools-protocol/types/protocol-mapping'; import type { BrowserContext, ChromiumBrowserContext, Page as PlaywrightPage } from 'playwright'; import type { Page as PuppeteerPage, PageEventObj as PuppeteerPageEventObj } from 'puppeteer'; import type { CallSite, StackLineData } from 'stack-utils'; import type { StartTestParams } from './attachInterfaces'; import type { RootCausePage } from './interfaces'; import type { CommandParams, CommandReturnType, EventParams } from './nicerChromeDevToolsTypes'; export declare function captureStacktraceDetails(): { stackLines: StackLineData[]; stacktrace: string; }; export declare function testResultDirFromStartParams(startParams: StartTestParams): string; export declare function constructTestInvocationResultDir(projectRoot: string, runId: string): string; export declare function constructTestResultDir(projectRoot: string, runId: string, testId: string): string; export declare function constructResultDir(projectRoot: string): string; export declare function testUniqueIdentifierFromStartParams(startParams: { projectRoot: string; fullSuitePath: string; fullName: string; }): string; export interface CDPSessionLike { send(method: string, ...args: any[]): Promise; } export declare function sendCDPMessage(session: CDPSessionLike, event: E, ...args: EventParams[E]): Promise; export declare function sendCDPMessage(session: CDPSessionLike, command: C, ...params: CommandParams[C]): Promise; export declare function isNotPlaywrightPage(page: RootCausePage): page is PuppeteerPage; export declare function isPlaywrightChromiumBrowserContext(context: BrowserContext): context is ChromiumBrowserContext; export declare function getSystemInfoForPage(page: RootCausePage): Promise; export declare function getSystemInfoForPlaywrightPage(page: PlaywrightPage): Promise; export declare function getSystemInfoForPlaywrightChromiumPage(page: PlaywrightPage, context: ChromiumBrowserContext): Promise; export declare function getSystemInfoForPuppeteerPage(page: PuppeteerPage): Promise; export declare function isCDPSession(session: unknown): session is CDPSessionLike; export declare function getChromeCDPSession(page: RootCausePage): Promise; export declare function guessOperatingSystemUserAgent(): { name: string; version: string; }; export declare function assertNotNullOrUndefined(value: T): asserts value is Exclude; export declare function nonNullable(value: T): value is NonNullable; export declare function sleep(time: number, abortSignal?: AbortSignal): Promise; export declare class AbortError extends Error { name: 'AbortError'; } export declare function isAbortError(maybeAbortError: unknown): maybeAbortError is AbortError; export declare function unknownValueThatIsProbablyErrorToStepError(probablyError: unknown): StepError; export declare function jsonRemoveNoiseReviver(key: string, value: any): any; export declare function jsonReduceNoiseReviver(key: string, value: any): any; export declare function removeStringFromString(strToRemove: string, strToRemoveFrom: string): string; export declare function readJsonTestSnapshotFile(filePath: string): Promise; export declare function removeStringFromStringAndParse(strToRemove: string, strToRemoveFrom: string, reviver?: ((this: any, key: string, value: any) => any) | undefined): any; export declare function arrayFlat(arr: T[][]): T[]; export declare function extractCodeLocationDetailsSync(userTestFile: string, workingDirectory: string): CodeLocationDetails; export declare function isPromise(maybePromise: unknown): maybePromise is Promise; export declare function puppeteerAddEventReturnDisposer(page: PuppeteerPage, eventName: TEventName, handler: (e: PuppeteerPageEventObj[TEventName], ...args: any[]) => unknown): () => void; export declare function getSelfCallSiteFromStacktrace(howManyBack?: number): CallSite | null; export declare function getLast(items: T[]): T; export declare function setFunctionName(func: T, newName: string): T; export declare function appendToFunctionName(func: T, append: string): T; export declare function getFilesInDirectoryRecursive(dirToList: string): Promise; export declare function createDateMocker(): typeof Date; export declare function isRootCausePage(maybeRootCausePage: unknown): maybeRootCausePage is RootCausePage; export declare function getPageFromProxyContext(proxyContext: unknown): Promise;