export interface NativeContextOptions { filePath: string modelUrl?: string useFlashAttn?: boolean useGpu?: boolean maxModelBytes?: number cacheModel?: boolean modelCacheName?: string modelCacheKey?: string worker?: boolean } export interface NativeVadContextOptions { filePath: string modelUrl?: string useGpu?: boolean nThreads?: number maxModelBytes?: number cacheModel?: boolean modelCacheName?: string modelCacheKey?: string worker?: boolean } export interface NativeParakeetContextOptions { filePath: string modelUrl?: string useGpu?: boolean maxModelBytes?: number cacheModel?: boolean modelCacheName?: string modelCacheKey?: string worker?: boolean } export interface TranscribeOptions { language?: string translate?: boolean maxThreads?: number maxContext?: number maxLen?: number tokenTimestamps?: boolean tdrzEnable?: boolean wordThold?: number offset?: number duration?: number temperature?: number temperatureInc?: number beamSize?: number bestOf?: number prompt?: string nProcessors?: number onProgress?: (progress: number) => void onNewSegments?: (result: TranscribeNewSegmentsResult) => void } export interface TranscribeNewSegmentsResult { nNew: number totalNNew: number result: string segments: TranscribeResult['segments'] } export interface TranscribeResult { language?: string result: string segments: Array<{ text: string t0: number t1: number }> isAborted: boolean } export interface ParakeetTranscribeOptions { /** Number of threads to use during computation. */ maxThreads?: number /** Override the model audio context size (0 uses the model default). */ audioCtx?: number } export interface VadOptions { threshold?: number minSpeechDurationMs?: number minSilenceDurationMs?: number maxSpeechDurationS?: number speechPadMs?: number samplesOverlap?: number } export interface VadSegment { t0: number t1: number } export interface BenchResult { config: string nThreads: number encodeMs: number decodeMs: number batchdMs: number promptMs: number } export interface WhisperContext { transcribe( filePath: string, options?: TranscribeOptions, ): { stop: () => Promise promise: Promise } transcribeFile( filePath: string, options?: TranscribeOptions, ): { stop: () => Promise promise: Promise } transcribeData( audioData: ArrayBuffer | ArrayBufferView | Float32Array, options?: TranscribeOptions, ): { stop: () => Promise promise: Promise } bench(nThreads: number): Promise release(): Promise getModelInfo(): object } export interface ParakeetContext { transcribe( filePath: string, options?: ParakeetTranscribeOptions, ): { stop: () => Promise promise: Promise } transcribeFile( filePath: string, options?: ParakeetTranscribeOptions, ): { stop: () => Promise promise: Promise } transcribeData( audioData: ArrayBuffer | ArrayBufferView | Float32Array, options?: ParakeetTranscribeOptions, ): { stop: () => Promise promise: Promise } release(): Promise getModelInfo(): object } export interface WhisperVadContext { detectSpeech(filePath: string, options?: VadOptions): Promise detectSpeechFile(filePath: string, options?: VadOptions): Promise detectSpeechData( audioData: ArrayBuffer | ArrayBufferView | Float32Array, options?: VadOptions, ): Promise release(): Promise getModelInfo(): object } export interface Module { WhisperContext: { new (options: NativeContextOptions): Promise toggleNativeLog( enable: boolean, callback?: (level: string, text: string) => void, ): void | Promise } WhisperVadContext: { new (options: NativeVadContextOptions): Promise toggleNativeLog( enable: boolean, callback?: (level: string, text: string) => void, ): void | Promise } ParakeetContext: { new (options: NativeParakeetContextOptions): Promise toggleNativeLog( enable: boolean, callback?: (level: string, text: string) => void, ): void | Promise } } export interface WasmRuntimeOptions { worker?: boolean workerUrl?: string workerPath?: string indexScriptUrl?: string scriptUrl?: string runtimeScriptUrl?: string jsPath?: string wasmPath?: string threads?: boolean locateFileBaseUrl?: string locateFile?: (path: string, prefix: string) => string mainScriptUrlOrBlob?: string | Blob modelCacheName?: string moduleFactory?: (options?: Record) => Promise | unknown moduleOptions?: Record print?: (text: string) => void printErr?: (text: string) => void } export declare const WhisperContext: Module['WhisperContext'] export declare const WhisperVadContext: Module['WhisperVadContext'] export declare const ParakeetContext: Module['ParakeetContext'] export declare const DEFAULT_WASM_MODEL_SIZE_LIMIT_BYTES: number export declare const MAX_WASM_THREADS: number export declare const WASM_CONFIG_PATHS: { index: string js: string wasm: string threadsJs: string threadsWasm: string worker: string } export declare function configureWasm(options: WasmRuntimeOptions): void export declare function isWasmThreadsSupported(): boolean export declare function loadWasmModule(): Promise export declare function loadWhisperModule(): Promise export declare function initWhisper( options: NativeContextOptions, ): Promise export declare function initWhisperVad( options: NativeVadContextOptions, ): Promise export declare function initParakeet( options: NativeParakeetContextOptions, ): Promise export declare function toggleNativeLog( enable: boolean, callback?: (level: string, text: string) => void, ): Promise export declare function addNativeLogListener( listener: (level: string, text: string) => void, ): { remove: () => void } export declare function isNativeLogEnabled(): boolean declare const _default: { WhisperContext: typeof WhisperContext WhisperVadContext: typeof WhisperVadContext ParakeetContext: typeof ParakeetContext configureWasm: typeof configureWasm loadWasmModule: typeof loadWasmModule loadWhisperModule: typeof loadWhisperModule initWhisper: typeof initWhisper initWhisperVad: typeof initWhisperVad initParakeet: typeof initParakeet toggleNativeLog: typeof toggleNativeLog addNativeLogListener: typeof addNativeLogListener isNativeLogEnabled: typeof isNativeLogEnabled isWasmThreadsSupported: typeof isWasmThreadsSupported DEFAULT_WASM_MODEL_SIZE_LIMIT_BYTES: typeof DEFAULT_WASM_MODEL_SIZE_LIMIT_BYTES MAX_WASM_THREADS: typeof MAX_WASM_THREADS WASM_CONFIG_PATHS: typeof WASM_CONFIG_PATHS } export default _default