Skip to content

AudioContext and webkitAudioContext missing in Window definition in lib.dom.d.ts #31686

Closed
@jonsadka

Description

@jonsadka

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

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions