1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | declare function callBind<T, A extends unknown[], R>(target: (this: T, ...args: A) => R): (thisArg: T, ...args: A) => R;
|
14 | declare function callBind<T, A extends unknown[], R>(target: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R;
|
15 | declare function callBind<T, A0, A extends unknown[], R>(
|
16 | target: (this: T, arg0: A0, ...args: A) => R,
|
17 | thisArg: T,
|
18 | arg0: A0,
|
19 | ): (...args: A) => R;
|
20 | declare function callBind<T, A0, A1, A extends unknown[], R>(
|
21 | target: (this: T, arg0: A0, arg1: A1, ...args: A) => R,
|
22 | thisArg: T,
|
23 | arg0: A0,
|
24 | arg1: A1,
|
25 | ): (...args: A) => R;
|
26 | declare function callBind<T, A0, A1, A2, A extends unknown[], R>(
|
27 | target: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
|
28 | thisArg: T,
|
29 | arg0: A0,
|
30 | arg1: A1,
|
31 | arg2: A2,
|
32 | ): (...args: A) => R;
|
33 | declare function callBind<T, A0, A1, A2, A3, A extends unknown[], R>(
|
34 | target: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R,
|
35 | thisArg: T,
|
36 | arg0: A0,
|
37 | arg1: A1,
|
38 | arg2: A2,
|
39 | arg3: A3,
|
40 | ): (...args: A) => R;
|
41 | declare function callBind<T, AX, R>(
|
42 | target: (this: T, ...args: AX[]) => R,
|
43 | thisArg: T,
|
44 | ...args: AX[]
|
45 | ): (...args: AX[]) => R;
|
46 |
|
47 |
|
48 | declare function callBind<F extends Function>(
|
49 | target: F,
|
50 | ): (
|
51 | thisArg: ThisParameterType<F>,
|
52 | ...args: F extends (...args: infer A) => any ? A : unknown[]
|
53 | ) => F extends (...args: any) => infer R ? R : any;
|
54 |
|
55 |
|
56 | declare function callBind<F extends Function>(
|
57 | target: F,
|
58 | thisArg: ThisParameterType<F>,
|
59 | ): (...args: F extends (...args: infer A) => any ? A : unknown[]) => F extends (...args: any) => infer R ? R : any;
|
60 |
|
61 |
|
62 | declare function callBind<F extends Function>(
|
63 | target: F,
|
64 | thisArg: ThisParameterType<F>,
|
65 | ...args: unknown[]
|
66 | ): (...args: unknown[]) => F extends (...args: any) => infer R ? R : any;
|
67 |
|
68 | declare namespace callBind {
|
69 | |
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 | function apply<T, A extends unknown[], R>(target: (this: T, ...args: A) => R): (thisArg: T, args: Readonly<A>) => R;
|
82 | function apply<T, A extends unknown[], R>(target: (this: T, ...args: A) => R, thisArg: T): (args: Readonly<A>) => R;
|
83 | function apply<T, A0, A extends unknown[], R>(
|
84 | target: (this: T, arg0: A0, ...args: A) => R,
|
85 | thisArg: T,
|
86 | arg0: A0,
|
87 | ): (args: Readonly<A>) => R;
|
88 | function apply<T, A0, A1, A extends unknown[], R>(
|
89 | target: (this: T, arg0: A0, arg1: A1, ...args: A) => R,
|
90 | thisArg: T,
|
91 | arg0: A0,
|
92 | arg1: A1,
|
93 | ): (args: Readonly<A>) => R;
|
94 | function apply<T, A0, A1, A2, A extends unknown[], R>(
|
95 | target: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
|
96 | thisArg: T,
|
97 | arg0: A0,
|
98 | arg1: A1,
|
99 | arg2: A2,
|
100 | ): (args: Readonly<A>) => R;
|
101 | function apply<T, A0, A1, A2, A3, A extends unknown[], R>(
|
102 | target: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R,
|
103 | thisArg: T,
|
104 | arg0: A0,
|
105 | arg1: A1,
|
106 | arg2: A2,
|
107 | arg3: A3,
|
108 | ): (args: Readonly<A>) => R;
|
109 | function apply<T, AX, R>(target: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (args: AX[]) => R;
|
110 |
|
111 |
|
112 | function apply<F extends Function>(
|
113 | target: F,
|
114 | ): (
|
115 | thisArg: ThisParameterType<F>,
|
116 | args: F extends (...args: infer A) => any ? Readonly<A> : readonly unknown[],
|
117 | ) => F extends (...args: any) => infer R ? R : any;
|
118 |
|
119 |
|
120 | function apply<F extends Function>(
|
121 | target: F,
|
122 | thisArg: ThisParameterType<F>,
|
123 | ): (
|
124 | args: F extends (...args: infer A) => any ? Readonly<A> : readonly unknown[],
|
125 | ) => F extends (...args: any) => infer R ? R : any;
|
126 |
|
127 |
|
128 | function apply<F extends Function>(
|
129 | target: F,
|
130 | thisArg: ThisParameterType<F>,
|
131 | ...args: unknown[]
|
132 | ): (args: ArrayLike<unknown>) => F extends (...args: any) => infer R ? R : any;
|
133 | }
|
134 |
|
135 | export = callBind;
|