wavesurfer-react
Version:
react wrapper for wavesurfer.js
11 lines (10 loc) • 657 B
TypeScript
import { GenericPlugin } from "wavesurfer.js/dist/base-plugin";
import { WaveSurfer as WaveSurferRef } from "../utils/createWavesurfer";
import { PluginType } from "../types";
export type UseWaveSurferParams<GPlug extends GenericPlugin> = {
container?: string | HTMLElement;
plugins: PluginType<GPlug>[];
onMount: (wavesurferRef: null | WaveSurferRef) => any;
};
export type PluginDictionary<GPlug extends GenericPlugin> = Record<string, GPlug>;
export default function useWavesurfer<GPlug extends GenericPlugin>({ container, plugins, onMount, ...props }: UseWaveSurferParams<GPlug>): readonly [WaveSurferRef, PluginDictionary<GPlug>, GPlug[]];