-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: define an AudioTrackList, VideoTrackList, AudioTrack and Video…
…Track replacement type TypeScript v3.9.x seems to have removed its type definitions for those DOM APIs (video tracks and audio tracks we can find on an HTMLMediaElement). The reason why are not clear but judging by the problematic commit (microsoft/TypeScript@065a996#diff-46fd87925e4552c166ec188712741c3f) - meaning of LKG being "last known good". My guess would be that it is automatically generated from a source which does not have those APIs (why we had them before is more of a mystery but I guess that's what this LKG thing was about). What I did in this commit is to creates four new types: - ICompatAudioTrackList - ICompatVideoTrackList - ICompatAudioTrack - ICompatVideoTrack Which are respectively the implementation of an AudioTrackList, VideoTrackList, AudioTrack and VideoTrack as they are defined in the web-idl of the corresponding APIs in the whatwg spec (https://html.spec.whatwg.org/multipage/media.html#audiotracklist-and-videotracklist-objects). I chose to name those ICompatThing and not directly extending Thing because I find it allows to better see which types are "native" TypeScript ones and which have been actually extended because they missed some browser APIs. As TypeScript could evolve to add those APIs, we could need to remove those. So making them stand out from the rest is and advantage to me.
- Loading branch information
1 parent
2344c74
commit 237a322
Showing
2 changed files
with
99 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters