microsoft / microsoft/TypeScript
Access `global` as a type
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Since https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#augmenting-globalmodule-scope-from-modules it's been possible to augment the global from a module. However, in TypeScript definitions (such as dom.d.ts or node.d.ts) we're left to create our own "globals". This results in two issue:
- inconsistency with what is actually the global namespace
- requiring the declaration of global types multiple times in case it's used as a "real global" or from
window.(browsers) orglobal.(node)
Instead of this, it'd be really nice to access TypeScript's global as a type. For instance, in dom.d.ts we could do:
declare var window: global
Or in node.d.ts:
declare var global: global
I couldn't see any previous issues, but it's partially related to things like https://github.com/Microsoft/TypeScript/issues/12902 - the difference though is that those issues seems to be tracking adding variables to the TypeScript global scope whereas this would be using the global scope as a type to define these variables themselves.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず dom.d.ts と node.d.ts とともに提案を確認し、次に関連する issue #12902 を読んで、このリクエストをグローバルスコープへの追加と区別します。完了とは、TypeScript が使用可能なグローバル namespace 型を提供し、window や global などの宣言がグローバル型を重複させずにそれを参照できる状態です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 28/100