Created
February 12, 2019 04:47
-
-
Save madeinfree/a6c877670b6e5a003332f225f0b31824 to your computer and use it in GitHub Desktop.
declare IdleCallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type RequestIdleCallbackHandle = any; | |
type RequestIdleCallbackOptions = { | |
timeout: number; | |
}; | |
type RequestIdleCallbackDeadline = { | |
readonly didTimeout: boolean; | |
timeRemaining: (() => number); | |
}; | |
declare global { | |
interface Window { | |
requestIdleCallback: (( | |
callback: ((deadline: RequestIdleCallbackDeadline) => void), | |
opts?: RequestIdleCallbackOptions | |
) => RequestIdleCallbackHandle); | |
cancelIdleCallback: ((handle: RequestIdleCallbackHandle) => void); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment