@mirawision/reactive-hooks
Version:
A comprehensive collection of 50+ React hooks for state management, UI interactions, device APIs, async operations, drag & drop, audio/speech, and more. Full TypeScript support with SSR safety.
25 lines (24 loc) • 780 B
TypeScript
export interface SpeechSynthesisState {
speak: (text: string, opts?: Partial<SpeechSynthesisUtterance>) => void;
cancel: () => void;
pause: () => void;
resume: () => void;
speaking: boolean;
pending: boolean;
paused: boolean;
voice?: SpeechSynthesisVoice;
}
/**
* A hook that provides access to system voices.
* @returns Array of available speech synthesis voices
*/
export declare function useSystemVoices(): SpeechSynthesisVoice[];
/**
* A hook that provides speech synthesis functionality.
* @returns Object containing speech synthesis controls and state
*
* @example
* const { speak, pause, resume } = useSpeechSynthesis();
* speak('Hello world', { rate: 1.5 });
*/
export declare function useSpeechSynthesis(): SpeechSynthesisState;