import { type ITerminalChunk, type ITerminal, type ITerminalProvider } from '@rushstack/terminal';
import { OperationStateFile } from './OperationStateFile';
import type { Operation } from './Operation';
import { type IStopwatchResult } from '../../utilities/Stopwatch';
/**
 * @internal
 */
export interface IOperationMetadataManagerOptions {
    operation: Operation;
}
/**
 * @internal
 */
export interface IOperationMetaData {
    durationInSeconds: number;
    logPath: string;
    errorLogPath: string;
    logChunksPath: string;
    cobuildContextId: string | undefined;
    cobuildRunnerId: string | undefined;
}
export interface ILogChunkStorage {
    chunks: ITerminalChunk[];
}
/**
 * A helper class for managing the meta files of a operation.
 *
 * @internal
 */
export declare class OperationMetadataManager {
    readonly stateFile: OperationStateFile;
    readonly logFilenameIdentifier: string;
    private readonly _metadataFolderPath;
    private readonly _logPath;
    private readonly _errorLogPath;
    private readonly _logChunksPath;
    wasCobuilt: boolean;
    constructor(options: IOperationMetadataManagerOptions);
    /**
     * Returns the relative paths of the metadata files to project folder.
     *
     * Example: `.rush/temp/operation/_phase_build/state.json`
     * Example: `.rush/temp/operation/_phase_build/all.log`
     * Example: `.rush/temp/operation/_phase_build/error.log`
     */
    get metadataFolderPath(): string;
    saveAsync({ durationInSeconds, cobuildContextId, cobuildRunnerId, logPath, errorLogPath, logChunksPath }: IOperationMetaData): Promise<void>;
    tryRestoreAsync({ terminal, terminalProvider, errorLogPath, cobuildContextId, cobuildRunnerId }: {
        terminalProvider: ITerminalProvider;
        terminal: ITerminal;
        errorLogPath: string;
        cobuildContextId?: string;
        cobuildRunnerId?: string;
    }): Promise<void>;
    tryRestoreStopwatch(originalStopwatch: IStopwatchResult): IStopwatchResult;
}
//# sourceMappingURL=OperationMetadataManager.d.ts.map