From 2f5a1f470a4fb4dd1ddf73c0aadea3db8b49c5b9 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 11 Jan 2018 14:16:38 -0500 Subject: [PATCH] add typings for timeouts and window objects --- src/popup/app/current/current.component.ts | 6 +++--- src/popup/app/global/main.controller.ts | 2 +- src/popup/app/lock/lock.component.ts | 2 +- src/popup/app/settings/about.component.ts | 2 +- src/popup/app/settings/credits.component.ts | 2 +- src/popup/app/settings/folders/add-folder.component.ts | 2 +- src/popup/app/settings/folders/edit-folder.component.ts | 2 +- src/popup/app/settings/premium.component.ts | 2 +- src/popup/app/tools/export.component.ts | 6 +++--- src/popup/app/tools/password-generator.component.ts | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/popup/app/current/current.component.ts b/src/popup/app/current/current.component.ts index 20daff5704..35d60eb9f9 100644 --- a/src/popup/app/current/current.component.ts +++ b/src/popup/app/current/current.component.ts @@ -21,9 +21,9 @@ export class CurrentController { constructor($scope: any, private cipherService: any, private platformUtilsService: PlatformUtilsService, - private utilsService: UtilsService, private toastr: any, private $window: any, private $state: any, - private $timeout: any, private autofillService: any, private $analytics: any, private i18nService: any, - private $filter: any) { + private utilsService: UtilsService, private toastr: any, private $window: ng.IWindowService, + private $state: any, private $timeout: ng.ITimeoutService, private autofillService: any, + private $analytics: any, private i18nService: any, private $filter: any) { this.i18n = i18nService; this.inSidebar = platformUtilsService.inSidebar($window); this.disableSearch = platformUtilsService.isEdge(); diff --git a/src/popup/app/global/main.controller.ts b/src/popup/app/global/main.controller.ts index 97b2e6b68a..defeaed0f7 100644 --- a/src/popup/app/global/main.controller.ts +++ b/src/popup/app/global/main.controller.ts @@ -6,7 +6,7 @@ export class MainController implements ng.IController { animation: string; constructor($scope: any, $transitions: any, $state: any, authService: any, toastr: any, - i18nService: any, $analytics: any, utilsService: UtilsService, $window: any) { + i18nService: any, $analytics: any, utilsService: UtilsService, $window: ng.IWindowService) { this.animation = ''; this.xsBody = $window.screen.availHeight < 600; this.smBody = !this.xsBody && $window.screen.availHeight <= 800; diff --git a/src/popup/app/lock/lock.component.ts b/src/popup/app/lock/lock.component.ts index 0314dfb776..b3fa7ede36 100644 --- a/src/popup/app/lock/lock.component.ts +++ b/src/popup/app/lock/lock.component.ts @@ -9,7 +9,7 @@ export class LockController { i18n: any; masterPassword: string; - constructor(public $state: any, public i18nService: any, private $timeout: any, + constructor(public $state: any, public i18nService: any, private $timeout: ng.ITimeoutService, private platformUtilsService: PlatformUtilsService, public cryptoService: CryptoService, public toastr: any, public userService: any, public messagingService: MessagingService, public SweetAlert: any) { diff --git a/src/popup/app/settings/about.component.ts b/src/popup/app/settings/about.component.ts index 9098e40a12..f5a4dfa43a 100644 --- a/src/popup/app/settings/about.component.ts +++ b/src/popup/app/settings/about.component.ts @@ -5,7 +5,7 @@ export class AboutController { year: number; i18n: any; - constructor(i18nService: any) { + constructor(private i18nService: any) { this.i18n = i18nService; this.year = (new Date()).getFullYear(); this.version = chrome.runtime.getManifest().version; diff --git a/src/popup/app/settings/credits.component.ts b/src/popup/app/settings/credits.component.ts index aab107787c..ec170b17d0 100644 --- a/src/popup/app/settings/credits.component.ts +++ b/src/popup/app/settings/credits.component.ts @@ -3,7 +3,7 @@ import * as template from './credits.component.html'; export class CreditsController { i18n: any; - constructor(i18nService: any, private $analytics: any) { + constructor(private i18nService: any, private $analytics: any) { this.i18n = i18nService; } diff --git a/src/popup/app/settings/folders/add-folder.component.ts b/src/popup/app/settings/folders/add-folder.component.ts index b44f9537ea..50a8292bc2 100644 --- a/src/popup/app/settings/folders/add-folder.component.ts +++ b/src/popup/app/settings/folders/add-folder.component.ts @@ -12,7 +12,7 @@ export class AddFolderController { constructor(private folderService: any, private $state: any, private toastr: any, platformUtilsService: PlatformUtilsService, private $analytics: any, private i18nService: any, - $timeout: any) { + $timeout: ng.ITimeoutService) { $timeout(() => { platformUtilsService.initListSectionItemListeners(document, angular); document.getElementById('name').focus(); diff --git a/src/popup/app/settings/folders/edit-folder.component.ts b/src/popup/app/settings/folders/edit-folder.component.ts index ee81b5f284..6d401caa19 100644 --- a/src/popup/app/settings/folders/edit-folder.component.ts +++ b/src/popup/app/settings/folders/edit-folder.component.ts @@ -14,7 +14,7 @@ export class EditFolderController { constructor($scope: any, $stateParams: any, private folderService: any, private toastr: any, private $state: any, private SweetAlert: any, platformUtilsService: PlatformUtilsService, private $analytics: any, - private i18nService: any, $timeout: any) { + private i18nService: any, $timeout: ng.ITimeoutService) { this.i18n = i18nService; $timeout(() => { diff --git a/src/popup/app/settings/premium.component.ts b/src/popup/app/settings/premium.component.ts index 94e2da4adb..2d312bcbec 100644 --- a/src/popup/app/settings/premium.component.ts +++ b/src/popup/app/settings/premium.component.ts @@ -6,7 +6,7 @@ export class PremiumController { price = '$10'; constructor(private i18nService: any, private tokenService: any, private apiService: any, private toastr: any, - private SweetAlert: any, private $analytics: any, private $timeout: any) { + private SweetAlert: any, private $analytics: any, private $timeout: ng.ITimeoutService) { this.i18n = i18nService; this.isPremium = tokenService.getPremium(); } diff --git a/src/popup/app/tools/export.component.ts b/src/popup/app/tools/export.component.ts index 59bbff203e..3898ebfa7a 100644 --- a/src/popup/app/tools/export.component.ts +++ b/src/popup/app/tools/export.component.ts @@ -14,7 +14,7 @@ export class ExportController { constructor(private $state: any, private cryptoService: CryptoService, private toastr: any, private utilsService: UtilsService, private $analytics: any, private i18nService: any, private folderService: any, private cipherService: any, - private $window: any, private userService: any) { + private $window: ng.IWindowService, private userService: any) { this.i18n = i18nService; } @@ -128,7 +128,7 @@ export class ExportController { } private downloadFile(csv: string): void { - const csvBlob = new Blob([csv]); + const csvBlob = new Blob([csv], { type: 'text/plain' }); const fileName = this.makeFileName(); if (this.$window.navigator.msSaveOrOpenBlob) { @@ -138,7 +138,7 @@ export class ExportController { this.$window.navigator.msSaveBlob(csvBlob, fileName); } else { const a = this.$window.document.createElement('a'); - a.href = this.$window.URL.createObjectURL(csvBlob, { type: 'text/plain' }); + a.href = this.$window.URL.createObjectURL(csvBlob); a.download = fileName; this.$window.document.body.appendChild(a); a.click(); diff --git a/src/popup/app/tools/password-generator.component.ts b/src/popup/app/tools/password-generator.component.ts index 0f80cf9e37..ca1596f88e 100644 --- a/src/popup/app/tools/password-generator.component.ts +++ b/src/popup/app/tools/password-generator.component.ts @@ -14,7 +14,7 @@ export class PasswordGeneratorController { constructor(private $state: any, private passwordGenerationService: any, private toastr: any, private platformUtilsService: PlatformUtilsService, - private $analytics: any, private i18nService: any, private $timeout: any) { + private $analytics: any, private i18nService: any, private $timeout: ng.ITimeoutService) { this.i18n = i18nService; passwordGenerationService.getOptions().then((options: any) => {