From 5d3cde376de3764f879926b65f0996c667dfe9c3 Mon Sep 17 00:00:00 2001 From: xiangyu <3170102889@zju.edu.cn> Date: Fri, 6 Jan 2023 12:53:20 +0800 Subject: [PATCH] update: zotero-types 0.1.5 --- package.json | 2 +- src/modules/popup.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 0046937..5393c96 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,6 @@ "esbuild": "^0.16.10", "release-it": "^14.14.3", "replace-in-file": "^6.3.5", - "zotero-types": "^0.1.4" + "zotero-types": "^0.1.5" } } diff --git a/src/modules/popup.ts b/src/modules/popup.ts index ffc07c6..2c2dd77 100644 --- a/src/modules/popup.ts +++ b/src/modules/popup.ts @@ -14,12 +14,12 @@ interface LineOptions { idx?: number; } -// @ts-ignore export class PopupWindow extends Zotero.ProgressWindow { private lines: _ZoteroItemProgress[]; private closeTime: number | undefined; - private originalShow: Function; - public show: typeof this.showWithTimer; + private originalShow: typeof Zotero.ProgressWindow.prototype.show; + // @ts-ignore + public show!: typeof this.showWithTimer; constructor( header: string, @@ -36,17 +36,14 @@ export class PopupWindow extends Zotero.ProgressWindow { this.lines = []; this.closeTime = options.closeTime || 5000; this.changeHeadline(header); - // @ts-ignore - this.originalShow = this.show; + this.originalShow = this + .show as unknown as typeof Zotero.ProgressWindow.prototype.show; this.show = this.showWithTimer; } createLine(options: LineOptions) { const icon = this.getIcon(options.type, options.icon); - const line = new this.ItemProgress( - icon || "", - options.text || "" - ) as _ZoteroItemProgress; + const line = new this.ItemProgress(icon || "", options.text || ""); if (typeof options.progress === "number") { line.setProgress(options.progress); }