-
Notifications
You must be signed in to change notification settings - Fork 459
Open
Labels
Description
Summary
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.
Additional Context
Currently using latest typescript 5.9.3
My workaround for now is using this definition.
interface MediaSourceHandle {
__dummy__: never
}