aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-types/timers.d.ts
blob: 522ae6a187396714231ec10aafd8c119fa599a78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * The `timer` module exposes a global API for scheduling functions to
 * be called at some future period of time. Because the timer functions are
 * globals, there is no need to call `require('timers')` to use the API.
 *
 * The timer functions within Node.js implement a similar API as the timers API
 * provided by Web Browsers but use a different internal implementation that is
 * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
 * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js)
 */

declare module "timers" {
  const _exported: {
    clearTimeout: typeof clearTimeout;
    clearInterval: typeof clearInterval;
    setTimeout: typeof setTimeout;
    setInterval: typeof setInterval;
  };
  export = _exported;
}
declare module "node:timers" {
  import timers = require("timers");
  export = timers;
}