mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
Improve globals for runtime type library
This commit is contained in:
parent
c4bddc4651
commit
64f0dfd50e
5 changed files with 53 additions and 72 deletions
|
@ -1,19 +1,19 @@
|
|||
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
||||
import * as blob from "./blob";
|
||||
import * as console from "./console";
|
||||
import * as console_ from "./console";
|
||||
import * as fetch_ from "./fetch";
|
||||
import { globalEval } from "./global_eval";
|
||||
import { libdeno } from "./libdeno";
|
||||
import * as textEncoding from "./text_encoding";
|
||||
import * as timers from "./timers";
|
||||
import * as urlsearchparams from "./url_search_params";
|
||||
import * as urlSearchParams from "./url_search_params";
|
||||
|
||||
// During the build process, augmentations to the variable `window` in this
|
||||
// file are tracked and created as part of default library that is built into
|
||||
// deno, we only need to declare the enough to compile deno.
|
||||
|
||||
declare global {
|
||||
const console: console.Console;
|
||||
const console: console_.Console;
|
||||
const setTimeout: typeof timers.setTimeout;
|
||||
// tslint:disable-next-line:variable-name
|
||||
const TextEncoder: typeof textEncoding.TextEncoder;
|
||||
|
@ -28,13 +28,13 @@ window.setInterval = timers.setInterval;
|
|||
window.clearTimeout = timers.clearTimer;
|
||||
window.clearInterval = timers.clearTimer;
|
||||
|
||||
window.console = new console.Console(libdeno.print);
|
||||
window.console = new console_.Console(libdeno.print);
|
||||
window.TextEncoder = textEncoding.TextEncoder;
|
||||
window.TextDecoder = textEncoding.TextDecoder;
|
||||
window.atob = textEncoding.atob;
|
||||
window.btoa = textEncoding.btoa;
|
||||
|
||||
window.URLSearchParams = urlsearchparams.URLSearchParams;
|
||||
window.URLSearchParams = urlSearchParams.URLSearchParams;
|
||||
|
||||
window.fetch = fetch_.fetch;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue