Closed
Description
For most modern browsers, there exists some type of AudioContext on the window, however the current definition for Window
has neither of these.
- In some browsers, the audio context exists at
window.AudioContext
- In some browsers, the audio context exists at
window.webkitAudioContext
I would expect the definition of Window
in lib.dom.d.ts
too look something similar to this:
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch, WindowOrWorkerGlobalScope, WindowEventHandlers {
AudioContext?: typeof AudioContext;
webkitAudioContext?: typeof AudioContext;
...
Search Terms:
AudioContext, webkitAudioContext , audio context missing in window
Code
window.AudioContext
window.webkitAudioContext
Expected behavior:
AudioContext and webkitAudioContext are defined on the window object
Actual behavior:
AudioContext and webkitAudioContext are not defined on the window object
Playground Link:
https://www.typescriptlang.org/play/#src=window.AudioContext%0Awindow.webkitAudioContext