mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* added tests and updated requestidlecallback type * added tests and updated requestidlecallback type * - corrected arguments according to feedback.
18 lines
482 B
TypeScript
18 lines
482 B
TypeScript
import {
|
|
requestIdleCallback,
|
|
cancelIdleCallback,
|
|
IdleRequestOptions,
|
|
IdleCallbackHandle,
|
|
} from 'requestidlecallback';
|
|
|
|
// Test requestIdleCallback with default param
|
|
requestIdleCallback(() => '1');
|
|
|
|
// Test requestIdleCallback with default param and optional param
|
|
const option: IdleRequestOptions = { timeout: 2000 };
|
|
requestIdleCallback(() => '2', option);
|
|
|
|
// Test cancelIdleCallback with default param
|
|
const handle: IdleCallbackHandle = 1;
|
|
cancelIdleCallback(handle);
|