UNPKG

@kortexa-ai/react-multimodal

Version:

A set of react components and hooks to help with multimodal input

38 lines 1.61 kB
import { EventDispatcher } from '../utils/EventDispatcher'; export type AudioDataHandler = (data?: Float32Array) => void; export type AudioErrorHandler = (error?: string) => void; export type AudioLifeCycleHandler = () => void; export type MicophoneStartHandler = () => void | Promise<void>; export type MicrophoneStopHandler = () => void; export type MicrophoneLifeCycleHandler = AudioLifeCycleHandler; export type MicrophoneDataHandler = AudioDataHandler; export type MicrophoneErrorHandler = AudioErrorHandler; export interface MicrophoneDevice { isRecording: boolean; start: () => Promise<void>; stop: () => void; } export interface MicrophoneEventMap extends Record<string, unknown> { data: Float32Array; start: void; stop: void; error: string; } export declare const microphoneDispatcher: EventDispatcher<MicrophoneEventMap>; export interface MicrophoneControl extends MicrophoneDevice { addDataListener: (listener: MicrophoneDataHandler) => string; removeDataListener: (id: string) => void; addStartListener: (listener: MicophoneStartHandler) => string; removeStartListener: (id: string) => void; addStopListener: (listener: MicrophoneStopHandler) => string; removeStopListener: (id: string) => void; addErrorListener: (listener: MicrophoneErrorHandler) => string; removeErrorListener: (id: string) => void; } export interface MicrophoneDeviceProps { sampleRate?: number; onData?: MicrophoneDataHandler; onError?: MicrophoneErrorHandler; } export type MicrophoneProviderProps = MicrophoneDeviceProps; //# sourceMappingURL=types.d.ts.map