1 | export = once;
|
2 |
|
3 | declare const once: Once;
|
4 |
|
5 | interface Once extends once.OnceFn {
|
6 | proto(): void;
|
7 | strict: once.OnceFn;
|
8 | }
|
9 |
|
10 | declare namespace once {
|
11 | interface OnceFn {
|
12 | <R>(f: () => R): (() => R) & FnProps<R>;
|
13 | <T1, R>(f: (t1: T1) => R): ((t1: T1) => R) & FnProps<R>;
|
14 | <T1, T2, R>(f: (t1: T1, t2: T2) => R): ((t1: T1, t2: T2) => R) & FnProps<R>;
|
15 | <T1, T2, T3, R>(f: (t1: T1, t2: T2, t3: T3) => R): ((t1: T1, t2: T2, t3: T3) => R) & FnProps<R>;
|
16 | <T1, T2, T3, T4, R>(
|
17 | f: (t1: T1, t2: T2, t3: T3, t4: T4) => R,
|
18 | ): ((t1: T1, t2: T2, t3: T3, t4: T4) => R) & FnProps<R>;
|
19 | <T1, T2, T3, T4, T5, R>(
|
20 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R,
|
21 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R) & FnProps<R>;
|
22 | <T1, T2, T3, T4, T5, T6, R>(
|
23 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) => R,
|
24 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) => R) & FnProps<R>;
|
25 | <T1, T2, T3, T4, T5, T6, T7, R>(
|
26 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7) => R,
|
27 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7) => R) & FnProps<R>;
|
28 | <T1, T2, T3, T4, T5, T6, T7, T8, R>(
|
29 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8) => R,
|
30 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8) => R) & FnProps<R>;
|
31 | <T1, T2, T3, T4, T5, T6, T7, T8, T9, R>(
|
32 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9) => R,
|
33 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9) => R) & FnProps<R>;
|
34 | <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R>(
|
35 | f: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10) => R,
|
36 | ): ((t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10) => R) & FnProps<R>;
|
37 | <R>(f: (...args: any[]) => R): ((...args: any[]) => R) & FnProps<R>;
|
38 | }
|
39 |
|
40 | interface FnProps<R> {
|
41 | called: boolean;
|
42 | value: R | undefined;
|
43 | }
|
44 | }
|
45 |
|
46 | declare global {
|
47 | interface Function {
|
48 | // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
49 | once(): Function & once.FnProps<any>;
|
50 | }
|
51 | }
|
52 |
|
\ | No newline at end of file |