diff --git a/static/js/global.d.ts b/static/js/global.d.ts index 6f5b20e2d5..8e44d286fc 100644 --- a/static/js/global.d.ts +++ b/static/js/global.d.ts @@ -8,3 +8,7 @@ declare let zulip_test: any; interface JQuery { expectOne(): JQuery; } + +interface Window { + page_params_parse_time: number; +} diff --git a/static/js/page_params.js b/static/js/page_params.ts similarity index 66% rename from static/js/page_params.js rename to static/js/page_params.ts index 24e03b0e32..1951267535 100644 --- a/static/js/page_params.js +++ b/static/js/page_params.ts @@ -1,7 +1,7 @@ import $ from "jquery"; const t1 = performance.now(); -export const page_params = $("#page-params").remove().data("params"); +export const page_params: Record = $("#page-params").remove().data("params"); const t2 = performance.now(); window.page_params_parse_time = t2 - t1; if (!page_params) { diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 67352d6a6d..471d3f627d 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -99,7 +99,7 @@ EXEMPT_FILES = { "static/js/notifications.js", "static/js/overlays.js", "static/js/padded_widget.js", - "static/js/page_params.js", + "static/js/page_params.ts", "static/js/navbar_alerts.js", "static/js/pm_list_dom.js", "static/js/poll_widget.js",