Skip to content

Commit 9885d45

Browse files
dakotaJangjanpio
authored andcommitted
fix(types): Add type definition for getCurrentAmplitude (#241)
* 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 <[email protected]>
1 parent 68c3735 commit 9885d45

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

types/index.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ declare var Media: {
2727
* W3C specification and may deprecate the current APIs.
2828
*/
2929
interface Media {
30+
/**
31+
* Returns the current amplitude within an audio file.
32+
* @param mediaSuccess The callback that is passed the current amplitude (0.0 - 1.0).
33+
* @param mediaError The callback to execute if an error occurs.
34+
*/
35+
getCurrentAmplitude(
36+
mediaSuccess: (amplitude: number) => void,
37+
mediaError?: (error: MediaError) => void): void;
3038
/**
3139
* Returns the current position within an audio file. Also updates the Media object's position parameter.
3240
* @param mediaSuccess The callback that is passed the current position in seconds.
@@ -81,4 +89,4 @@ interface Media {
8189
interface IosPlayOptions {
8290
numberOfLoops?: number;
8391
playAudioWhenScreenIsLocked?: boolean;
84-
}
92+
}

0 commit comments

Comments
 (0)