summaryrefslogtreecommitdiff
path: root/js/lib.deno.d.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-07-27 16:51:19 +1000
committerRyan Dahl <ry@tinyclouds.org>2018-07-31 20:47:49 -0400
commit36fa1cea4a6c7c4ae5ac93974843fcdcd4557fef (patch)
tree785284c625e59ecaf13b1bf9c211354bb3d206c0 /js/lib.deno.d.ts
parentb44c235579ac9fbef14d4d33e21f266d0a2ff73e (diff)
Upgrade TypeScript (3.0.1)
Update runtime to use lib.deno.d.ts Add proper console declaration Upgrade prettier (There was an issue formatting lib.deno.d.ts)
Diffstat (limited to 'js/lib.deno.d.ts')
-rw-r--r--js/lib.deno.d.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/lib.deno.d.ts b/js/lib.deno.d.ts
new file mode 100644
index 000000000..fd337abb0
--- /dev/null
+++ b/js/lib.deno.d.ts
@@ -0,0 +1,34 @@
+// 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;
+}
+
+// Globals in the runtime environment
+declare let console: Console;
+declare const window: Window;