diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/platform')
-rw-r--r-- | packages/taler-wallet-webextension/src/platform/api.ts | 31 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/platform/firefox.ts | 2 |
2 files changed, 30 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/api.ts b/packages/taler-wallet-webextension/src/platform/api.ts index f87500c4f..f8fa0a848 100644 --- a/packages/taler-wallet-webextension/src/platform/api.ts +++ b/packages/taler-wallet-webextension/src/platform/api.ts @@ -15,7 +15,11 @@ */ import { CoreApiResponse, NotificationType } from "@gnu-taler/taler-util"; -import { WalletOperations } from "@gnu-taler/taler-wallet-core"; +import { + WalletConfig, + WalletConfigParameter, + WalletOperations, +} from "@gnu-taler/taler-wallet-core"; import { BackgroundOperations } from "../wxApi.js"; import { ExtensionOperations, @@ -87,12 +91,35 @@ export interface WalletWebExVersion { version: string; } -export interface Settings { +type F = WalletConfig["features"]; +type kf = keyof F; +type WebexWalletConfig = { + [P in keyof F as `wallet${Capitalize<P>}`]: F[P]; +}; + +export interface Settings extends WebexWalletConfig { injectTalerSupport: boolean; + advanceMode: boolean; + backup: boolean; + langSelector: boolean; + showJsonOnError: boolean; + extendedAccountTypes: boolean; + //WORKAROUND + //Able to delete tx in dev mode + //FIXME: remove this when DD37 is implemented + deleteActiveTransactions: boolean; } export const defaultSettings: Settings = { injectTalerSupport: false, + advanceMode: false, + backup: false, + langSelector: false, + deleteActiveTransactions: false, + showJsonOnError: false, + extendedAccountTypes: false, + walletAllowHttp: false, + walletBatchWithdrawal: false, }; /** diff --git a/packages/taler-wallet-webextension/src/platform/firefox.ts b/packages/taler-wallet-webextension/src/platform/firefox.ts index 01848e1ab..9f666e7ae 100644 --- a/packages/taler-wallet-webextension/src/platform/firefox.ts +++ b/packages/taler-wallet-webextension/src/platform/firefox.ts @@ -45,7 +45,7 @@ function isFirefox(): boolean { } function addPermissionsListener(callback: (p: Permissions) => void): void { - console.log("addPermissionListener is not supported for Firefox"); + throw Error("addPermissionListener is not supported for Firefox"); } function getPermissionsApi(): CrossBrowserPermissionsApi { |