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

3.1.2 • Public • Published

Installation

npm install --save @types/wait-please

Summary

This package contains type definitions for wait-please (https://github.com/dy/wait-please#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wait-please.

index.d.ts

/**
 * Wait for `n` microtask ticks.
 * Uses `queueMicrotask` or `Promise.resolve` ~ same as `process.nextTick` under the hood.
 *
 * @example
 * import { tick } from 'wait-please'
 *
 * await tick(3)
 */
export function tick(n?: number): Promise<void>;

/**
 * Wait for `n` animation frames. Uses `requestAnimationFrame` under the hood.
 *
 * @example
 * import { frame } from 'wait-please'
 *
 * await frame(3)
 */
export function frame(n?: number): Promise<void>;

/**
 * Wait for `n` milliseconds. Uses `setTimeout` under the hood.
 *
 * @example
 * import { time } from 'wait-please'
 *
 * await time(150)
 */
export function time(n?: number): Promise<void>;

/**
 * Wait for `n` macrotasks in task queue. Uses `requestIdleCallback` or `setImmediate` under the hood.
 *
 * @example
 * import { idle } from 'wait-please'
 *
 * await idle()
 */
export function idle(n?: number): Promise<void>;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/wait-please

Weekly Downloads

0

Version

3.1.2

License

MIT

Unpacked Size

4.36 kB

Total Files

5

Last publish

Collaborators

  • types