Nifty Procrastination Machine

    @types/requestidlecallback
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.4 • Public • Published

    Installation

    npm install --save @types/requestidlecallback

    Summary

    This package contains type definitions for requestidlecallback (https://w3c.github.io/requestidlecallback/).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/requestidlecallback.

    index.d.ts

    // Type definitions for requestidlecallback 0.3
    // Project: https://w3c.github.io/requestidlecallback/, https://github.com/afarkas/requestidlecallback
    // Definitions by: 贺师俊 <https://github.com/hax>
    //                 Vladimir Grenaderov <https://github.com/VladimirGrenaderov>
    //                 Max Boguslavskiy <https://github.com/maxbogus>
    //                 Teramoto Daiki <https://github.com/teramotodaiki>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference lib="dom" />
    
    interface IdleDeadline {
        timeRemaining(): DOMHighResTimeStamp;
        readonly didTimeout: boolean;
    }
    
    interface IdleRequestOptions {
        timeout?: number | undefined;
    }
    
    type IdleCallbackHandle = number;
    
    interface Window {
        requestIdleCallback(callback: (deadline: IdleDeadline) => void, options?: IdleRequestOptions): IdleCallbackHandle;
        cancelIdleCallback(handle: number): void;
    }
    
    declare function requestIdleCallback(callback: (deadline: IdleDeadline) => void, options?: IdleRequestOptions): number;
    declare function cancelIdleCallback(handle: number): void;
    
    declare function request(callback: (deadline: IdleDeadline) => void, options?: IdleRequestOptions): IdleCallbackHandle;
    declare function cancel(handle: IdleCallbackHandle): void;

    Additional Details

    • Last updated: Wed, 07 Jul 2021 18:02:24 GMT
    • Dependencies: none
    • Global values: cancel, cancelIdleCallback, request, requestIdleCallback

    Credits

    These definitions were written by 贺师俊, Vladimir Grenaderov, Max Boguslavskiy, and Teramoto Daiki.

    Keywords

    none

    Install

    npm i @types/requestidlecallback

    DownloadsWeekly Downloads

    25,087

    Version

    0.3.4

    License

    MIT

    Unpacked Size

    5.87 kB

    Total Files

    4

    Last publish

    Collaborators

    • types