From 7192433dd8d6f43b55e428f02c9edbfa678e094f Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 21 Aug 2023 15:59:45 +0200 Subject: [PATCH] fix types --- code/lib/preview/src/runtime.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/lib/preview/src/runtime.ts b/code/lib/preview/src/runtime.ts index a088b4780845..7785e42df8c9 100644 --- a/code/lib/preview/src/runtime.ts +++ b/code/lib/preview/src/runtime.ts @@ -8,22 +8,22 @@ const getKeys = Object.keys as (obj: T) => Array; // Apply all the globals getKeys(globals).forEach((key) => { - (globalThis as any)[globals[key]] = values[key]; + (global as any)[globals[key]] = values[key]; }); -global.sendTelemetryError = (error) => { +global.sendTelemetryError = (error: any) => { const channel = global.__STORYBOOK_ADDONS_CHANNEL__; channel.emit(TELEMETRY_ERROR, error); }; // handle all uncaught StorybookError at the root of the application and log to telemetry if applicable -global.addEventListener('error', (args) => { +global.addEventListener('error', (args: any) => { const error = args.error || args; if (error.fromStorybook) { global.sendTelemetryError(error); } }); -global.addEventListener('unhandledrejection', ({ reason }) => { +global.addEventListener('unhandledrejection', ({ reason }: any) => { if (reason.fromStorybook) { global.sendTelemetryError(reason); }