@@ -169,10 +169,10 @@ function findIndex<T>(arr: T[], callback: (item: T) => boolean): number {
169
169
* Generate a full integration function from a simple function.
170
170
* This will ensure to add the given name both to the function definition, as well as to the integration return value.
171
171
*/
172
- export function makeIntegrationFn < Fn extends ( ... rest : any [ ] ) => Partial < IntegrationFnResult > > (
173
- name : string ,
174
- fn : Fn ,
175
- ) : ( ( ...rest : Parameters < Fn > ) => ReturnType < Fn > & { name : string } ) & { id : string } {
172
+ export function makeIntegrationFn <
173
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
174
+ Fn extends ( ... rest : any [ ] ) => Partial < IntegrationFnResult > ,
175
+ > ( name : string , fn : Fn ) : ( ( ...rest : Parameters < Fn > ) => ReturnType < Fn > & { name : string } ) & { id : string } {
176
176
const patchedFn = addIdToIntegrationFnResult ( name , fn ) ;
177
177
178
178
return Object . assign ( patchedFn , { id : name } ) ;
@@ -181,11 +181,15 @@ export function makeIntegrationFn<Fn extends (...rest: any[]) => Partial<Integra
181
181
/**
182
182
* Convert a new integration function to the legacy class syntax.
183
183
* In v8, we can remove this and instead export the integration functions directly.
184
+ *
185
+ * @deprecated This will be removed in v8!
184
186
*/
185
- export function convertIntegrationFnToClass < Fn extends IntegrationFn < ( ...rest : any [ ] ) => IntegrationFnResult > > (
186
- fn : Fn ,
187
- ) : IntegrationClass < Integration > {
187
+ export function convertIntegrationFnToClass <
188
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
+ Fn extends IntegrationFn < ( ...rest : any [ ] ) => IntegrationFnResult > ,
190
+ > ( fn : Fn ) : IntegrationClass < Integration > {
188
191
return Object . assign (
192
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
193
function ConvertedIntegration ( ...rest : any [ ] ) {
190
194
const res = {
191
195
// eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -200,10 +204,10 @@ export function convertIntegrationFnToClass<Fn extends IntegrationFn<(...rest: a
200
204
) as unknown as IntegrationClass < Integration > ;
201
205
}
202
206
203
- function addIdToIntegrationFnResult < Fn extends ( ... rest : any [ ] ) => Partial < IntegrationFnResult > > (
204
- name : string ,
205
- fn : Fn ,
206
- ) : ( ...rest : Parameters < Fn > ) => ReturnType < Fn > & { name : string } {
207
+ function addIdToIntegrationFnResult <
208
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
209
+ Fn extends ( ... rest : any [ ] ) => Partial < IntegrationFnResult > ,
210
+ > ( name : string , fn : Fn ) : ( ...rest : Parameters < Fn > ) => ReturnType < Fn > & { name : string } {
207
211
const patchedFn = ( ...rest : Parameters < Fn > ) : ReturnType < Fn > & { name : string } => {
208
212
return { ...fn ( ...rest ) , name } as ReturnType < Fn > & { name : string } ;
209
213
} ;
0 commit comments