mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ec2ab1eb8d
						
					
				
				
					commit
					f1a0a790fe
				
			
							
								
								
									
										4
									
								
								static/js/global.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								static/js/global.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -8,3 +8,7 @@ declare let zulip_test: any;
 | 
			
		||||
interface JQuery {
 | 
			
		||||
    expectOne(): JQuery;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface Window {
 | 
			
		||||
    page_params_parse_time: number;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
@@ -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",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user