UNPKG

961 BTypeScriptView Raw
1declare module 'timers' {
2 function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
3 namespace setTimeout {
4 function __promisify__(ms: number): Promise<void>;
5 function __promisify__<T>(ms: number, value: T): Promise<T>;
6 }
7 function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
8 function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
9 function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
10 function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
11 namespace setImmediate {
12 function __promisify__(): Promise<void>;
13 function __promisify__<T>(value: T): Promise<T>;
14 }
15 function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
16}
17declare module 'node:timers' {
18 export * from 'timers';
19}