Skip to content

Commit

Permalink
Feat: Extend types to allow cookie tables settings
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Jan 2, 2024
1 parent 4b117bd commit 33313ac
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/languages/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
pluralize,
legalizeAlmaCareer,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'a',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import {
isSettingsButtonNotShown,
legalizeAlmaCareer,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'und',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import {
isSettingsButtonNotShown,
legalizeAlmaCareer,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'and',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import {
isSettingsButtonNotShown,
legalizeAlmaCareer,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'és',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
legalizeAlmaCareer,
pluralize,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'i',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
legalizeAlmaCareer,
pluralize,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'и',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/sk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
legalizeAlmaCareer,
pluralize,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'a',
Expand Down
3 changes: 1 addition & 2 deletions src/languages/uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
legalizeAlmaCareer,
pluralize,
} from '../utils';
import { ExtraMessages, Values } from '../types';
import { ExtraMessages, Values, VanillaCookieConsent } from '../types';
import { CookieConsentCategory, SecondaryButtonMode } from '../constants';
import { VanillaCookieConsent } from '../types/vanilla-cookieconsent';

const extra = {
and: 'i',
Expand Down
9 changes: 9 additions & 0 deletions src/types/vanilla-cookieconsent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@ export namespace VanillaCookieConsent {
readonly?: boolean;
}

interface CookieTableItem {
domain?: string;
path?: string;
is_regex?: boolean;
[key: string]: string | boolean | undefined;
}

interface ModalBlock {
title?: string;
description?: string;
toggle?: ModalBlockToggle;
cookie_table?: CookieTableItem[];
}

interface ConsentModal {
Expand All @@ -77,6 +85,7 @@ export namespace VanillaCookieConsent {
accept_all_btn?: string;
reject_all_btn?: string;
save_settings_btn?: string;
cookie_table_headers?: Record<string, string>[];
blocks?: ModalBlock[];
}

Expand Down

0 comments on commit 33313ac

Please sign in to comment.