import { type WhisperModelId } from '../config.js'; import { type EarsErrorCode, type EarsErrorParams } from '../errors.js'; export interface WhisperModelDefinition { readonly fileName: string; readonly url: string; readonly sha256: string; readonly bytes: number; } /** whisper.cpp GGML model manifest. */ export declare const WHISPER_MODEL_MANIFEST: Readonly>; export interface WhisperModelState { /** Whether the native whisper.node runtime is available. */ runtimeAvailable: boolean; downloaded: boolean; downloading: boolean; progress: number | null; bytes: number | null; totalBytes: number | null; error: string | null; errorCode?: EarsErrorCode; errorParams?: EarsErrorParams; } export interface WhisperModelsOptions { readonly platform?: NodeJS.Platform; readonly env?: NodeJS.ProcessEnv; readonly fetch?: typeof fetch; readonly manifest?: Partial>; } export declare function whisperCacheDirectory(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string; export declare function whisperModelPath(model: WhisperModelId, platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string; export declare function whisperModelMarkerPath(model: WhisperModelId, platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string; /** Owns the whisper.cpp model files. Native runtime probing and inference belong to local-whisper.ts. */ export declare class WhisperModels { private readonly platform; private readonly env; private readonly fetchImpl; private readonly manifest; private disposed; private activeDownload; private downloadSetup; private readonly verifiedFiles; constructor(options?: WhisperModelsOptions); dispose(): void; getWhisperModelState(model: WhisperModelId, runtimeAvailable: boolean): Promise; downloadWhisperModel(model: WhisperModelId, runtimeAvailable: boolean): Promise; cancelWhisperModelDownload(model: WhisperModelId, runtimeAvailable: boolean): Promise; deleteWhisperModel(model: WhisperModelId, runtimeAvailable: boolean): Promise; private acquireDownloadSetup; /** Clear leftover marker and partial files when the model file is missing. */ private sweepMissingModelArtifacts; private modelPath; private runDownload; private removeArtifacts; private readCompletionMarker; }