Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
ts: Convert page_params module to TypeScript.
Priyank Patelf1a0a790fe57
diff --git a/static/js/global.d.ts b/static/js/global.d.tsindex 6f5b20e2d5d..8e44d286fc5 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.tssimilarity index 66%rename from static/js/page_params.jsrename to static/js/page_params.tsindex 24e03b0e320..1951267535e 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<string, unknown> = $("#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-nodeindex 67352d6a6d5..471d3f627db 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",