ts: Convert page_params module to TypeScript.

The plan for type annotating the page_params is to set it to
Record<string, unknown> for now and then annotate individual
properties on it as we use it in typescript modules.
This commit is contained in:
Priyank Patel 2021-05-23 23:27:38 +00:00 committed by Tim Abbott
parent ec2ab1eb8d
commit f1a0a790fe
3 changed files with 6 additions and 2 deletions

View File

@ -8,3 +8,7 @@ declare let zulip_test: any;
interface JQuery {
expectOne(): JQuery;
}
interface Window {
page_params_parse_time: number;
}

View File

@ -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) {

View File

@ -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",