/// import type { Router } from 'express'; import type { TimeTravelMode as TimeTravelModeType, Test as TestplaneTest, Config } from 'testplane'; import { TestStatus } from './constants'; import type { HtmlReporter } from './plugin-api'; import type { ReporterTestResult } from './adapters/test-result'; import type { TestplaneTestResult, ImageInfoWithState, ReporterConfig, TestSpecByPath } from './types'; interface GetPathOptions { imageDir: string; attempt: number; browserId: string; timestamp: number; } 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, timestamp, browserId, kind, stateName }: CreatePathOptions): string; export declare const getTempPath: (destPath: string) => Promise; 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): Promise; export declare function deleteFile(filePath: string): Promise; export declare function makeDirFor(destPath: string): Promise; 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; export declare function copyPlugins({ plugins, pluginsEnabled }: ReporterConfig, destPath: string): Promise; export declare function copyPlugin(pluginName: string, pluginsPath: string): Promise; export declare function urlPathNameEndsWith(currentUrl: string, searchString: string): boolean; export declare function isJsonUrl(url: string): boolean; export declare function isDbFile(filePath: string): boolean; export declare function writeDatabaseUrlsFile(destPath: string, srcPaths: string[]): Promise; export declare function copyFilesToReportDir(destPath: string, ext: string, sourceDirectory: string): Promise; export type ConfigForStaticFile = Pick; export declare function getConfigForStaticFile(pluginConfig: ReporterConfig): ConfigForStaticFile; export interface DataForStaticFile { skips: object[]; config: ConfigForStaticFile; apiValues: HtmlReporter['values']; timestamp: number; date: string; } export declare function getDataForStaticFile(htmlReporter: HtmlReporter, pluginConfig: ReporterConfig): DataForStaticFile; 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(plugins: ReporterConfig['plugins'], callback: (name: string) => T): T[]; export declare const formatTestResult: (rawResult: TestplaneTest | TestplaneTestResult, status: TestStatus, attempt: number | undefined, saveHistoryMode: Config['saveHistoryMode']) => ReporterTestResult; export declare const saveErrorDetails: (testResult: ReporterTestResult, reportPath: string) => Promise; export declare const getExpectedCacheKey: ([testResult, stateName]: [TestSpecByPath, string | undefined]) => string; export declare const getImagesInfoByStateName: (imagesInfo: ReporterTestResult['imagesInfo'], stateName: string) => ImageInfoWithState | undefined; export declare const getTimeTravelModeEnumSafe: () => typeof TimeTravelModeType | null; export {};