From 1d26da6a478d96a03b08b5bf1ff93a277b69f550 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 28 Feb 2020 03:27:00 +1100 Subject: feat: Support types compiler option in compiler APIs (#4155) Handles `types` in the compiler APIs to make it easier to supply external type libraries. --- cli/js/compiler_api.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'cli/js/compiler_api.ts') diff --git a/cli/js/compiler_api.ts b/cli/js/compiler_api.ts index 33748d2b8..3638046b6 100644 --- a/cli/js/compiler_api.ts +++ b/cli/js/compiler_api.ts @@ -247,7 +247,21 @@ export interface CompilerOptions { | "es2020" | "esnext"; - /** List of names of type definitions to include. Defaults to `undefined`. */ + /** List of names of type definitions to include. Defaults to `undefined`. + * + * The type definitions are resolved according to the normal Deno resolution + * irrespective of if sources are provided on the call. Like other Deno + * modules, there is no "magical" resolution. For example: + * + * Deno.compile( + * "./foo.js", + * undefined, + * { + * types: [ "./foo.d.ts", "https://deno.land/x/example/types.d.ts" ] + * } + * ); + * + */ types?: string[]; } -- cgit v1.2.3