diff --git a/types/react-sound/index.d.ts b/types/react-sound/index.d.ts index 4670feb5f9..9d0d85f141 100644 --- a/types/react-sound/index.d.ts +++ b/types/react-sound/index.d.ts @@ -6,29 +6,32 @@ import * as React from "react"; -declare namespace ReactSound { - type PlayStatus = 'PLAYING' | 'STOPPED' | 'PAUSED'; - - interface ReactSoundProps { - url: string; - playStatus: PlayStatus; - playFromPosition?: number; - position?: number; - volume?: number; - playbackRate?: number; - autoLoad?: boolean; - loop?: boolean; - onError?: () => void; - onLoading?: () => void; - onLoad?: () => void; - onPlaying?: () => void; - onPause?: () => void; - onResume?: () => void; - onStop?: () => void; - onFinishedPlaying?: () => void; - onBufferChange?: () => void; - } +export enum PlayStatus { + Playing = 'PLAYING', + Stopped = 'STOPPED', + Paused = 'PAUSED' } -declare const ReactSound: React.ComponentClass; -export = ReactSound; +export interface ReactSoundProps { + url: string; + playStatus: PlayStatus; + playFromPosition?: number; + position?: number; + volume?: number; + playbackRate?: number; + autoLoad?: boolean; + loop?: boolean; + onError?: () => void; + onLoading?: () => void; + onLoad?: () => void; + onPlaying?: () => void; + onPause?: () => void; + onResume?: () => void; + onStop?: () => void; + onFinishedPlaying?: () => void; + onBufferChange?: () => void; +} + +declare const ReactSound: React.ComponentClass; + +export default ReactSound; diff --git a/types/react-sound/react-sound-tests.tsx b/types/react-sound/react-sound-tests.tsx index 2775ac607a..358111dce1 100644 --- a/types/react-sound/react-sound-tests.tsx +++ b/types/react-sound/react-sound-tests.tsx @@ -1,10 +1,10 @@ -import ReactSound from "react-sound"; +import ReactSound, { PlayStatus } from "react-sound"; import * as React from "react"; const ReactSoundRequiredOptions: JSX.Element = ( ); @@ -13,7 +13,7 @@ const callbackFn = () => ({}); const ReactSoundAllOptions: JSX.Element = (