speech-provider
Version:
A unified interface for browser speech synthesis and Eleven Labs voices
135 lines • 4.71 kB
TypeScript
import { z } from "zod";
/**
* Zod schema for validating ElevenLabs voice data.
* This schema ensures that the API response matches the expected format.
*/
export declare const ElevenLabsVoiceDataSchema: z.ZodObject<{
voice_id: z.ZodString;
name: z.ZodOptional<z.ZodString>;
description: z.ZodNullable<z.ZodString>;
category: z.ZodEnum<["premade", "professional"]>;
labels: z.ZodObject<{
accent: z.ZodString;
age: z.ZodString;
gender: z.ZodString;
language: z.ZodOptional<z.ZodString>;
use_case: z.ZodEnum<["social media"]>;
}, "strip", z.ZodTypeAny, {
accent: string;
age: string;
gender: string;
use_case: "social media";
language?: string | undefined;
}, {
accent: string;
age: string;
gender: string;
use_case: "social media";
language?: string | undefined;
}>;
preview_url: z.ZodString;
samples: z.ZodNull;
settings: z.ZodNull;
sharing: z.ZodNull;
safety_control: z.ZodNull;
fine_tuning: z.ZodRecord<z.ZodString, z.ZodAny>;
is_legacy: z.ZodLiteral<false>;
is_mixed: z.ZodLiteral<false>;
high_quality_base_model_ids: z.ZodArray<z.ZodString, "many">;
available_for_tiers: z.ZodArray<z.ZodEnum<["plus", "pro", "enterprise"]>, "many">;
voice_verification: z.ZodRecord<z.ZodString, z.ZodAny>;
permission_on_resource: z.ZodNull;
}, "strict", z.ZodTypeAny, {
voice_id: string;
description: string | null;
category: "premade" | "professional";
labels: {
accent: string;
age: string;
gender: string;
use_case: "social media";
language?: string | undefined;
};
preview_url: string;
samples: null;
settings: null;
sharing: null;
safety_control: null;
fine_tuning: Record<string, any>;
is_legacy: false;
is_mixed: false;
high_quality_base_model_ids: string[];
available_for_tiers: ("plus" | "pro" | "enterprise")[];
voice_verification: Record<string, any>;
permission_on_resource: null;
name?: string | undefined;
}, {
voice_id: string;
description: string | null;
category: "premade" | "professional";
labels: {
accent: string;
age: string;
gender: string;
use_case: "social media";
language?: string | undefined;
};
preview_url: string;
samples: null;
settings: null;
sharing: null;
safety_control: null;
fine_tuning: Record<string, any>;
is_legacy: false;
is_mixed: false;
high_quality_base_model_ids: string[];
available_for_tiers: ("plus" | "pro" | "enterprise")[];
voice_verification: Record<string, any>;
permission_on_resource: null;
name?: string | undefined;
}>;
/**
* Type definition for ElevenLabs voice data.
* This interface extends Record<string, unknown> to allow for additional properties
* that might be present in the API response but not explicitly typed here.
*
* @see https://github.com/elevenlabs/elevenlabs-js/blob/60f70f0c3d2ed73599c97836f0a46eeb0944e757/src/api/types/Voice.ts#L7
*/
export interface ElevenLabsVoiceData extends Record<string, unknown> {
/** The unique identifier for the voice */
voice_id: string;
/** The display name of the voice */
name?: string;
/** A description of the voice */
description?: string;
/** Whether the voice is premade or professional */
category: "premade" | "professional";
/** Labels describing the voice's characteristics */
labels: {
/** The accent of the voice */
accent: string;
/** A description of the voice */
description: string;
/** The age category of the voice */
age: "young" | "middle aged" | "middle-aged" | "middle_aged" | "old";
/** The gender of the voice */
gender: "male" | "female" | "non-binary";
/** The language code for the voice */
language: string;
/** The intended use case for the voice */
use_case: "social media" | "news" | "conversational" | "narration" | "characters" | "social_media" | "narrative_story";
};
/** URL to preview the voice */
preview_url: string;
/** The permission level for the voice */
permission_on_resource: "admin" | null;
/** The subscription tiers that can access this voice */
available_for_tiers: ("plus" | "pro" | "enterprise")[];
/** IDs of the base models used for this voice */
high_quality_base_model_ids: string[];
/** Whether this is a legacy voice */
is_legacy: false;
/** Whether this is a mixed voice */
is_mixed: false;
}
//# sourceMappingURL=ElevenLabsTypes.d.ts.map