From 1dd386a65abd0498897ae4f54be3188780d00e28 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 16 Nov 2023 14:28:03 -0800 Subject: [PATCH] tippyjs: Convert module to TypeScript. Signed-off-by: Anders Kaseorg --- tools/test-js-with-node | 2 +- web/src/{tippyjs.js => tippyjs.ts} | 70 ++++++++++++++++-------------- 2 files changed, 39 insertions(+), 33 deletions(-) rename web/src/{tippyjs.js => tippyjs.ts} (89%) diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 28fcb5d6b9..ef41588df8 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -239,7 +239,7 @@ EXEMPT_FILES = make_set( "web/src/submessage.js", "web/src/subscriber_api.js", "web/src/timerender.ts", - "web/src/tippyjs.js", + "web/src/tippyjs.ts", "web/src/todo_widget.js", "web/src/topic_list.js", "web/src/topic_popover.js", diff --git a/web/src/tippyjs.js b/web/src/tippyjs.ts similarity index 89% rename from web/src/tippyjs.js rename to web/src/tippyjs.ts index f7e4c2cc83..50c4217099 100644 --- a/web/src/tippyjs.js +++ b/web/src/tippyjs.ts @@ -1,4 +1,5 @@ import $ from "jquery"; +import assert from "minimalistic-assert"; import tippy, {delegate} from "tippy.js"; import render_tooltip_templates from "../templates/tooltip_templates.hbs"; @@ -8,12 +9,16 @@ import {user_settings} from "./user_settings"; // For tooltips without data-tippy-content, we use the HTML content of // a