2020-09-21 08:26:41 -04:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-01-15 14:13:12 -05:00
|
|
|
// TODO: implement the 'NodeJS.Timeout' and 'NodeJS.Immediate' versions of the timers.
|
|
|
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1163ead296d84e7a3c80d71e7c81ecbd1a130e9a/types/node/v12/globals.d.ts#L1120-L1131
|
|
|
|
export const setTimeout = window.setTimeout;
|
|
|
|
export const clearTimeout = window.clearTimeout;
|
|
|
|
export const setInterval = window.setInterval;
|
|
|
|
export const clearInterval = window.clearInterval;
|
|
|
|
export const setImmediate = (
|
2020-11-03 10:19:29 -05:00
|
|
|
// deno-lint-ignore no-explicit-any
|
2020-05-15 09:51:49 -04:00
|
|
|
cb: (...args: any[]) => void,
|
2020-11-03 10:19:29 -05:00
|
|
|
// deno-lint-ignore no-explicit-any
|
2020-05-15 09:51:49 -04:00
|
|
|
...args: any[]
|
2020-01-15 14:13:12 -05:00
|
|
|
): number => window.setTimeout(cb, 0, ...args);
|
|
|
|
export const clearImmediate = window.clearTimeout;
|