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); }