microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.1k stars 12.37k forks source link

MediaTrackConstraintsSet misses torch #39010

Open Laubeee opened 4 years ago

Laubeee commented 4 years ago

I'd like to use the torch constraint but typescript complains as its missing in the defined set.

I understand the advanced field is controversial and might even be removed, but yet I think it is a bad idea if typescript disallows using the features when they are implemented...

TypeScript Version: 3.8.3 also master: https://github.com/microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L770

Code

track.applyConstraints({ advanced: [{ torch: this.torch }]});

Expected behavior: not to be restricted in functionality when using typescript

Actual behavior: I can't use this feature.. I have to switch to JS

Playground Link: Playground Link

RyanCavanaugh commented 4 years ago

I have to switch to JS

Just to note, there are about a dozen ways to silence any particular error. You don't have to throw the baby out with the swimming pool water 😅