feat: Support types compiler option in compiler APIs (#4155)

Handles `types` in the compiler APIs to make it easier to supply
external type libraries.
This commit is contained in:
Kitson Kelly 2020-02-28 03:27:00 +11:00 committed by GitHub
parent daf7617f42
commit 1d26da6a47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 7 deletions

View file

@ -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[];
}