UNPKG

855 BTypeScriptView Raw
1import { LodashDecorator } from './factory';
2declare const decorator: (...args: any[]) => LodashDecorator;
3/**
4 * Creates a function that invokes func, with the this binding and arguments of the created function, while it's called less than n times.
5 * Subsequent calls to the created function return the result of the last func invocation.
6 * @param {number} n The number of calls at whichc func is no longer invoked.
7 * @example
8 *
9 * let calls = 0;
10 *
11 * class MyClass {
12 * @BeforeAll(3)
13 * fn() {
14 * calls++;
15 * }
16 * }
17 *
18 * const myClass = new MyClass();
19 * const myClass2 = new MyClass();
20 *
21 * myClass.fn();
22 * myClass.fn();
23 * myClass.fn();
24 * myClass.fn();
25 *
26 * myClass2.fn();
27 *
28 * calls === 3; // => true
29 */
30export declare function BeforeAll(n: number): LodashDecorator;
31export { BeforeAll as beforeAll };
32export default decorator;