/**
 * TTS Tool Provider
 *
 * Unified provider for all TTS backends:
 * - Browser Web Speech API (no auth)
 * - AWS Polly (requires auth via server proxy)
 * - Google Cloud TTS (requires auth via server proxy)
 *
 * Part of PIE Assessment Toolkit.
 */
import type { ITTSProvider, TTSConfig } from "@pie-players/pie-tts";
import type { ToolProviderApi, ToolProviderCapabilities } from "./ToolProviderApi.js";
/**
 * TTS backend type
 */
export type TTSBackend = "browser" | "polly" | "google" | "server";
/**
 * TTS tool provider configuration
 */
export interface TTSToolProviderConfig extends Partial<TTSConfig> {
    /**
     * TTS backend to use
     */
    backend: TTSBackend;
    /**
     * Server API endpoint (for server backends)
     * @example '/api/tts/synthesize'
     * @example 'https://api.example.com/tts/synthesize'
     */
    apiEndpoint?: string;
    /**
     * Provider to use on server ('polly', 'google')
     * Only used when backend is 'server', 'polly', or 'google'
     */
    serverProvider?: "polly" | "google" | "custom";
    /**
     * Explicit transport mode for server provider payload translation.
     */
    transportMode?: "pie" | "custom";
    /**
     * Endpoint style used by the server-backed provider.
     */
    endpointMode?: "synthesizePath" | "rootPost";
    /**
     * Endpoint validation strategy when validateEndpoint=true.
     */
    endpointValidationMode?: "voices" | "endpoint" | "none";
    /**
     * Include auth header when fetching remote audio/speech-mark assets.
     */
    includeAuthOnAssetFetch?: boolean;
    /**
     * Auth token (if required)
     * Typically fetched via authFetcher in ToolProviderRegistry
     */
    authToken?: string;
    /**
     * Organization ID for multi-tenant applications
     */
    organizationId?: string;
    /**
     * Default voice to use
     */
    voice?: string;
    /**
     * Speech rate (0.25 to 4.0, default 1.0)
     */
    rate?: number;
    /**
     * Speech pitch (0 to 2, default 1.0)
     * Note: Only browser backend supports pitch
     */
    pitch?: number;
    /**
     * Optional telemetry callback for tool/backend instrumentation.
     */
    onTelemetry?: (eventName: string, payload?: Record<string, unknown>) => void | Promise<void>;
}
/**
 * TTS Tool Provider
 *
 * Wraps TTS providers (Browser, Polly, Google) with the ToolProviderApi interface
 * for use in the ToolProviderRegistry.
 *
 * @example Browser TTS (no auth)
 * ```typescript
 * const provider = new TTSToolProvider();
 * await provider.initialize({ backend: 'browser' });
 * const ttsProvider = await provider.createInstance();
 * ```
 *
 * @example Server TTS (with auth)
 * ```typescript
 * const provider = new TTSToolProvider();
 * await provider.initialize({
 *   backend: 'polly',
 *   apiEndpoint: '/api/tts/synthesize',
 *   authToken: 'bearer-token', // Fetched via authFetcher
 * });
 * const ttsProvider = await provider.createInstance();
 * ```
 */
export declare class TTSToolProvider implements ToolProviderApi<TTSToolProviderConfig, ITTSProvider> {
    readonly providerId = "tts-service";
    readonly providerName = "Text-to-Speech";
    readonly category: "tts";
    readonly version = "1.0";
    readonly requiresAuth: boolean;
    private ttsProvider;
    private config;
    private emitTelemetry;
    /**
     * Create TTS tool provider
     *
     * @param backend TTS backend to use (default: 'browser')
     */
    constructor(backend?: TTSBackend);
    /**
     * Initialize TTS provider
     *
     * Sets up the appropriate TTS backend.
     *
     * @param config Configuration with backend type and credentials
     * @throws Error if initialization fails or required config missing
     */
    initialize(config: TTSToolProviderConfig): Promise<void>;
    /**
     * Initialize browser TTS (Web Speech API)
     */
    private _initializeBrowserTTS;
    /**
     * Initialize server-based TTS (Polly, Google)
     */
    private _initializeServerTTS;
    /**
     * Create a TTS provider instance
     *
     * Returns the initialized TTS provider.
     *
     * @param config Optional instance-specific configuration (currently unused)
     * @returns TTS provider
     * @throws Error if provider not initialized
     */
    createInstance(config?: Partial<TTSToolProviderConfig>): Promise<ITTSProvider>;
    /**
     * Get provider capabilities
     *
     * @returns TTS capabilities based on backend
     */
    getCapabilities(): ToolProviderCapabilities;
    /**
     * Check if provider is ready
     *
     * @returns true if provider is initialized
     */
    isReady(): boolean;
    /**
     * Clean up provider resources
     *
     * Destroys the TTS provider and releases resources.
     */
    destroy(): void;
}
