diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2019-09-13 07:30:04 +1000 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-12 17:30:04 -0400 |
commit | d231df17b071f74bbcf5b600ee1fbf5152144397 (patch) | |
tree | 8733f8e4b6f54fa620d9e6fde0d2d0ab8f3ee527 /js | |
parent | c03cdcc939f86c9865dc7a700782bdf558fa83f5 (diff) |
deno_typescript cleanup/improvements (#2901)
Diffstat (limited to 'js')
-rw-r--r-- | js/compiler.ts | 3 | ||||
-rw-r--r-- | js/diagnostics.ts | 2 | ||||
-rw-r--r-- | js/ts_global.d.ts | 14 |
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_; + } +} |