DefinitelyTyped/types/requestidlecallback/index.d.ts
Nathan Shively-Sanders f0ce987bc1 Update project urls to match NPM url
Note that this *trivially* updates project urls by adding the NPM url to
the end, even when the urls are almost identical or the DT one is
outdated. I'll clean up the urls in a later commit.

This PR is unfinished! Please do not merge it yet.
2019-02-11 17:10:55 -08:00

22 lines
778 B
TypeScript

// Type definitions for requestidlecallback 0.1
// Project: https://w3c.github.io/requestidlecallback/, https://github.com/afarkas/requestidlecallback
// Definitions by: 贺师俊 <https://github.com/hax>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): IdleCallbackHandle;
export function cancelIdleCallback(handle: IdleCallbackHandle): void;
export type DOMHighResTimeStamp = number;
export type IdleCallbackHandle = number;
export type IdleRequestCallback = (deadline: IdleDeadline) => void;
export interface IdleDeadline {
timeRemaining(): DOMHighResTimeStamp;
readonly didTimeout: boolean;
}
export interface IdleRequestOptions {
timeout: number;
}