microsoft / microsoft/TypeScript

MediaTrackConstraintsSet misses torch

未关闭
#39,010 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Domain: lib.d.ts Help Wanted
主要语言
Go
星标
111k
派生
14.4k
平均合并
1 天 19 小时
30 天内合并 PR
117

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 lib/lib.dom.d.ts 中的 MediaTrackConstraintsSet 开始,然后查看使用 advanced 和 torch 调用 track.applyConstraints 的关联 Playground 示例。将该声明与报告的浏览器功能进行比较,并确定是否应表示缺失的成员;完成的标准是 TypeScript 示例在不切换到 JavaScript 的情况下被接受。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
web-dev
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。