File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,6 @@ function findIndex<T>(arr: T[], callback: (item: T) => boolean): number {
166
166
return - 1 ;
167
167
}
168
168
169
- // We want to ensure that any Integration Class generated by `convertIntegrationFnToClass`
170
- // can be called with or without setupOnce arguments.
171
- interface IntegrationWithoutSetupOnce extends Integration {
172
- setupOnce : ( addGlobalEventProcessor ?: ( callback : EventProcessor ) => void , getCurrentHub ?: ( ) => Hub ) => void ;
173
- }
174
-
175
169
/**
176
170
* Convert a new integration function to the legacy class syntax.
177
171
* In v8, we can remove this and instead export the integration functions directly.
@@ -181,7 +175,11 @@ interface IntegrationWithoutSetupOnce extends Integration {
181
175
export function convertIntegrationFnToClass < Fn extends IntegrationFn > (
182
176
name : string ,
183
177
fn : Fn ,
184
- ) : IntegrationClass < IntegrationWithoutSetupOnce > {
178
+ ) : IntegrationClass <
179
+ Integration & {
180
+ setupOnce : ( addGlobalEventProcessor ?: ( callback : EventProcessor ) => void , getCurrentHub ?: ( ) => Hub ) => void ;
181
+ }
182
+ > {
185
183
return Object . assign (
186
184
// eslint-disable-next-line @typescript-eslint/no-explicit-any
187
185
function ConvertedIntegration ( ...rest : any [ ] ) {
@@ -192,5 +190,9 @@ export function convertIntegrationFnToClass<Fn extends IntegrationFn>(
192
190
} ;
193
191
} ,
194
192
{ id : name } ,
195
- ) as unknown as IntegrationClass < IntegrationWithoutSetupOnce > ;
193
+ ) as unknown as IntegrationClass <
194
+ Integration & {
195
+ setupOnce : ( addGlobalEventProcessor ?: ( callback : EventProcessor ) => void , getCurrentHub ?: ( ) => Hub ) => void ;
196
+ }
197
+ > ;
196
198
}
You can’t perform that action at this time.
0 commit comments