microsoft / microsoft/TypeScript
DOM suggestion: customisable `history.state` type
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Search Terms
dom lib window state history any unknown
Suggestion
Currently window.history.state has type any. Could we provide a way for users to customise this type? Perhaps by making it generic or allowing the type to be changed through declaration merging.
Failing that, could we replace the any type with unknown, so we have type safety and users are forced to validate/widen the type?
Another possible solution: if TypeScript provided a way to override any types (https://github.com/microsoft/TypeScript/issues/4062, https://github.com/microsoft/TypeScript/issues/26188).
Also related:
- https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41568
- https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41580
Use Cases
Examples
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue にはファイル、テスト、具体的なエントリポイントが記載されていません。まず window.history.state の DOM 宣言を見つけ、リンクされている関連 issue を確認してください;完了とするには、例と対応するテストを含む、方針が決定され文書化された型付け設計が必要です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- web-dev
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100