From 5a4b8143b2a1b02ec7805af8b760b8f22433c6cd Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Tue, 3 Sep 2019 18:16:33 +0200 Subject: [PATCH] Remove some any-types --- lib/manager/man.ts | 6 +++++- lib/manager/port.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/manager/man.ts b/lib/manager/man.ts index 34efcb4..6e8a013 100644 --- a/lib/manager/man.ts +++ b/lib/manager/man.ts @@ -29,7 +29,7 @@ const RELOAD_TIMEOUT = 10 * 1000; export class Manager extends EventEmitter { private items: Download[]; - private active: boolean; + public active: boolean; private notifiedFinished: boolean; @@ -361,6 +361,10 @@ export class Manager extends EventEmitter { } this.emit("active", this.active); } + + getMsgItems() { + return this.items.map(e => e.toMsg()); + } } let inited: Promise; diff --git a/lib/manager/port.ts b/lib/manager/port.ts index 98b52d1..7a50148 100644 --- a/lib/manager/port.ts +++ b/lib/manager/port.ts @@ -5,6 +5,10 @@ import { donate, openPrefs } from "../windowutils"; import { API } from "../api"; // eslint-disable-next-line no-unused-vars import { BaseDownload } from "./basedownload"; +// eslint-disable-next-line no-unused-vars +import { Manager } from "./man"; +// eslint-disable-next-line no-unused-vars +import { Port } from "../bus"; type SID = {sid: number}; type SIDS = { @@ -13,9 +17,9 @@ type SIDS = { }; export class ManagerPort { - private manager: any; + private manager: Manager; - private port: any; + private port: Port; constructor(manager: any, port: any) { this.manager = manager; @@ -79,7 +83,6 @@ export class ManagerPort { } sendAll() { - this.port.post( - "all", this.manager.items.map((e: BaseDownload) => e.toMsg())); + this.port.post("all", this.manager.getMsgItems()); } }