Skip to content

Commit

Permalink
fix(types): Add type definition for getCurrentAmplitude (#241)
Browse files Browse the repository at this point in the history
* ci(travis): Update Travis CI configuration for new paramedic (#227)

* Update Travis CI configuration for new paramedic

* Update .travis.yml

* remove failing platforms

*  Add type definition for getCurrentAmplitude


Co-authored-by: Jan Piotrowski <piotrowski+git@gmail.com>
  • Loading branch information
2 people authored and timbru31 committed Jun 29, 2019
1 parent 68c3735 commit 9885d45
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ declare var Media: {
* W3C specification and may deprecate the current APIs.
*/
interface Media {
/**
* Returns the current amplitude within an audio file.
* @param mediaSuccess The callback that is passed the current amplitude (0.0 - 1.0).
* @param mediaError The callback to execute if an error occurs.
*/
getCurrentAmplitude(
mediaSuccess: (amplitude: number) => void,
mediaError?: (error: MediaError) => void): void;
/**
* Returns the current position within an audio file. Also updates the Media object's position parameter.
* @param mediaSuccess The callback that is passed the current position in seconds.
Expand Down Expand Up @@ -81,4 +89,4 @@ interface Media {
interface IosPlayOptions {
numberOfLoops?: number;
playAudioWhenScreenIsLocked?: boolean;
}
}

0 comments on commit 9885d45

Please sign in to comment.