Installation
npm install --save @types/react-howler
Summary
This package contains type definitions for react-howler (https://github.com/thangngoc89/react-howler).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-howler.
index.d.ts
import { Howl, HowlCallback, HowlErrorCallback, HowlOptions } from "howler";
import * as React from "react";
declare enum HOWLER_STATE {
UNLOADED = "unloaded",
LOADING = "loading",
LOADED = "loaded",
}
export { HowlCallback, HowlErrorCallback };
export interface PropTypes {
src: HowlOptions["src"];
preload?: boolean | undefined;
playing?: boolean | undefined;
loop?: HowlOptions["loop"];
mute?: HowlOptions["mute"];
volume?: HowlOptions["volume"];
rate?: HowlOptions["rate"];
html5?: HowlOptions["html5"];
format?: HowlOptions["format"];
xhr?: HowlOptions["xhr"] | undefined;
onPlay?: HowlCallback | undefined;
onPause?: HowlCallback | undefined;
onVolume?: HowlCallback | undefined;
onStop?: HowlCallback | undefined;
onLoad?: HowlCallback | undefined;
onLoadError?: HowlErrorCallback | undefined;
onEnd?: HowlCallback | undefined;
onSeek?: HowlCallback | undefined;
onPlayError?: HowlErrorCallback | undefined;
}
declare class ReactHowler extends React.Component<PropTypes> {
stop(id?: number): void;
duration(id?: number): number;
seek(time?: number): number;
howlerState(): HOWLER_STATE;
howler: Howl;
}
export default ReactHowler;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/howler, @types/react
Credits
These definitions were written by Danijel Maksimovic.