smartdelay/dist/index.d.ts
2017-10-09 11:33:59 +02:00

21 lines
599 B
TypeScript

import 'typings-global';
/**
* delay something, works like setTimeout
* @param timeInMillisecond
* @param passOn
*/
export declare let delayFor: <T>(timeInMillisecond: number, passOn?: T) => Promise<T>;
/**
* delay for a random time
*/
export declare let delayForRandom: <T>(timeMinInMillisecond: number, timeMaxInMillisecond: number, passOn?: T) => Promise<T>;
export declare class Timeout<T> {
promise: Promise<T>;
private _deferred;
private _timeout;
private _cancelled;
constructor(timeInMillisecondArg: any, passOn?: T);
makeUnrefed(): void;
cancel(): void;
}