UNPKG

@uppy/audio

Version:

Uppy plugin that records audio using the device’s microphone.

35 lines 1.13 kB
import { h } from 'preact'; import { UIPlugin } from '@uppy/core'; import type { Uppy, UIPluginOptions, Body, Meta } from '@uppy/core'; import type { LocaleStrings } from '@uppy/utils/lib/Translator'; import locale from './locale.js'; export interface AudioOptions extends UIPluginOptions { showAudioSourceDropdown?: boolean; locale?: LocaleStrings<typeof locale>; } interface AudioState { audioReady: boolean; recordingLengthSeconds: number; recordedAudio: string | null | undefined; hasAudio: boolean; cameraError: null; audioSources: MediaDeviceInfo[]; currentDeviceId: string | MediaStreamTrack | null | undefined; isRecording: boolean; showAudioSourceDropdown: boolean; [id: string]: unknown; } /** * Audio recording plugin */ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<AudioOptions, M, B, AudioState> { #private; static VERSION: any; private icon; constructor(uppy: Uppy<M, B>, opts?: AudioOptions); render(): h.JSX.Element; install(): void; uninstall(): void; } export {}; //# sourceMappingURL=Audio.d.ts.map