import { InternalGladiaClientOptions } from "../../internal_types.js"; import { PreRecordedV2AudioUploadResponse, PreRecordedV2InitTranscriptionRequest, PreRecordedV2InitTranscriptionResponse, PreRecordedV2Response } from "./generated-types.js"; //#region src/v2/prerecorded/client.d.ts /** * Client used to interact with Gladia Pre-Recorded Speech-To-Text API. */ declare class PreRecordedV2Client { private httpClient; private readonly prerecordedTimeouts; constructor(options: InternalGladiaClientOptions); /** * Upload a local file and return an audio URL for transcription. * * @param audio_url - A file path (string), `File`, or `Blob`. When a string, it must be a local file path; URLs are not accepted. * @returns The upload response containing `audio_url` and `audio_metadata`. * @throws Error if `audio_url` is a string that is a URL (use a local file path, File, or Blob instead). */ uploadFile(audio_url: string | File | Blob): Promise; /** * Create a new pre-recorded transcription job. * * @see https://docs.gladia.io/api-reference/v2/pre-recorded/init * @param options - The transcription request parameters including `audio_url`. * @returns A response containing the job `id` and `result_url` to poll. */ create(options: PreRecordedV2InitTranscriptionRequest): Promise; /** * Create a new pre-recorded transcription job with an untyped request (e.g. raw JSON). * Prefer {@link create} for type-safe requests. * * @see https://docs.gladia.io/api-reference/v2/pre-recorded/init * @param options - Raw request object (must include `audio_url` at runtime). * @returns A response containing the job `id` and `result_url` to poll. */ createUntyped(options: Record): Promise; /** * Get a pre-recorded transcription job by ID. * * @param jobId - The UUID of the transcription job. * @returns The full job response including status and result if done. */ get(jobId: string): Promise; /** * Delete a pre-recorded transcription job. * * @param jobId - The UUID of the transcription job to delete. * @returns `true` if the job was deleted successfully (HTTP 202), `false` if the server responded with another 2xx status. * @throws When the server responds with an error HTTP status (e.g. 404). */ delete(jobId: string): Promise; /** * Download the audio file for a pre-recorded transcription job. * * @param jobId - The UUID of the transcription job. * @returns The raw audio file as an `ArrayBuffer`. */ getFile(jobId: string): Promise; /** * Poll a pre-recorded transcription job until it completes. * * Repeatedly fetches the job status until it reaches `"done"` or `"error"`. * * @param jobId - The UUID of the transcription job. * @param interval - Milliseconds between polling attempts (default: 3000). * @param timeout - Maximum milliseconds to wait before throwing. Omitted uses * `GladiaClientOptions.prerecordedTimeouts.poll`. `null` means no deadline. * @returns The completed job response. * @throws If the job status is `"error"` or the timeout is exceeded. */ poll(jobId: string, { interval, timeout }?: { interval?: number; timeout?: number | null; }): Promise; /** * Create a pre-recorded transcription job and poll until completion. * * Convenience method that combines `create` and `poll`. * * @see https://docs.gladia.io/api-reference/v2/pre-recorded/init * @see https://docs.gladia.io/api-reference/v2/pre-recorded/get * @param options - The transcription request parameters including `audio_url`. * @param interval - Milliseconds between polling attempts (default: 3000). * @param timeout - Maximum milliseconds to wait before throwing. Omitted uses * `GladiaClientOptions.prerecordedTimeouts.createAndPoll`. `null` means no deadline. * @returns The completed job response. */ createAndPoll(options: PreRecordedV2InitTranscriptionRequest, { interval, timeout }?: { interval?: number; timeout?: number | null; }): Promise; /** * Create a pre-recorded transcription job with an untyped request and poll until completion. * Prefer {@link createAndPoll} for type-safe requests. * * @see https://docs.gladia.io/api-reference/v2/pre-recorded/init * @see https://docs.gladia.io/api-reference/v2/pre-recorded/get * @param options - Raw request object (must include `audio_url` at runtime). * @param interval - Milliseconds between polling attempts (default: 3000). * @param timeout - Maximum milliseconds to wait before throwing. Omitted uses * `GladiaClientOptions.prerecordedTimeouts.createAndPoll`. `null` means no deadline. * @returns The completed job response. */ createAndPollUntyped(options: Record, { interval, timeout }?: { interval?: number; timeout?: number | null; }): Promise; /** * Upload a local file or use a URL (YouTube, S3, etc.) and transcribe it, polling until completion. * * Convenience method that combines `uploadFile` (when `audio_url` is a path or File/Blob), `create`, and `poll`. * When `audio_url` is a string URL, skips upload and calls create with that URL directly. * * @param audio_url - A file path (string), URL (string), `File`, or `Blob`. When a string, can be either a local file path or an http(s) URL. * @param options - Optional transcription options (typed; `audio_url` is set from the uploaded/URL audio). * @param interval - Milliseconds between polling attempts (default: 3000). * @param timeout - Maximum milliseconds for polling after the job is submitted. Omitted uses * `GladiaClientOptions.prerecordedTimeouts.transcribe`. `null` means no deadline. * @returns The completed job response. */ transcribe(audio_url: string | File | Blob, options?: Omit, { interval, timeout }?: { interval?: number; timeout?: number | null; }): Promise; /** * Transcribe audio with untyped options (e.g. raw JSON). Prefer {@link transcribe} for type-safe options. * * @see https://docs.gladia.io/api-reference/v2/upload/audio-file * @see https://docs.gladia.io/api-reference/v2/pre-recorded/init * @see https://docs.gladia.io/api-reference/v2/pre-recorded/get * @param audio_url - A file path (string), URL (string), `File`, or `Blob`. * @param options - Optional raw request options (merged with `audio_url` from upload/URL). * @param interval - Milliseconds between polling attempts (default: 3000). * @param timeout - Maximum milliseconds for polling after the job is submitted. Omitted uses * `GladiaClientOptions.prerecordedTimeouts.transcribe`. `null` means no deadline. * @returns The completed job response. */ transcribeUntyped(audio_url: string | File | Blob, options?: Record, { interval, timeout }?: { interval?: number; timeout?: number | null; }): Promise; } //#endregion export { PreRecordedV2Client }; //# sourceMappingURL=client.d.ts.map