summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/platform/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/platform/api.ts')
-rw-r--r--packages/taler-wallet-webextension/src/platform/api.ts51
1 files changed, 28 insertions, 23 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/api.ts b/packages/taler-wallet-webextension/src/platform/api.ts
index e92903981..3c116fab2 100644
--- a/packages/taler-wallet-webextension/src/platform/api.ts
+++ b/packages/taler-wallet-webextension/src/platform/api.ts
@@ -18,11 +18,9 @@ import {
CoreApiResponse,
TalerUri,
WalletNotification,
- WalletRunConfig
+ WalletRunConfig,
} from "@gnu-taler/taler-util";
-import {
- WalletOperations
-} from "@gnu-taler/taler-wallet-core";
+import { WalletOperations } from "@gnu-taler/taler-wallet-core";
import {
ExtensionOperations,
MessageFromExtension,
@@ -46,11 +44,9 @@ export interface Permissions {
* Compatibility API that works on multiple browsers.
*/
export interface CrossBrowserPermissionsApi {
-
containsClipboardPermissions(): Promise<boolean>;
requestClipboardPermissions(): Promise<boolean>;
removeClipboardPermissions(): Promise<boolean>;
-
}
export enum ExtensionNotificationType {
@@ -67,25 +63,29 @@ export interface ClearNotificaitonNotification {
type: ExtensionNotificationType.ClearNotifications;
}
-export type ExtensionNotification = SettingsChangeNotification | ClearNotificaitonNotification
+export type ExtensionNotification =
+ | SettingsChangeNotification
+ | ClearNotificaitonNotification;
-export type MessageFromBackend = {
- type: "wallet",
- notification: WalletNotification
-} | {
- type: "web-extension",
- notification: ExtensionNotification
-};
+export type MessageFromBackend =
+ | {
+ type: "wallet";
+ notification: WalletNotification;
+ }
+ | {
+ type: "web-extension";
+ notification: ExtensionNotification;
+ };
export type MessageFromFrontend<
Op extends BackgroundOperations | WalletOperations | ExtensionOperations,
> = Op extends BackgroundOperations
? MessageFromFrontendBackground<keyof BackgroundOperations>
: Op extends ExtensionOperations
- ? MessageFromExtension<keyof ExtensionOperations>
- : Op extends WalletOperations
- ? MessageFromFrontendWallet<keyof WalletOperations>
- : never;
+ ? MessageFromExtension<keyof ExtensionOperations>
+ : Op extends WalletOperations
+ ? MessageFromFrontendWallet<keyof WalletOperations>
+ : never;
export type MessageFromFrontendBackground<
Op extends keyof BackgroundOperations,
@@ -109,7 +109,6 @@ export interface WalletWebExVersion {
}
type F = WalletRunConfig["features"];
-type kf = keyof F;
type WebexWalletConfig = {
[P in keyof F as `wallet${Capitalize<P>}`]: F[P];
};
@@ -231,7 +230,13 @@ export interface BackgroundPlatformAPI {
) => Promise<MessageResponse>,
): void;
+ /**
+ * Change web extension Icon
+ */
+ setAlertedIcon(): void;
+ setNormalIcon(): void;
}
+
export interface ForegroundPlatformAPI {
/**
* Check if the extension is running under
@@ -270,7 +275,7 @@ export interface ForegroundPlatformAPI {
/**
* Open a page and close the popup
- * @param url
+ * @param url
*/
openNewURLFromPopup(url: URL): void;
/**
@@ -309,9 +314,9 @@ export interface ForegroundPlatformAPI {
): Promise<MessageResponse>;
/**
- * Used by the wallet frontend to send notification about new information
- * @param message
- */
+ * Used by the wallet frontend to send notification about new information
+ * @param message
+ */
triggerWalletEvent(message: MessageFromBackend): void;
/**