From 24d394a77f7914b6ddf156d7a03d42530dae3025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Litera?= Date: Thu, 3 Mar 2022 10:10:07 +0100 Subject: [PATCH] Fix: Export enums as const for correct transpile into usable object * simple enum cannot be used in plain javascript * @see https://stackoverflow.com/questions/50564756 /exporting-enum-from-typescript-type-definition-file --- src/types/CookieConsentCategory.ts | 2 +- src/types/CookieConsentManager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/CookieConsentCategory.ts b/src/types/CookieConsentCategory.ts index fbd5d043..e332eaca 100644 --- a/src/types/CookieConsentCategory.ts +++ b/src/types/CookieConsentCategory.ts @@ -1,4 +1,4 @@ -export enum CookieConsentCategory { +export const enum CookieConsentCategory { NECESSARY = 'necessary', AD = 'ad', ANALYTICS = 'analytics', diff --git a/src/types/CookieConsentManager.ts b/src/types/CookieConsentManager.ts index 2c2921d4..b995ec05 100644 --- a/src/types/CookieConsentManager.ts +++ b/src/types/CookieConsentManager.ts @@ -14,7 +14,7 @@ export type OnChangeCallback = ( categories: CategoriesChangeset, ) => void; -export enum DisplayMode { +export const enum DisplayMode { FORCE = 'force', SOFT = 'soft', }