/// <reference types="node" />
import { Router } from 'express';
import type Testplane from 'testplane';
import type { Test as TestplaneTest } from 'testplane';
import { TestStatus } from './constants';
import type { HtmlReporter } from './plugin-api';
import type { ReporterTestResult } from './test-adapter';
import { TestplaneTestResult, ImageInfoWithState, ReporterConfig, TestSpecByPath } from './types';
interface GetPathOptions {
    imageDir: string;
    attempt: number;
    browserId: string;
}
export declare const getReferencePath: (options: GetPathOptions, stateName?: string) => string;
export declare const getCurrentPath: (options: GetPathOptions, stateName?: string) => string;
export declare const getDiffPath: (options: GetPathOptions, stateName?: string) => string;
export declare const getReferenceAbsolutePath: (testResult: ReporterTestResult, reportDir: string, stateName: string) => string;
export declare const getCurrentAbsolutePath: (testResult: ReporterTestResult, reportDir: string, stateName: string) => string;
export declare const getDiffAbsolutePath: (testResult: ReporterTestResult, reportDir: string, stateName: string) => string;
interface CreatePathOptions extends GetPathOptions {
    stateName?: string;
    kind: string;
}
export declare function createPath({ attempt: attemptInput, imageDir: imageDirInput, browserId, kind, stateName }: CreatePathOptions): string;
export declare const getTempPath: (destPath: string) => string;
export declare function createHash(buffer: Buffer): string;
export interface CopyFileAsyncOptions {
    reportDir: string;
    overwrite: boolean;
}
export declare function copyFileAsync(srcPath: string, destPath: string, { reportDir, overwrite }?: Partial<CopyFileAsyncOptions>): Promise<void>;
export declare function deleteFile(filePath: string): Promise<void>;
export declare function makeDirFor(destPath: string): Promise<void>;
export declare function fileExists(path: string): boolean;
export declare function logPathToHtmlReport(pluginConfig: ReporterConfig): void;
export declare function logError(e: Error): void;
export declare function prepareCommonJSData(data: unknown): string;
export declare function shouldUpdateAttempt(status: TestStatus): boolean;
export declare function saveStaticFilesToReportDir(htmlReporter: HtmlReporter, pluginConfig: ReporterConfig, destPath: string): Promise<void>;
export declare function copyPlugins({ plugins, pluginsEnabled }: ReporterConfig, destPath: string): Promise<void>;
export declare function copyPlugin(pluginName: string, pluginsPath: string): Promise<void>;
export declare function urlPathNameEndsWith(currentUrl: string, searchString: string): boolean;
export declare function isJsonUrl(url: string): boolean;
export declare function isDbUrl(url: string): boolean;
export declare function writeDatabaseUrlsFile(destPath: string, srcPaths: string[]): Promise<void>;
export declare function copyToReportDir(destPath: string, files: string[], sourceDirectory: string): Promise<void[]>;
export type ConfigForStaticFile = Pick<ReporterConfig, 'defaultView' | 'diffMode' | 'baseHost' | 'errorPatterns' | 'metaInfoBaseUrls' | 'customScripts' | 'yandexMetrika' | 'pluginsEnabled' | 'plugins'>;
export declare function getConfigForStaticFile(pluginConfig: ReporterConfig): ConfigForStaticFile;
export interface DataForStaticFile {
    skips: object[];
    config: ConfigForStaticFile;
    apiValues: HtmlReporter['values'];
    date: string;
}
export declare function getDataForStaticFile(htmlReporter: HtmlReporter, pluginConfig: ReporterConfig): DataForStaticFile;
export declare function initializeCustomGui(testplane: Testplane, { customGui }: ReporterConfig): Promise<void>;
export interface CustomGuiActionPayload {
    sectionName: string;
    groupIndex: number;
    controlIndex: number;
}
export declare function runCustomGuiAction(testplane: Testplane, { customGui }: ReporterConfig, payload: CustomGuiActionPayload): Promise<void>;
export declare function getPluginClientScriptPath(pluginName: string): string | null;
interface PluginMiddleware {
    (pluginRouter: Router): unknown;
}
export declare function getPluginMiddleware(pluginName: string): PluginMiddleware | null;
export declare function isUnexpectedPlugin(plugins: ReporterConfig['plugins'], pluginName: string): boolean;
export declare function forEachPlugin(plugins: ReporterConfig['plugins'], callback: (name: string) => void): void;
export declare function mapPlugins<T>(plugins: ReporterConfig['plugins'], callback: (name: string) => T): T[];
export declare const formatTestResult: (rawResult: TestplaneTest | TestplaneTestResult, status: TestStatus, attempt?: number) => ReporterTestResult;
export declare const saveErrorDetails: (testResult: ReporterTestResult, reportPath: string) => Promise<void>;
export declare const getExpectedCacheKey: ([testResult, stateName]: [TestSpecByPath, string | undefined]) => string;
export declare const getImagesInfoByStateName: (imagesInfo: ReporterTestResult['imagesInfo'], stateName: string) => ImageInfoWithState | undefined;
export {};
