summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/compiler.ts3
-rw-r--r--js/diagnostics.ts2
-rw-r--r--js/ts_global.d.ts14
3 files changed, 15 insertions, 4 deletions
diff --git a/js/compiler.ts b/js/compiler.ts
index 12062e63f..41f23bcd2 100644
--- a/js/compiler.ts
+++ b/js/compiler.ts
@@ -1,9 +1,8 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// TODO(ry) Combine this implementation with //deno_typescript/compiler_main.js
-/// <reference types="../third_party/node_modules/typescript/lib/typescript.d.ts"/>
-
import "./globals.ts";
+import "./ts_global.d.ts";
import { bold, cyan, yellow } from "./colors.ts";
import { Console } from "./console.ts";
diff --git a/js/diagnostics.ts b/js/diagnostics.ts
index 5da91483c..c5377f979 100644
--- a/js/diagnostics.ts
+++ b/js/diagnostics.ts
@@ -4,8 +4,6 @@
// compiler, which is strongly influenced by the format of TypeScript
// diagnostics.
-/// <reference types="../third_party/node_modules/typescript/lib/typescript.d.ts"/>
-
/** The log category for a diagnostic message */
export enum DiagnosticCategory {
Log = 0,
diff --git a/js/ts_global.d.ts b/js/ts_global.d.ts
new file mode 100644
index 000000000..d4b027926
--- /dev/null
+++ b/js/ts_global.d.ts
@@ -0,0 +1,14 @@
+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+
+// This scopes the `ts` namespace globally, which is where it exists at runtime
+// when building Deno, but the `typescript/lib/typescript.d.ts` is defined as a
+// module.
+
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+import * as ts_ from "../node_modules/typescript/lib/typescript.d.ts";
+
+declare global {
+ namespace ts {
+ export = ts_;
+ }
+}