From 8f643c62e3cf336b8db4c9f22f82ce8b9e24b025 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sat, 22 Feb 2025 18:48:46 +0100 Subject: [PATCH] chore(ts): port of type_widgets/attachment_list --- ...{attachment_list.js => attachment_list.ts} | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) rename src/public/app/widgets/type_widgets/{attachment_list.js => attachment_list.ts} (79%) diff --git a/src/public/app/widgets/type_widgets/attachment_list.js b/src/public/app/widgets/type_widgets/attachment_list.ts similarity index 79% rename from src/public/app/widgets/type_widgets/attachment_list.js rename to src/public/app/widgets/type_widgets/attachment_list.ts index f6eadb97e..3018f784b 100644 --- a/src/public/app/widgets/type_widgets/attachment_list.js +++ b/src/public/app/widgets/type_widgets/attachment_list.ts @@ -3,6 +3,7 @@ import AttachmentDetailWidget from "../attachment_detail.js"; import linkService from "../../services/link.js"; import utils from "../../services/utils.js"; import { t } from "../../services/i18n.js"; +import type { EventData } from "../../components/app_context.js"; const TPL = `
@@ -27,6 +28,10 @@ const TPL = `
`; export default class AttachmentListTypeWidget extends TypeWidget { + $list!: JQuery; + $linksWrapper!: JQuery; + renderedAttachmentIds!: Set; + static getType() { return "attachmentList"; } @@ -39,7 +44,10 @@ export default class AttachmentListTypeWidget extends TypeWidget { super.doRender(); } - async doRefresh(note) { + async doRefresh(note: Parameters[0]) { + // TriliumNextTODO: do we need to handle an undefined/null note? + if (!note) return false; + const $helpButton = $(`