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

0.3.7 • 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

/// <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: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

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

Readme

Keywords

none

Package Sidebar

Install

npm i @types/requestidlecallback

Weekly Downloads

28,282

Version

0.3.7

License

MIT

Unpacked Size

4.58 kB

Total Files

5

Last publish

Collaborators

  • types