UNPKG

material-ui-audio-player

Version:
84 lines (83 loc) 2.51 kB
import SvgIcon from '@material-ui/core/SvgIcon'; import { GridSpacing } from '@material-ui/core/Grid'; import * as React from 'react'; export interface IAudioPlayerClassNameProps { root: string; playIcon: any; volumeIcon: string; muteIcon: string; mainSlider: string; volumeSliderContainer: string; volumeSlider: string; downloadsIcon: string; pauseIcon: string; loopIcon: string; progressTime: string; downloadsContainer: string; downloadsItemLink: string; downloadsItemText: string; closeIcon: string; } export declare const useComponentStyles: (props: any) => Record<"icon" | "root" | "rounded" | "commonContainer" | "sliderContainer" | "slider" | "sliderContainerWrapper" | "iconSelected", string>; export declare enum AudioPlayerComponentsOrder { standart = "standart", reverse = "reverse" } export interface IAudioPlayerColors { active: string; selected: string; disabled: string; hover: string; } export declare const getColors: (theme: any, variation: keyof typeof AudioPlayerVariation) => IAudioPlayerColors; export declare enum AudioPlayerVariation { primary = "primary", secondary = "secondary", default = "default" } declare enum AudioPlayerPreload { auto = "auto", metadata = "metadata", none = "none" } export declare enum TimeOption { single = "single", double = "double" } export declare enum TimePosition { start = "start", end = "end" } export interface Icons { [key: string]: typeof SvgIcon; } interface IAudioPlayerProps { src: string | string[]; rounded?: boolean; elevation?: number; useStyles?: any; width?: string; height?: string; download?: boolean; volume?: boolean; muted?: boolean | null; variation?: keyof typeof AudioPlayerVariation; preload?: AudioPlayerPreload; loop?: boolean; order?: keyof typeof AudioPlayerComponentsOrder; displaySlider?: boolean; displayCloseButton?: boolean; autoplay?: boolean; debug?: boolean; spacing?: GridSpacing; icons?: Icons; time?: keyof typeof TimeOption; timePosition?: keyof typeof TimePosition; onPlayed?: (event: any) => void; onPaused?: (event: any) => void; onFinished?: (event: any) => void; getPlayer?: (player: HTMLAudioElement | null, dispatch: React.Dispatch<any>) => void; onClose?: () => void; } declare const AudioPlayer: React.FunctionComponent<IAudioPlayerProps>; export default AudioPlayer;