Skip to content

Commit

Permalink
Fix: Export enums as const for correct transpile into usable object
Browse files Browse the repository at this point in the history
  * simple enum cannot be used in plain javascript
  * @see https://stackoverflow.com/questions/50564756
    /exporting-enum-from-typescript-type-definition-file
  • Loading branch information
literat committed Mar 7, 2022
1 parent 7c27935 commit 24d394a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/types/CookieConsentCategory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum CookieConsentCategory {
export const enum CookieConsentCategory {
NECESSARY = 'necessary',
AD = 'ad',
ANALYTICS = 'analytics',
Expand Down
2 changes: 1 addition & 1 deletion src/types/CookieConsentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type OnChangeCallback = (
categories: CategoriesChangeset,
) => void;

export enum DisplayMode {
export const enum DisplayMode {
FORCE = 'force',
SOFT = 'soft',
}
Expand Down

0 comments on commit 24d394a

Please sign in to comment.