From d231df17b071f74bbcf5b600ee1fbf5152144397 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 13 Sep 2019 07:30:04 +1000 Subject: deno_typescript cleanup/improvements (#2901) --- js/compiler.ts | 3 +-- js/diagnostics.ts | 2 -- js/ts_global.d.ts | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 js/ts_global.d.ts (limited to 'js') 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 -/// - 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. -/// - /** 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_; + } +} -- cgit v1.2.3