Microsoft/TypeScript
在 GitHub 查看AbortController.abort is missing in lib.webworker.d.ts
Open
#49,609 建立於 2022年6月20日
BugDomain: lib.d.tsHelp Wanted
倉庫指標
- Star
- (48,455 star)
- PR 合併指標
- (平均合併 6天 17小時) (30 天內合併 9 個 PR)
描述
Bug Report
AbortController.abort remains commented out and is not available in lib.webworker.d.ts.
🔎 Search Terms
AbortController, abort
🕗 Version & Regression Information
It's from v4.7.2. It was OK in v4.6.4.
And also, lib.dom.d.ts is fine.
💻 Code
const controller = new AbortController();
const cancel = (): void => controller.abort();
🙁 Actual behavior
src/core.ts:99:42 - error TS2339: Property 'abort' does not exist on type 'AbortController'.
99 const cancel = (): void => controller.abort();
~~~~~
🙂 Expected behavior
The correct behavior is that even in a worker can compile correctly.