Skip to content

Commit

Permalink
Make requestidlecallback work with TS 4.4 DOM (#54081)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sandersn authored Jun 28, 2021
1 parent 4377a41 commit f991637
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions types/requestidlecallback/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Max Boguslavskiy <https://github.com/maxbogus>
// Teramoto Daiki <https://github.com/teramotodaiki>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
// TypeScript Version: 4.4

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

Expand All @@ -15,13 +15,11 @@ interface IdleDeadline {
}

interface IdleRequestOptions {
timeout: number;
timeout?: number;
}

type IdleCallbackHandle = number;

type IdleRequestCallback = (deadline: IdleDeadline) => void;

interface Window {
requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): IdleCallbackHandle;
cancelIdleCallback(handle: number): void;
Expand Down

0 comments on commit f991637

Please sign in to comment.