1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

[TypeScript] Popup app services (#353)

* Convert services to typescript.

* Change to for of.
This commit is contained in:
Oscar Hinton
2017-11-03 20:53:35 +01:00
committed by Kyle Spearrin
parent 58bf65168e
commit cee9face7f
9 changed files with 169 additions and 213 deletions

View File

@@ -0,0 +1,24 @@
function getBackgroundService(service: string) {
return () => {
const page = chrome.extension.getBackgroundPage();
return page ? page['bg_' + service] : null;
};
}
export const tokenService = getBackgroundService('tokenService');
export const cryptoService = getBackgroundService('cryptoService');
export const userService = getBackgroundService('userService');
export const apiService = getBackgroundService('apiService');
export const folderService = getBackgroundService('folderService');
export const cipherService = getBackgroundService('cipherService');
export const syncService = getBackgroundService('syncService');
export const autofillService = getBackgroundService('autofillService');
export const passwordGenerationService = getBackgroundService('passwordGenerationService');
export const utilsService = getBackgroundService('utilsService');
export const appIdService = getBackgroundService('appIdService');
export const i18nService = getBackgroundService('i18nService');
export const constantsService = getBackgroundService('constantsService');
export const settingsService = getBackgroundService('settingsService');
export const lockService = getBackgroundService('lockService');
export const totpService = getBackgroundService('totpService');
export const environmentService = getBackgroundService('environmentService');