@assistant-ui/react
Version:
Typescript/React library for AI Chat
41 lines • 1.24 kB
TypeScript
import { Unsubscribe } from "../../../types";
export declare namespace SpeechSynthesisAdapter {
type Status = {
type: "starting" | "running";
} | {
type: "ended";
reason: "finished" | "cancelled" | "error";
error?: unknown;
};
type Utterance = {
status: Status;
cancel: () => void;
subscribe: (callback: () => void) => Unsubscribe;
};
}
export type SpeechSynthesisAdapter = {
speak: (text: string) => SpeechSynthesisAdapter.Utterance;
};
export declare namespace SpeechRecognitionAdapter {
type Status = {
type: "starting" | "running";
} | {
type: "ended";
reason: "stopped" | "cancelled" | "error";
};
type Result = {
transcript: string;
};
type Session = {
status: Status;
stop: () => Promise<void>;
cancel: () => void;
onSpeechStart: (callback: () => void) => Unsubscribe;
onSpeechEnd: (callback: (result: Result) => void) => Unsubscribe;
onSpeech: (callback: (result: Result) => void) => Unsubscribe;
};
}
export type SpeechRecognitionAdapter = {
listen: () => SpeechRecognitionAdapter.Session;
};
//# sourceMappingURL=SpeechAdapterTypes.d.ts.map