From cccf32cdf8a94d7edfa4af058359baa3464be22a Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 16 May 2024 17:00:58 +0200 Subject: [PATCH] fix: Do not leak global declared types into distribution bundle Signed-off-by: Ferdinand Thiessen --- lib/LoggerBuilder.ts | 9 --------- lib/global.d.ts | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 lib/global.d.ts diff --git a/lib/LoggerBuilder.ts b/lib/LoggerBuilder.ts index 65c09107..ee59563b 100644 --- a/lib/LoggerBuilder.ts +++ b/lib/LoggerBuilder.ts @@ -1,15 +1,6 @@ import { getCurrentUser } from '@nextcloud/auth' import { IContext, ILogger, ILoggerFactory, LogLevel } from './contracts' -declare global { - interface Window { - _oc_config: { - loglevel: LogLevel, - }, - _oc_debug: boolean, - } -} - /** * @notExported */ diff --git a/lib/global.d.ts b/lib/global.d.ts new file mode 100644 index 00000000..b2fe6c46 --- /dev/null +++ b/lib/global.d.ts @@ -0,0 +1,17 @@ +/** + * SPDX-FileCopyrightText: 2024 Ferdinand Thiessen + * SPDX-License-Identifier: GPL-3.0-or-later or LGPL-3.0-or-later + */ + +import type { LogLevel } from './contracts' + +declare global { + interface Window { + _oc_config: { + loglevel: LogLevel, + }, + _oc_debug: boolean, + } +} + +export {}