import { IBehaviour } from "../api"; import { MqttConnection } from "../connection/MqttConnection"; import { AudioRecorder } from "../audio/recorder/AudioRecorder"; /** * IBehaviour implementation that listens for a onmouseup/down on the given recordButton. * * onmouseup starts the recording, onmousedown stops the recording and publishes an audio message * to the outbound audio channel. */ export declare class VoiceBehaviour implements IBehaviour { private readonly recordButton; private readonly recorder; private readonly callback; constructor(recordButton: HTMLButtonElement, recorder?: AudioRecorder, callback?: (eventType: EventType) => void); /** * * @inheritDoc */ bind(gateway: MqttConnection): void; /** * Binds {@link AudioRecorder#startRecording} to {@link this#recordButton} when an "mousedown" event occurs */ private startRecordingOnMouseDown; /** * Binds {@link AudioRecorder#stopRecording} to {@link this#recordButton} when an "mouseup" event occurs */ private stopRecordingOnMouseUp; /** * Subscribes to the audio channel. Callback has no effect since message types are handled by {@link MqttConnection#onMessage} * @param gateway */ private subscribeToAudioChannel; } declare enum EventType { ON_MOUSE_DOWN = "mousedown", ON_MOUSE_UP = "mouseup" } export {};