From 806385543c8367b9acca4d3dcb24945cc4de2ef2 Mon Sep 17 00:00:00 2001 From: Parsa Ghadimi Date: Mon, 10 Sep 2018 14:57:08 +0430 Subject: Improve global types --- js/globals.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/js/globals.ts b/js/globals.ts index b90aa46eb..cd29d34c7 100644 --- a/js/globals.ts +++ b/js/globals.ts @@ -9,8 +9,20 @@ import { globalEval } from "./global-eval"; declare global { interface Window { - console: Console; define: Readonly; + + clearTimeout: typeof clearTimeout; + clearInterval: typeof clearInterval; + setTimeout: typeof setTimeout; + setInterval: typeof setInterval; + + console: typeof console; + window: typeof window; + + fetch: typeof fetch; + + TextEncoder: typeof TextEncoder; + TextDecoder: typeof TextDecoder; } const clearTimeout: typeof timers.clearTimer; @@ -24,8 +36,8 @@ declare global { const fetch: typeof fetch_.fetch; // tslint:disable:variable-name - let TextEncoder: typeof textEncoding.TextEncoder; - let TextDecoder: typeof textEncoding.TextDecoder; + const TextEncoder: typeof textEncoding.TextEncoder; + const TextDecoder: typeof textEncoding.TextDecoder; // tslint:enable:variable-name } -- cgit v1.2.3