Closed
Description
TypeScript Version: 4.1.0-dev.20200925
Search Terms: requestIdleCallback
Code
requestIdleCallback(() => {})
Expected behavior:
requestIdleCallback
is typed.
Actual behavior:
Cannot find name 'requestIdleCallback'. ts(2304)
Playground Link:
https://www.typescriptlang.org/play?#code/E4UwjgriDOAuCSATANiAwgQ2cgRhgxgNYAUxAlAAQC8AfBQN4C+ZQA
Related Issues:
#21309
The previous issue was labelled as "working as intended" over 2 years ago, but I don't think the API is experimental anymore. It is available in Chrome/Firefox/Edgium, and Safari (behind a flag).
https://www.w3.org/TR/requestidlecallback/
https://w3c.github.io/requestidlecallback/
https://caniuse.com/requestidlecallback
https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback