Strict types for WebGL and WebGL2
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- tooling
調査の方向性
まず TypeScript PR #21902 で提案されている型と、その変更ファイルを確認し、次に自動生成された typings が dom.generated.d.ts にどのように取り込まれるかを調べます。WebGL/WebGL2 の宣言を追加の入力にするべきか、別個の lib オプションにするべきかを判断し、issue で説明されている overload と共有スーパタイプに関する懸念を評価します。合意された統合方針と適切な厳密な typings が定まれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Opening a new issue, as requested. See also https://github.com/Microsoft/TypeScript/pull/21902.
I wrote some strict types for WebGL/WebGL2, which would fix https://github.com/Microsoft/TypeScript/issues/5855 among others. See https://github.com/Microsoft/TypeScript/pull/21902/files.
The auto-generated typings would need to be excluded. Maybe this should be added as a separate option for the lib compiler option as it's not exactly lightweight.
I might have made some of the types too strict, for example for texImage2D I added overloads which exactly match the internalFormat/format/type combinations allowed by the WebGL spec. When calling the function with immediate values, this is fine, but calling it with values in variables is going to require as any casts. (Which could be fine, as at that point you're responsible for the correct types anyway).
Also the following would fail, because TS doesn't currently generate a common supertype (?).
declare const randomParameter: GL['ACTIVE_TEXTURE'] | GL['ALIASED_LINE_WIDTH_RANGE']
const x = gl.getParameter(randomParameter)
// no matching overload, but a return type of GL.TextureUnits | Float32Array would make sense.
Is adding the .d.ts files as additional inputFiles which are concatenated to the dom.generated.d.ts (or a separate webgl lib file) an option? I added a number of subtypes which are only implicitly in the spec: all constants are typed as a generic GLenum in spec, although there are many different subgroups which I typed explicitly. It is highly unlikely that those will be added to the IDL.
- 主要言語
- TypeScript
- スター
- 740
- フォーク
- 474
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 15
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TypeScript-DOM-lib-generator のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/TypeScript-DOM-lib-generator#2554 · コメント 6 件 ·
-
lib.d.ts bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
lib.d.ts bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
microsoft/TypeScript-DOM-lib-generator#2154 · リアクション 1 件 ·
-
lib.d.ts bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/TypeScript-DOM-lib-generator#2107 · コメント 5 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/TypeScript-DOM-lib-generator#1675 · コメント 2 件 · リアクション 1 件 ·
microsoft/TypeScript-DOM-lib-generator の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·