Skip to content

Commit f991637

Browse files
authored
Make requestidlecallback work with TS 4.4 DOM (#54081)
* Make requestidlecallback work with TS 4.4 DOM TS 4.4 improves its types for requestidlecallback. This PR makes DT match those upcoming types. Needed after microsoft/TypeScript#44684 is merged. * remove redundant undefined for now
1 parent 4377a41 commit f991637

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

types/requestidlecallback/index.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Max Boguslavskiy <https://github.com/maxbogus>
66
// Teramoto Daiki <https://github.com/teramotodaiki>
77
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8-
// TypeScript Version: 3.0
8+
// TypeScript Version: 4.4
99

1010
/// <reference lib="dom" />
1111

@@ -15,13 +15,11 @@ interface IdleDeadline {
1515
}
1616

1717
interface IdleRequestOptions {
18-
timeout: number;
18+
timeout?: number;
1919
}
2020

2121
type IdleCallbackHandle = number;
2222

23-
type IdleRequestCallback = (deadline: IdleDeadline) => void;
24-
2523
interface Window {
2624
requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): IdleCallbackHandle;
2725
cancelIdleCallback(handle: number): void;

0 commit comments

Comments
 (0)