chore(frontend): drop the new JSDoc from the TTS playback helpers

The repository keeps code self-documenting, and the helper names and the
voice flow call sites already describe what unlock primes.
This commit is contained in:
Chris Scott committed 2026-10-23 14:59:09 -04:00
1 parent 22ee356c10
commit d089dde466
2 files changed
-20

No files matched your search

-13
View File
@@ -31,24 +31,11 @@ interface SpeechRequest {
onEnd?: (reason: TTSEndReason, error?: string) => void
}
/**
* Returns whether a rejection is the browser refusing playback outside a user gesture.
*
* @param error The rejection value from play().
* @returns True for a NotAllowedError.
*/
function isNotAllowedError(error: unknown): boolean {
if (typeof error !== 'object' || error === null) return false
return (error as { name?: unknown }).name === 'NotAllowedError'
}
/**
* Picks the message shown for a failed playback.
*
* @param error The rejection value from play().
* @param fallback The message to use when the rejection carries none.
* @returns The message to surface to the user.
*/
function playbackErrorMessage(error: unknown, fallback: string): string {
if (isNotAllowedError(error)) return PLAYBACK_BLOCKED_MESSAGE
return error instanceof Error && error.message ? error.message : fallback
-7
View File
@@ -23,13 +23,6 @@ export interface TTSContextValue {
speakWithConfig: (text: string, config: TTSConfig) => Promise<boolean>
speakMessage: (messageId: string, text: string, options?: SpeakMessageOptions) => Promise<boolean>
queueMessage: (messageId: string, text: string) => void
/**
* Primes the shared audio element inside a user gesture so a reply that
* arrives later is allowed to start playing. Must be called synchronously from
* the gesture handler. Does nothing while audio is already in use or once the
* element is primed, and does nothing for the builtin Web Speech provider,
* which keeps its own gesture requirement.
*/
unlock: () => void
stop: () => void
pause: () => void