microsoft / microsoft/TypeScript
Missing controlsList property in HTMLMediaElement
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
controlsList HTMLMediaElement
Code
const video = $htmlVideoElement as HTMLVideoElement
video.controlsList.value = "nodownload";
Expected behavior:
Works so we can do things as shown https://googlechrome.github.io/samples/media/controlslist.html and as documented by https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/controlsList
Actual behavior:
controlsList is not valid for HTMLVideoElement
Related Issues:
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19500
Workaround is to add and let the declarations get merged.
declare global {
interface HTMLMediaElement {
readonly controlsList: DOMTokenList
}
}
Or add an ambient type file
interface HTMLMediaElement {
readonly controlsList: DOMTokenList;
}
interface DOMTokenList {
/**
* Returns the associated set as string.
* Can be set, to change the associated attribute.
*/
value: string;
}
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、HTMLVideoElement の例で使用されている HTMLMediaElement と DOMTokenList の宣言を見つけます。文書化されている controlsList API とその value プロパティを現在の宣言と比較し、提供された Playground コードが ambient workaround なしで型チェックを通過することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100