/**
 * Text-to-Speech (TTS) Type Definitions for NeuroLink
 *
 * This module defines types for TTS audio generation and output.
 *
 * @module types/ttsTypes
 */
/** Valid audio formats as an array for runtime validation */
export const VALID_AUDIO_FORMATS = [
    "mp3",
    "wav",
    "ogg",
    "opus",
];
/** Valid TTS quality levels as an array for runtime validation */
export const VALID_TTS_QUALITIES = ["standard", "hd"];
/**
 * Type guard to check if an object is a TTSResult
 */
export function isTTSResult(value) {
    if (!value || typeof value !== "object") {
        return false;
    }
    const obj = value;
    return (Buffer.isBuffer(obj.buffer) &&
        typeof obj.format === "string" &&
        VALID_AUDIO_FORMATS.includes(obj.format) &&
        typeof obj.size === "number" &&
        obj.size >= 0);
}
/**
 * Type guard to check if TTSOptions are valid
 */
export function isValidTTSOptions(options) {
    if (!options || typeof options !== "object") {
        return false;
    }
    const opts = options;
    if (opts.speed !== undefined) {
        if (typeof opts.speed !== "number" ||
            opts.speed < 0.25 ||
            opts.speed > 4.0) {
            return false;
        }
    }
    if (opts.format !== undefined) {
        if (!VALID_AUDIO_FORMATS.includes(opts.format)) {
            return false;
        }
    }
    if (opts.quality !== undefined) {
        if (!VALID_TTS_QUALITIES.includes(opts.quality)) {
            return false;
        }
    }
    return true;
}
//# sourceMappingURL=tts.js.map