import { AbstractTTSClient } from "../core/abstract-tts";
import type { SpeakOptions, TTSCredentials, UnifiedVoice, WordBoundaryCallback } from "../types";
/**
 * Google TTS credentials
 */
export interface GoogleTTSCredentials extends TTSCredentials {
    /**
     * Google Cloud project ID (Node/service-account usage)
     */
    projectId?: string;
    /**
     * Google Cloud credentials JSON (Node/service-account usage)
     */
    credentials?: any;
    /**
     * Google Cloud credentials file path (Node/service-account usage)
     */
    keyFilename?: string;
    /**
     * API key for REST usage (browser-safe). If provided, we will use the REST API via fetch
     * instead of the @google-cloud/text-to-speech client.
     */
    apiKey?: string;
}
/**
 * Extended options for Google TTS
 */
export interface GoogleTTSOptions extends SpeakOptions {
    format?: "mp3" | "wav";
}
/**
 * Google TTS client
 */
export declare class GoogleTTSClient extends AbstractTTSClient {
    /**
     * Google Cloud Text-to-Speech client
     */
    private client;
    /**
     * Whether to use the beta API for word timings
     */
    private useBetaApi;
    /**
     * Google Cloud credentials
     */
    private googleCredentials;
    /**
     * Create a new Google TTS client
     * @param credentials Google Cloud credentials
     */
    constructor(credentials: GoogleTTSCredentials);
    /**
     * Initialize the Google TTS client
     * @param credentials Google TTS credentials
     */
    private initializeClient;
    /**
     * Get available voices from the provider
     * @returns Promise resolving to an array of voice objects
     */
    protected _getVoices(): Promise<any[]>;
    /**
     * Convert text to audio bytes
     * @param text Text or SSML to synthesize
     * @param options Synthesis options
     * @returns Promise resolving to audio bytes
     */
    synthToBytes(text: string, options?: GoogleTTSOptions): Promise<Uint8Array>;
    /**
     * Synthesize text to a byte stream
     * @param text Text to synthesize
     * @param options Synthesis options
     * @returns Promise resolving to an object containing the audio stream and word boundaries
     */
    synthToBytestream(text: string, options?: GoogleTTSOptions): Promise<{
        audioStream: ReadableStream<Uint8Array>;
        wordBoundaries: Array<{
            text: string;
            offset: number;
            duration: number;
        }>;
    }>;
    /**
     * Start playback with word boundary callbacks
     * @param text Text to speak
     * @param callback Callback function for word boundaries
     * @param options Synthesis options
     */
    startPlaybackWithCallbacks(text: string, callback: WordBoundaryCallback, options?: GoogleTTSOptions): Promise<void>;
    /**
     * Get available voices
     * @returns Promise resolving to an array of available voices
     */
    /**
     * Map Google voice objects to unified format
     * @param rawVoices Array of Google voice objects
     * @returns Promise resolving to an array of unified voice objects
     */
    protected _mapVoicesToUnified(rawVoices: any[]): Promise<UnifiedVoice[]>;
    /**
     * Prepare SSML for synthesis
     * @param text Text or SSML to prepare
     * @param options Synthesis options
     * @returns SSML ready for synthesis
     */
    private prepareSSML;
    /**
     * Add SSML mark tags for word timing
     * @param ssml SSML to add mark tags to
     * @returns SSML with mark tags
     */
    private addWordTimingMarks;
    /**
     * Process timepoints from Google TTS response
     * @param timepoints Timepoints from Google TTS response
     * @param text Original text
     */
    private processTimepoints;
    /**
     * Get the list of required credential types for this engine
     * @returns Array of required credential field names
     */
    protected getRequiredCredentials(): string[];
    /**
     * Check if credentials are valid
     * @returns Promise resolving to true if credentials are valid
     */
    checkCredentials(): Promise<boolean>;
    /**
     * Check if credentials are valid with detailed response
     * @returns Promise resolving to an object with success flag and optional error message
     */
    checkCredentialsDetailed(): Promise<{
        success: boolean;
        error?: string;
        voiceCount?: number;
    }>;
    private restListVoices;
    private restSynthesize;
    private base64ToBytes;
}
