diff --git a/src/services/container.service.ts b/src/services/container.service.ts new file mode 100644 index 00000000000..31896d8b401 --- /dev/null +++ b/src/services/container.service.ts @@ -0,0 +1,22 @@ +import { CryptoService } from '../abstractions/crypto.service'; +import { PlatformUtilsService } from '../abstractions/platformUtils.service'; + +export class ContainerService { + constructor(private cryptoService: CryptoService, + private platformUtilsService: PlatformUtilsService) { + } + + attachToWindow(win: any) { + if (!win.BitwardenContainerService) { + win.BitwardenContainerService = this; + } + } + + getCryptoService(): CryptoService { + return this.cryptoService; + } + + getPlatformUtilsService(): PlatformUtilsService { + return this.platformUtilsService; + } +} diff --git a/src/services/index.ts b/src/services/index.ts index a2fae25f3e5..bb199e0e9ca 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -1,6 +1,7 @@ export { ApiService } from './api.service'; export { AppIdService } from './appId.service'; export { ConstantsService } from './constants.service'; +export { ContainerService } from './container.service'; export { CryptoService } from './crypto.service'; export { EnvironmentService } from './environment.service'; export { PasswordGenerationService } from './passwordGeneration.service';