import { Page as PuppeteerPage } from 'puppeteer';
import { Page as PlaywrightPage } from 'playwright';
import { TestContext } from './TestContext';
import { TestEndStatus } from './attachInterfaces';
export declare type ScreenplayPage = PuppeteerPage | PlaywrightPage;
export interface RunHistoryRecord {
    runId: string;
    timestamp: number;
}
export interface RunConclusionFile {
    runId: string;
    timestamp: number;
    tests: Array<{
        id: string;
        name: string;
        fullName: string;
        success: boolean;
    }>;
}
export interface TestSystemInfo {
    automationFramework: 'playwright' | 'puppeteer';
    browser: 'chromium' | 'firefox' | 'webkit';
    pageViewport: PageViewport;
    userAgent: string;
    browserVersion: string;
    modelName: string;
    modelVersion: string;
    browserPlatform: string;
}
export interface PageViewport {
    width: number;
    height: number;
    deviceScaleFactor?: number;
    isMobile?: boolean;
    hasTouch?: boolean;
    isLandscape?: boolean;
}
export interface TestResultFile {
    metadata: TestMetadata;
    steps: StepResult[];
}
export interface AttachOptions {
    noResultsServer?: boolean;
    externalTestName?: string;
    resultsDirectory?: string;
}
export declare type StepError = {
    message: string;
    name: string;
    stack?: string;
};
export declare type StepResult = {
    name?: string;
    screenshot?: string;
    selector?: string;
    fnName?: string;
    text?: string;
    index: number;
    startTimestamp: number;
    endTimestamp?: number;
    consoleEntries?: ConsoleMessage[];
    unhandledExceptions?: ConsoleException[];
    stepError?: StepError;
    codeError?: ICodeErrorDetails;
} & HasRectangle;
export declare type HasRectangle = {
    rect?: DOMRect & {
        screenWidth: number;
        screenHeight: number;
        devicePixelRatio: number;
    };
};
export interface ICodeErrorDetails {
    errorLines: string[];
    fromRowNumber: number;
    toRowNumber: number;
    row: number;
    column: number;
}
export interface TestMetadata {
    testName: string;
    testFullName: string;
    systemInfo?: TestSystemInfo;
    testEndStatus?: TestEndStatus<unknown, unknown>;
}
export declare type BeforeHook = (testContext: TestContext, fnName: string, proxyContext: any, rootPage: ScreenplayPage, args: any[]) => Promise<void>;
export declare type AfterHook = (testContext: TestContext, fnName: string, proxyContext: any, rootPage: ScreenplayPage, args: any[], instrumentedFunctionResult: InstrumentedFunctionResult<any, any>) => Promise<void>;
export declare type BeforeAllHook = (testContext: TestContext, proxyContext: any, rootPage: ScreenplayPage) => Promise<void>;
export declare type AfterAllHook = (testContext: TestContext, endStatus: TestEndStatus<unknown, unknown>) => Promise<void>;
export interface IAutomationFrameworkInstrumentor {
    registerBeforeAllHook(hook: BeforeAllHook): void;
    registerAfterAllHook(hook: AfterAllHook): void;
    registerBeforeHook(hook: BeforeHook): void;
    registerAfterHook(hook: AfterHook): void;
    wrapWithProxy<T extends object>(proxiedObject: T): T;
    end(endStatus: TestEndStatus<unknown, unknown>): Promise<void>;
}
export declare type InstrumentedFunctionResult<T, E> = {
    success: true;
    data?: T;
} | {
    success: false;
    error: E;
};
export interface ConsoleException {
    message: string;
    timestamp: number;
}
export interface ConsoleMessage {
    level: string;
    text: string;
    url?: string;
    line?: number;
    column?: number;
    timestamp: number;
}
export interface JasmineCurrentTestInfo {
    id: string;
    description: string;
    fullName: string;
    failedExpectations: FailedExpectations[];
    passedExpectations: unknown[];
    pendingReason: string;
    testPath: string;
}
export interface FailedExpectations {
    actual: string;
    error: Error;
    expected: string;
    matcherName: string;
    message: string;
    passed: boolean;
    stack: string;
}
