import type { OutputFormat } from "../types/audio.js"; export declare function extensionForFormat(format: OutputFormat): string; /** * What kind of file will be written. `audio` drops any picture track; the other * two copy it through untouched alongside the restored audio. */ export type OutputContainer = "audio" | "mp4" | "mkv"; export declare function extensionForTarget(format: OutputFormat, container: OutputContainer): string; export declare function containerFromExtension(filePath: string): OutputContainer | null; /** True when the source file is in the MP4 family, per ffprobe's format name. */ export declare function isMp4Family(sourceFormatName: string): boolean; export interface ContainerChoice { container: OutputContainer; /** Explanation when the container is not the obvious match for the source. */ note: string | null; } /** * Decide what to write. A picture track is kept whenever the input has one, * because discarding it silently turns a music video into an audio file. * * The container follows from the audio: MP4 keeps MP4 sources together when the * audio is lossy, and anything lossless goes to Matroska rather than quietly * downgrading the audio to fit. */ export declare function chooseOutputContainer(options: { format: OutputFormat; hasVideo: boolean; keepVideo: boolean; sourceFormatName: string; }): ContainerChoice; /** Reject an audio format the chosen container cannot hold. */ export declare function assertContainerSupportsFormat(container: OutputContainer, format: OutputFormat): void; export declare function formatFromExtension(filePath: string): OutputFormat | null; export declare function defaultOutputPath(inputPath: string, format: OutputFormat, options?: { container?: OutputContainer; directory?: string; }): string; export declare function assertInputFile(inputPath: string): Promise; export declare function assertOutputWritable(outputPath: string, overwrite: boolean, options?: { interactive?: boolean; }): Promise; /** next free path: song.restored.flac -> song.restored-2.flac, song.restored-3.flac, … */ export declare function uniqueOutputPath(outputPath: string): Promise; export declare function createStagingPath(finalOutputPath: string): string; export declare function finalizeAtomicOutput(stagingPath: string, finalPath: string): Promise; export declare function removeIfExists(filePath: string): Promise; /** next free directory: song.stems -> song.stems-2, song.stems-3, … */ export declare function uniqueDirectoryPath(dirPath: string): Promise; /** * Resolve a writable directory path with the same overwrite / keep-both / skip * policy as assertOutputWritable. */ export declare function assertDirWritable(dirPath: string, overwrite: boolean, options?: { interactive?: boolean; }): Promise; /** Durable stems folder next to a final audio output: song.flac -> song.stems/ */ export declare function defaultStemsDir(outputPath: string): string; /** Diagnostics folder: song.restored.flac -> song.restored.restoration/ */ export declare function defaultRestorationDir(outputPath: string): string; export declare function createStagingDir(finalDirPath: string): string; export declare function finalizeAtomicDir(stagingDir: string, finalDir: string): Promise; export declare function validateFormatExtension(outputPath: string, format: OutputFormat, container?: OutputContainer): void; export declare function validateStrength(value: number): number; export declare function validateSampleRate(value: number): number; export declare function validateTargetLufs(value: number): number; export declare function validateTruePeak(value: number): number;