diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2018-08-07 13:10:18 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-08 04:17:46 -0700 |
commit | 28078cf4412a0951f33d953470c104a2dbe1a21e (patch) | |
tree | 079b178a34ab8708202af0fba3465a321c5d348a /js/lib.globals.d.ts | |
parent | b8e0ce4d1673ccfe862f82b94be354e8f5d3bb2e (diff) |
Rename lib.deno.d.ts to lib.globals.d.ts
Diffstat (limited to 'js/lib.globals.d.ts')
-rw-r--r-- | js/lib.globals.d.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/js/lib.globals.d.ts b/js/lib.globals.d.ts new file mode 100644 index 000000000..b11a08edf --- /dev/null +++ b/js/lib.globals.d.ts @@ -0,0 +1,41 @@ +// Copyright 2018 the Deno authors. All rights reserved. MIT license. + +// This file contains the default TypeScript libraries for the runtime + +/// <reference no-default-lib="true"/> + +/// <reference lib="esnext" /> + +// TODO generate `console.d.ts` and inline it in `assets.ts` and remove +// declaration of `Console` +// import { Console } from 'gen/console'; + +declare class Console { + // tslint:disable-next-line:no-any + log(...args: any[]): void; + // tslint:disable-next-line:no-any + debug(...args: any[]): void; + // tslint:disable-next-line:no-any + info(...args: any[]): void; + // tslint:disable-next-line:no-any + warn(...args: any[]): void; + // tslint:disable-next-line:no-any + error(...args: any[]): void; + // tslint:disable-next-line:no-any + assert(condition: boolean, ...args: any[]): void; +} + +interface Window { + console: Console; + // TODO(ry) These shouldn't be global. + mainSource: string; + setMainSourceMap(sm: string): void; +} + +// Globals in the runtime environment +declare let console: Console; +declare const window: Window; + +// TODO(ry) These shouldn't be global. +declare let mainSource: string; +declare function setMainSourceMap(sm: string): void; |