import { NeverDomains } from "@bitwarden/common/models/domain/domain-service"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { NotificationQueueMessageTypes } from "../../enums/notification-queue-message-type.enum"; import AutofillPageDetails from "../../models/autofill-page-details"; interface NotificationQueueMessage { type: NotificationQueueMessageTypes; domain: string; tab: chrome.tabs.Tab; expires: Date; wasVaultLocked: boolean; } interface AddChangePasswordQueueMessage extends NotificationQueueMessage { type: "change"; cipherId: string; newPassword: string; } interface AddLoginQueueMessage extends NotificationQueueMessage { type: "add"; username: string; password: string; uri: string; } interface AddUnlockVaultQueueMessage extends NotificationQueueMessage { type: "unlock"; } interface AddRequestFilelessImportQueueMessage extends NotificationQueueMessage { type: "fileless-import"; importType?: string; } type NotificationQueueMessageItem = | AddLoginQueueMessage | AddChangePasswordQueueMessage | AddUnlockVaultQueueMessage | AddRequestFilelessImportQueueMessage; type LockedVaultPendingNotificationsData = { commandToRetry: { message: { command: string; contextMenuOnClickData?: chrome.contextMenus.OnClickData; folder?: string; edit?: boolean; }; sender: chrome.runtime.MessageSender; }; target: string; }; type AdjustNotificationBarMessageData = { height: number; }; type ChangePasswordMessageData = { currentPassword: string; newPassword: string; url: string; }; type AddLoginMessageData = { username: string; password: string; url: string; }; type UnlockVaultMessageData = { skipNotification?: boolean; }; type NotificationBackgroundExtensionMessage = { [key: string]: any; command: string; data?: Partial & Partial & Partial & Partial; login?: AddLoginMessageData; folder?: string; edit?: boolean; details?: AutofillPageDetails; tab?: chrome.tabs.Tab; sender?: string; notificationType?: string; }; type SaveOrUpdateCipherResult = undefined | { error: string }; type BackgroundMessageParam = { message: NotificationBackgroundExtensionMessage }; type BackgroundSenderParam = { sender: chrome.runtime.MessageSender }; type BackgroundOnMessageHandlerParams = BackgroundMessageParam & BackgroundSenderParam; type NotificationBackgroundExtensionMessageHandlers = { [key: string]: CallableFunction; unlockCompleted: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgGetFolderData: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgCloseNotificationBar: ({ sender }: BackgroundSenderParam) => Promise; bgAdjustNotificationBar: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgAddLogin: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgChangedPassword: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgRemoveTabFromNotificationQueue: ({ sender }: BackgroundSenderParam) => void; bgSaveCipher: ({ message, sender }: BackgroundOnMessageHandlerParams) => void; bgNeverSave: ({ sender }: BackgroundSenderParam) => Promise; bgUnlockPopoutOpened: ({ message, sender }: BackgroundOnMessageHandlerParams) => Promise; bgReopenUnlockPopout: ({ sender }: BackgroundSenderParam) => Promise; checkNotificationQueue: ({ sender }: BackgroundSenderParam) => Promise; collectPageDetailsResponse: ({ message }: BackgroundMessageParam) => Promise; bgGetEnableChangedPasswordPrompt: () => Promise; bgGetEnableAddedLoginPrompt: () => Promise; bgGetExcludedDomains: () => Promise; getWebVaultUrlForNotification: () => string; }; export { AddChangePasswordQueueMessage, AddLoginQueueMessage, AddUnlockVaultQueueMessage, AddRequestFilelessImportQueueMessage, NotificationQueueMessageItem, LockedVaultPendingNotificationsData, AdjustNotificationBarMessageData, ChangePasswordMessageData, UnlockVaultMessageData, AddLoginMessageData, SaveOrUpdateCipherResult, NotificationBackgroundExtensionMessage, NotificationBackgroundExtensionMessageHandlers, };