@uppy/audio
Version:
Uppy plugin that records audio using the device’s microphone.
39 lines • 1.23 kB
TypeScript
import type { Body, Meta, UIPluginOptions, Uppy } from '@uppy/core';
import { UIPlugin } from '@uppy/core';
import type { LocaleStrings } from '@uppy/utils';
import locale from './locale.js';
declare module '@uppy/core' {
interface PluginTypeRegistry<M extends Meta, B extends Body> {
Audio: Audio<M, B>;
}
}
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: string;
private icon;
constructor(uppy: Uppy<M, B>, opts?: AudioOptions);
render(): import("preact").JSX.Element;
install(): void;
uninstall(): void;
}
export {};
//# sourceMappingURL=Audio.d.ts.map