UNPKG

1.16 kBTypeScriptView Raw
1/**
2 * Calls a function after a specified delay.
3 * @param callback The function to be called.
4 * @param milliseconds The time to wait before the function is called. Defaults to 0.
5 * @param args One or more parameter to use once the function is called. Defaults to no parameters.
6 */
7export function setTimeout(callback: Function, milliseconds?: number, ...args: any[]): number;
8
9/**
10 * Clears the delay set by a call to the setTimeout function.
11 * @param id The identifier returned by the previously called setTimeout() method.
12 */
13export function clearTimeout(id: number): void;
14
15/**
16 * Calls a function repeatedly with a delay between each call.
17 * @param callback The function to be called.
18 * @param milliseconds The delay between each function call.
19 * @param args One or more parameter to use once the function is called. Defaults to no parameters.
20 */
21export function setInterval(callback: Function, milliseconds?: number, ...args: any[]): number;
22
23/**
24 * Clears repeated function which was set up by calling setInterval().
25 * @param id The identifier returned by the setInterval() method.
26 */
27export function clearInterval(id: number): void;