UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

52 lines (51 loc) 1.35 kB
/// <reference types="react" /> import { ClientOptions } from 'openai'; interface TextToVoiceStylesType { container?: React.CSSProperties; button?: React.CSSProperties; audio?: React.CSSProperties; } /** * The props for the TextToVoice component */ interface TextToVoiceProps { /** * The id for the button of the component */ id?: string; /** * The text to be converted to voice */ text: string; /** * The voice to use for the conversion * @default 'alloy' */ voice?: string; /** * The configuration for the openai client * @example { apiKey: 'my-api-key', organization: 'my-organization', dangerouslyAllowBrowser: true } */ config: ClientOptions; /** * The style overwrites for the component */ styleOverwrites?: TextToVoiceStylesType; /** * Whether to show the player or not * @default true */ showPlayer?: boolean; /** * The children of the button component * @default 'generate audio' */ children?: React.ReactNode; } /** * A component that converts text to voice. * This component uses the OpenAi library to convert text to voice. * @returns A react component */ export declare const TextToVoice: (props: TextToVoiceProps) => import("react/jsx-runtime").JSX.Element; export {};