diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 60f1c0b78e..4a3229a198 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -74,7 +74,7 @@ EXEMPT_FILES = make_set( "web/src/composebox_typeahead.js", "web/src/condense.js", "web/src/confirm_dialog.ts", - "web/src/copied_tooltip.js", + "web/src/copied_tooltip.ts", "web/src/copy_and_paste.js", "web/src/csrf.ts", "web/src/css_variables.js", diff --git a/web/src/copied_tooltip.js b/web/src/copied_tooltip.ts similarity index 78% rename from web/src/copied_tooltip.js rename to web/src/copied_tooltip.ts index ddd88aa722..84af71525f 100644 --- a/web/src/copied_tooltip.js +++ b/web/src/copied_tooltip.ts @@ -2,7 +2,11 @@ import tippy from "tippy.js"; import {$t} from "./i18n"; -export function show_copied_confirmation(copy_button, on_hide_callback, timeout_in_ms = 1000) { +export function show_copied_confirmation( + copy_button: HTMLElement, + on_hide_callback: () => void, + timeout_in_ms = 1000, +): void { // Display a tooltip to notify the user the message or code was copied. const instance = tippy(copy_button, { placement: "top", @@ -18,7 +22,7 @@ export function show_copied_confirmation(copy_button, on_hide_callback, timeout_ }); instance.setContent($t({defaultMessage: "Copied!"})); instance.show(); - function remove_instance() { + function remove_instance(): void { if (!instance.state.isDestroyed) { instance.destroy(); }