microsoft / microsoft/TypeScript
lib.dom: DOMatrix constructor accepts TypedArrays, not only Arrays.
オープン
まだ誰も着手していません。
Bug
Domain: lib.d.ts
Help Wanted
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
⚙ Compilation target
n/a
⚙ Library
lib.dom
Missing / Incorrect Definition
DOMMatrix and DOMMatrixReadonly constructors are typed as accepting only number[] but they also accept TypedArrays in all browsers.
The following code works in all browsers:
Sample Code
new DOMMatrix(new Float32Array(16))
Documentation Link
The MDN documentation doesn't really mention this detail, and the spec mentions a "sequence" which to me isn't very specific. Isn't a TypedArray a "sequence of numbers"?
Perhaps the type should probably be ArrayLike<number>.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、DOMMatrix および DOMMatrixReadonly コンストラクターの lib.dom 宣言を見つけ、現在のパラメーター型を new DOMMatrix(new Float32Array(16)) で示される動作と比較します。利用可能であれば、関連する宣言テストを確認します。両方のコンストラクターが、通常の数値配列だけでなく型付き配列も受け入れれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- web-dev
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100