Skip to content

Commit af97db3

Browse files
committed
Phew! No type errors!
1 parent 7f3b00c commit af97db3

File tree

5 files changed

+169
-151
lines changed

5 files changed

+169
-151
lines changed

src/core.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
*
88
* MIT License
99
*/
10-
export Howler from './howler'
11-
export Howl from './howl'
10+
import Howler from './Howler';
11+
import Howl from './Howl';
12+
13+
export { Howler, Howl };

src/helpers.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Howl, { HowlXHROptions } from './Howl';
2-
import Howler from './howler';
3-
import { HowlGainNode } from './sound';
2+
import Howler, { HowlerAudioContext } from './howler';
43

54
export const cache = {};
65

@@ -109,11 +108,18 @@ function decodeAudioData(arraybuffer: ArrayBuffer, self: Howl) {
109108
// Decode the buffer into an audio source.
110109
if (
111110
typeof Promise !== 'undefined' &&
112-
Howler.ctx.decodeAudioData.length === 1
111+
(Howler.ctx as HowlerAudioContext).decodeAudioData.length === 1
113112
) {
114-
Howler.ctx.decodeAudioData(arraybuffer).then(success).catch(error);
113+
(Howler.ctx as HowlerAudioContext)
114+
.decodeAudioData(arraybuffer)
115+
.then(success)
116+
.catch(error);
115117
} else {
116-
Howler.ctx.decodeAudioData(arraybuffer, success, error);
118+
(Howler.ctx as HowlerAudioContext).decodeAudioData(
119+
arraybuffer,
120+
success,
121+
error,
122+
);
117123
}
118124
}
119125

0 commit comments

Comments
 (0)