react-usehooks-ts
Version:
A collections of typescript supported react Custom hooks
27 lines (26 loc) • 792 B
TypeScript
type PlaybackState = "none" | "paused" | "playing";
interface ArtWork {
src: string;
sizes: string;
type: string;
}
interface MEDIA {
title: string;
artist: string;
artwork: ArtWork[];
}
interface MediaSessionOptions {
playbackState?: PlaybackState;
onPlay?: () => void;
onPause?: () => void;
onSeekBackward?: () => void;
onSeekForward?: () => void;
onPreviousTrack?: () => void;
onNextTrack?: () => void;
onSeekTo?: () => void;
onSkipAd?: () => void;
onStop?: () => void;
mediaInfo: MEDIA;
}
declare const useMediaSession: ({ playbackState, mediaInfo, onPause, onPlay, onNextTrack, onPreviousTrack, onSeekBackward, onSeekForward, onSeekTo, onSkipAd, onStop, }: MediaSessionOptions) => void;
export default useMediaSession;