Added missing ...args to setInterval, setTimeout (#21020)

The methods should be able to take them.
This commit is contained in:
Josh Goldberg
2017-10-26 11:47:28 -07:00
committed by Sheetal Nandi
parent 8a6a758e90
commit fe25b8915d
+4 -2
View File
@@ -70,9 +70,10 @@ export interface LolexClock<TTimerId extends TimerId> {
*
* @param callback Callback to be fired.
* @param timeout How many ticks to wait to run the callback.
* @param args Any extra arguments to pass to the callback.
* @returns Time identifier for cancellation.
*/
setTimeout(callback: () => any, timeout: number): TTimerId;
setTimeout(callback: () => any, timeout: number, ...args: any[]): TTimerId;
/**
* Clears a timer, as long as it was created using setTimeout.
@@ -86,9 +87,10 @@ export interface LolexClock<TTimerId extends TimerId> {
*
* @param callback Callback to be fired.
* @param timeout How many ticks to wait between callbacks.
* @param args Any extra arguments to pass to the callback.
* @returns Time identifier for cancellation.
*/
setInterval(callback: () => any, timeout: number): TTimerId;
setInterval(callback: () => any, timeout: number, ...args: any[]): TTimerId;
/**
* Clears a timer, as long as it was created using setInterval.