// Ambient module shim for whisper.rn.
//
// Why this exists: whisper.rn@0.6.0 ships an `exports` map containing only a
// `"./*"` subpath pattern and NO `"."` (root) entry. Under this project's
// TypeScript settings (moduleResolution: 'bundler' with the 'react-native'
// custom condition, inherited from expo/tsconfig.base), the bare specifier
// `import ... from 'whisper.rn'` cannot be resolved by tsc:
//   "Export specifier '.' does not exist in package.json scope".
// Metro/Babel resolve it fine at runtime (they honor the package's `main` /
// `react-native` fields), so this is purely a *type*-resolution gap.
//
// This shim declares the `'whisper.rn'` module and aliases the library's real,
// shipped declarations (lib/typescript/index.d.ts) through an inline `import()`
// type that points at a relative path, bypassing the `exports` map.
//
// IMPORTANT: this file must stay a GLOBAL/ambient script (no top-level `import`
// or `export` statements) so that `declare module 'whisper.rn'` *creates* the
// module rather than *augmenting* a non-resolvable one. We therefore reference
// the upstream types via inline `import('...')` type expressions. The relative
// path is from this file (src/lib/transcription) up to the repo root, then into
// node_modules. It changes no runtime behavior and touches no shared files.
// Remove this whole file once whisper.rn publishes a `"."` export entry.

declare module 'whisper.rn' {
  type _Upstream = typeof import('../../../node_modules/whisper.rn/lib/typescript/index');

  export type WhisperContext =
    import('../../../node_modules/whisper.rn/lib/typescript/index').WhisperContext;
  export type ContextOptions =
    import('../../../node_modules/whisper.rn/lib/typescript/index').ContextOptions;
  export type TranscribeOptions =
    import('../../../node_modules/whisper.rn/lib/typescript/index').TranscribeOptions;
  export type TranscribeResult =
    import('../../../node_modules/whisper.rn/lib/typescript/index').TranscribeResult;
  export type TranscribeFileOptions =
    import('../../../node_modules/whisper.rn/lib/typescript/index').TranscribeFileOptions;

  export const initWhisper: _Upstream['initWhisper'];
}
