import { CodeLocationDetails, StepError, TestSystemInfo } from '@testim/root-cause-types';
import { AbortSignal } from 'abort-controller';
import ProtocolMapping from 'devtools-protocol/types/protocol-mapping';
import { BrowserContext, ChromiumBrowserContext, Page as PlaywrightPage } from 'playwright';
import { Page as PuppeteerPage, PageEventObj as PuppeteerPageEventObj } from 'puppeteer';
import { CallSite, StackLineData } from 'stack-utils';
import { StartTestParams } from './attachInterfaces';
import { RootCausePage } from './interfaces';
import { 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<any>;
}
export declare function sendCDPMessage<E extends keyof ProtocolMapping.Events>(session: CDPSessionLike, event: E, ...args: EventParams[E]): Promise<void>;
export declare function sendCDPMessage<C extends keyof ProtocolMapping.Commands>(session: CDPSessionLike, command: C, ...params: CommandParams[C]): Promise<CommandReturnType[C]>;
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<TestSystemInfo>;
export declare function getSystemInfoForPlaywrightPage(page: PlaywrightPage): Promise<TestSystemInfo>;
export declare function getSystemInfoForPlaywrightChromiumPage(page: PlaywrightPage, context: ChromiumBrowserContext): Promise<TestSystemInfo>;
export declare function getSystemInfoForPuppeteerPage(page: PuppeteerPage): Promise<TestSystemInfo>;
export declare function isCDPSession(session: unknown): session is CDPSessionLike;
export declare function getChromeCDPSession(page: RootCausePage): Promise<CDPSessionLike | null>;
export declare function guessOperatingSystemUserAgent(): {
    name: string;
    version: string;
};
export declare function assertNotNullOrUndefined<T>(value: T): void;
export declare function nonNullable<T>(value: T): value is NonNullable<T>;
export declare function sleep(time: number, abortSignal?: AbortSignal): Promise<void>;
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<any>;
export declare function removeStringFromStringAndParse(strToRemove: string, strToRemoveFrom: string, reviver?: ((this: any, key: string, value: any) => any) | undefined): any;
export declare function arrayFlat<T>(arr: T[][]): T[];
export declare function extractCodeLocationDetailsSync(userTestFile: string, workingDirectory: string): CodeLocationDetails;
export declare function isPromise(maybePromise: unknown): maybePromise is Promise<unknown>;
export declare function puppeteerAddEventReturnDisposer<TEventName extends keyof PuppeteerPageEventObj>(page: PuppeteerPage, eventName: TEventName, handler: (e: PuppeteerPageEventObj[TEventName], ...args: any[]) => unknown): () => void;
export declare function getSelfCallSiteFromStacktrace(howManyBack?: number): CallSite | null;
export declare function getLast<T>(items: T[]): T;
export declare function setFunctionName<T extends Function>(func: T, newName: string): T;
export declare function appendToFunctionName<T extends Function>(func: T, append: string): T;
export declare function getFilesInDirectoryRecursive(dirToList: string): Promise<string[]>;
