From 32c45e472366160d0bf8cae076c729f4a8112044 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Wed, 6 Nov 2024 16:14:42 +0100 Subject: [PATCH 1/2] fix ts3.8 type check test --- dev-packages/type-check/ts3.8-test/index.ts | 23 +++++++++++++++++++ .../type-check/ts3.8-test/package.json | 2 +- .../type-check/ts3.8-test/tsconfig.build.json | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/dev-packages/type-check/ts3.8-test/index.ts b/dev-packages/type-check/ts3.8-test/index.ts index cbad1c30a0..37d79a049d 100644 --- a/dev-packages/type-check/ts3.8-test/index.ts +++ b/dev-packages/type-check/ts3.8-test/index.ts @@ -1,2 +1,25 @@ +declare global { + interface History {} + interface IDBObjectStore {} + interface Window { + fetch: any; + } + interface ShadowRoot {} + interface BufferSource {} + interface PerformanceResourceTiming { + decodedBodySize: any; + encodedBodySize: any; + duration: any; + domInteractive: any; + domContentLoadedEventEnd: any; + domContentLoadedEventStart: any; + loadEventStart: any; + loadEventEnd: number; + domComplete: number; + redirectCount: number; + } + interface PerformanceEntry {} +} + // we need to import the SDK to ensure tsc check the types import * as _Sentry from '@sentry/react-native'; diff --git a/dev-packages/type-check/ts3.8-test/package.json b/dev-packages/type-check/ts3.8-test/package.json index 5d6bcbdbe3..daf8ea0be0 100644 --- a/dev-packages/type-check/ts3.8-test/package.json +++ b/dev-packages/type-check/ts3.8-test/package.json @@ -9,7 +9,7 @@ }, "license": "MIT", "devDependencies": { - "@types/react": "17.0.58", + "@types/react": "17.0.83", "@types/react-native": "0.65.30", "typescript": "3.8.3" }, diff --git a/dev-packages/type-check/ts3.8-test/tsconfig.build.json b/dev-packages/type-check/ts3.8-test/tsconfig.build.json index f3d299fc98..28d4363cb9 100644 --- a/dev-packages/type-check/ts3.8-test/tsconfig.build.json +++ b/dev-packages/type-check/ts3.8-test/tsconfig.build.json @@ -5,7 +5,9 @@ "compilerOptions": { "skipLibCheck": false, "noEmit": true, + "importHelpers": true, "types": [], + "lib": ["es2015"], "jsx": "react-native", "target": "es6", "moduleResolution": "node", From 5315bb23bc67d280a2c2bb8670029a2682dd741f Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Wed, 6 Nov 2024 17:02:25 +0100 Subject: [PATCH 2/2] fix missing react native types --- dev-packages/type-check/ts3.8-test/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-packages/type-check/ts3.8-test/index.ts b/dev-packages/type-check/ts3.8-test/index.ts index 37d79a049d..6f1ec6d6cc 100644 --- a/dev-packages/type-check/ts3.8-test/index.ts +++ b/dev-packages/type-check/ts3.8-test/index.ts @@ -20,6 +20,7 @@ declare global { } interface PerformanceEntry {} } +import 'react-native'; // we need to import the SDK to ensure tsc check the types import * as _Sentry from '@sentry/react-native';