UNPKG

812 BTypeScriptView Raw
1import { LodashMethodDecorator } from './factory';
2declare const decorator: (...args: any[]) => MethodDecorator & PropertyDecorator;
3/**
4 * Invokes func after wait milliseconds. Any additional arguments are provided to func when it's invoked.
5 *
6 * @param {number} wait The number of milliseconds to delay invocation.
7 * @param {...*} [args] Additional arguments to invoke the function with
8 * @example
9 *
10 * class MyClass {
11 * value = 100;
12 *
13 * @Delay(20)
14 * add(a) {
15 * this.value += a;
16 * }
17 * }
18 *
19 * const myClass = new MyClass();
20 *
21 * myClass.add(10);
22 *
23 * myClass.value; // => 100;
24 *
25 * setTimeout(() => {
26 * myClass.value; // => 110;
27 * }, 30);
28 */
29export declare function Delay(wait: number, ...args: any[]): LodashMethodDecorator;
30export { Delay as delay };
31export default decorator;