Skip to content

Commit 785d712

Browse files
committed
fix types...
1 parent d51f0be commit 785d712

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/core/src/integration.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,6 @@ function findIndex<T>(arr: T[], callback: (item: T) => boolean): number {
166166
return -1;
167167
}
168168

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-
175169
/**
176170
* Convert a new integration function to the legacy class syntax.
177171
* In v8, we can remove this and instead export the integration functions directly.
@@ -181,7 +175,11 @@ interface IntegrationWithoutSetupOnce extends Integration {
181175
export function convertIntegrationFnToClass<Fn extends IntegrationFn>(
182176
name: string,
183177
fn: Fn,
184-
): IntegrationClass<IntegrationWithoutSetupOnce> {
178+
): IntegrationClass<
179+
Integration & {
180+
setupOnce: (addGlobalEventProcessor?: (callback: EventProcessor) => void, getCurrentHub?: () => Hub) => void;
181+
}
182+
> {
185183
return Object.assign(
186184
// eslint-disable-next-line @typescript-eslint/no-explicit-any
187185
function ConvertedIntegration(...rest: any[]) {
@@ -192,5 +190,9 @@ export function convertIntegrationFnToClass<Fn extends IntegrationFn>(
192190
};
193191
},
194192
{ 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+
>;
196198
}

0 commit comments

Comments
 (0)