1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

add typings for timeouts and window objects

This commit is contained in:
Kyle Spearrin 2018-01-11 14:16:38 -05:00
parent e2267d29a3
commit 2f5a1f470a
10 changed files with 14 additions and 14 deletions

View File

@ -21,9 +21,9 @@ export class CurrentController {
constructor($scope: any, private cipherService: any, constructor($scope: any, private cipherService: any,
private platformUtilsService: PlatformUtilsService, private platformUtilsService: PlatformUtilsService,
private utilsService: UtilsService, private toastr: any, private $window: any, private $state: any, private utilsService: UtilsService, private toastr: any, private $window: ng.IWindowService,
private $timeout: any, private autofillService: any, private $analytics: any, private i18nService: any, private $state: any, private $timeout: ng.ITimeoutService, private autofillService: any,
private $filter: any) { private $analytics: any, private i18nService: any, private $filter: any) {
this.i18n = i18nService; this.i18n = i18nService;
this.inSidebar = platformUtilsService.inSidebar($window); this.inSidebar = platformUtilsService.inSidebar($window);
this.disableSearch = platformUtilsService.isEdge(); this.disableSearch = platformUtilsService.isEdge();

View File

@ -6,7 +6,7 @@ export class MainController implements ng.IController {
animation: string; animation: string;
constructor($scope: any, $transitions: any, $state: any, authService: any, toastr: any, 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.animation = '';
this.xsBody = $window.screen.availHeight < 600; this.xsBody = $window.screen.availHeight < 600;
this.smBody = !this.xsBody && $window.screen.availHeight <= 800; this.smBody = !this.xsBody && $window.screen.availHeight <= 800;

View File

@ -9,7 +9,7 @@ export class LockController {
i18n: any; i18n: any;
masterPassword: string; 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, private platformUtilsService: PlatformUtilsService,
public cryptoService: CryptoService, public toastr: any, public userService: any, public cryptoService: CryptoService, public toastr: any, public userService: any,
public messagingService: MessagingService, public SweetAlert: any) { public messagingService: MessagingService, public SweetAlert: any) {

View File

@ -5,7 +5,7 @@ export class AboutController {
year: number; year: number;
i18n: any; i18n: any;
constructor(i18nService: any) { constructor(private i18nService: any) {
this.i18n = i18nService; this.i18n = i18nService;
this.year = (new Date()).getFullYear(); this.year = (new Date()).getFullYear();
this.version = chrome.runtime.getManifest().version; this.version = chrome.runtime.getManifest().version;

View File

@ -3,7 +3,7 @@ import * as template from './credits.component.html';
export class CreditsController { export class CreditsController {
i18n: any; i18n: any;
constructor(i18nService: any, private $analytics: any) { constructor(private i18nService: any, private $analytics: any) {
this.i18n = i18nService; this.i18n = i18nService;
} }

View File

@ -12,7 +12,7 @@ export class AddFolderController {
constructor(private folderService: any, private $state: any, private toastr: any, constructor(private folderService: any, private $state: any, private toastr: any,
platformUtilsService: PlatformUtilsService, private $analytics: any, private i18nService: any, platformUtilsService: PlatformUtilsService, private $analytics: any, private i18nService: any,
$timeout: any) { $timeout: ng.ITimeoutService) {
$timeout(() => { $timeout(() => {
platformUtilsService.initListSectionItemListeners(document, angular); platformUtilsService.initListSectionItemListeners(document, angular);
document.getElementById('name').focus(); document.getElementById('name').focus();

View File

@ -14,7 +14,7 @@ export class EditFolderController {
constructor($scope: any, $stateParams: any, private folderService: any, private toastr: any, private $state: any, constructor($scope: any, $stateParams: any, private folderService: any, private toastr: any, private $state: any,
private SweetAlert: any, platformUtilsService: PlatformUtilsService, private $analytics: any, private SweetAlert: any, platformUtilsService: PlatformUtilsService, private $analytics: any,
private i18nService: any, $timeout: any) { private i18nService: any, $timeout: ng.ITimeoutService) {
this.i18n = i18nService; this.i18n = i18nService;
$timeout(() => { $timeout(() => {

View File

@ -6,7 +6,7 @@ export class PremiumController {
price = '$10'; price = '$10';
constructor(private i18nService: any, private tokenService: any, private apiService: any, private toastr: any, 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.i18n = i18nService;
this.isPremium = tokenService.getPremium(); this.isPremium = tokenService.getPremium();
} }

View File

@ -14,7 +14,7 @@ export class ExportController {
constructor(private $state: any, private cryptoService: CryptoService, constructor(private $state: any, private cryptoService: CryptoService,
private toastr: any, private utilsService: UtilsService, private $analytics: any, private toastr: any, private utilsService: UtilsService, private $analytics: any,
private i18nService: any, private folderService: any, private cipherService: 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; this.i18n = i18nService;
} }
@ -128,7 +128,7 @@ export class ExportController {
} }
private downloadFile(csv: string): void { private downloadFile(csv: string): void {
const csvBlob = new Blob([csv]); const csvBlob = new Blob([csv], { type: 'text/plain' });
const fileName = this.makeFileName(); const fileName = this.makeFileName();
if (this.$window.navigator.msSaveOrOpenBlob) { if (this.$window.navigator.msSaveOrOpenBlob) {
@ -138,7 +138,7 @@ export class ExportController {
this.$window.navigator.msSaveBlob(csvBlob, fileName); this.$window.navigator.msSaveBlob(csvBlob, fileName);
} else { } else {
const a = this.$window.document.createElement('a'); 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; a.download = fileName;
this.$window.document.body.appendChild(a); this.$window.document.body.appendChild(a);
a.click(); a.click();

View File

@ -14,7 +14,7 @@ export class PasswordGeneratorController {
constructor(private $state: any, private passwordGenerationService: any, constructor(private $state: any, private passwordGenerationService: any,
private toastr: any, private platformUtilsService: PlatformUtilsService, 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; this.i18n = i18nService;
passwordGenerationService.getOptions().then((options: any) => { passwordGenerationService.getOptions().then((options: any) => {