You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Web API type definition issue] MediaSourceHandle results in any #2316
MediaSourceHandle results in any making Transferable wrong
Expected vs. Actual Behavior
Currently the type generation for MediaSourceHandle results in
/**
* The **`MediaSourceHandle`** interface of the Media Source Extensions API is a proxy for a MediaSource that can be transferred from a dedicated worker back to the main thread and attached to a media element via its HTMLMediaElement.srcObject property.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaSourceHandle)
*/
interface MediaSourceHandle {
}
declare var MediaSourceHandle: {
prototype: MediaSourceHandle;
new(): MediaSourceHandle;
};
And empty interfaces are known for being equal to any in TS, so this makes Transferable accept any types, which is wrong.
Playground Link
No response
Browser Support
This API is supported in at least two major browser engines (not two Chromium-based browsers).
Have Tried The Latest Releases
This issue applies to the latest release of TypeScript.
This issue applies to the latest release of @types/web.
Activity
[-][Web API type definition issue][/-][+][Web API type definition issue] `MediaSourceHandle` results in `any`[/+]Bashamega commentedon Dec 24, 2025
Currently, it is empty in blink, webkit, and gecko. It needs more support
HolgerJeromin commentedon Dec 24, 2025
But it is not good if the type is "broken" till than...
saschanaz commentedon Dec 24, 2025
#2193 should be able to fix this.