From 59d753c1f69147fb131dc1c6e4ea4725246e088b Mon Sep 17 00:00:00 2001 From: Liam Jones Date: Wed, 27 Jul 2022 13:00:07 +0100 Subject: [PATCH] fix(types): Update to support new V7 transport style More information: https://github.com/getsentry/sentry-javascript/blob/7.0.0/MIGRATION.md#custom-transports --- browser.d.ts | 12 ++++++++---- index.d.ts | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/browser.d.ts b/browser.d.ts index f19ebc4..2cc3d8f 100644 --- a/browser.d.ts +++ b/browser.d.ts @@ -64,11 +64,15 @@ declare namespace sentryTestkit { isExist(e: Error): boolean } - export interface TestkitResult { + type V6TransportClass = { + new(): Transport + } + + type V7TransportFunction = () => Transport + + export interface TestkitResult { testkit: Testkit - sentryTransport: { - new (): Transport - } + sentryTransport: Transport initNetworkInterceptor( dsn: string, initCallback: ( diff --git a/index.d.ts b/index.d.ts index ac788e0..3536bd3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -70,11 +70,15 @@ declare namespace sentryTestkit { getDsn: () => string } - export interface TestkitResult { + type V6TransportClass = { + new(): Transport + } + + type V7TransportFunction = () => Transport + + export interface TestkitResult { testkit: Testkit - sentryTransport: { - new (): Transport - } + sentryTransport: Transport initNetworkInterceptor( dsn: string, initCallback: (