diff options
author | Parsa Ghadimi <me@qti3e.com> | 2018-09-10 14:57:08 +0430 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-11 12:19:44 -0400 |
commit | 806385543c8367b9acca4d3dcb24945cc4de2ef2 (patch) | |
tree | a550c5e7a857759e7ffff4d7d3e7bf29097f9e8a /js | |
parent | 05f87a0cf23a370c0009db8343b3770b518799c8 (diff) |
Improve global types
Diffstat (limited to 'js')
-rw-r--r-- | js/globals.ts | 18 |
1 files 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<unknown>; + + 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 } |