npm.io
1.0.2 • Published 2 years ago

@types/nanoscheduler

Licence
MIT
Version
1.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/nanoscheduler

Summary

This package contains type definitions for nanoscheduler (https://github.com/choojs/nanoscheduler#readme).

Details

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

index.d.ts

/**
 * Create a new scheduler instance.
 * The instance is shared as a singleton on window (if available).
 */
declare function createScheduler(): scheduler.NanoScheduler;

declare namespace scheduler {
    /**
     * Schedule work to be completed when the user agent is idle. Weighs 270 bytes compressed.
     */
    abstract class NanoScheduler {
        constructor(hasWindow: boolean);
        /**
         * Push a callback into the scheduler, to be executed when the user agent is idle.
         */
        push(cb: () => void): void;
        schedule(): void;
        setTimeout(cb: () => void): void;
    }
}

export = createScheduler;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Piotr Błażejewicz.