import { SourceFile } from "https://deno.land/x/deno@v0.30.0/cli/js/compiler_sourcefile.ts";
A self registering abstraction of source files.
Constructors
new
SourceFile(json: SourceFileJson)Properties
An array of tuples which represent the imports for the source file. The first element is the one that will be requested at compile time, the second is the one that should be actually resolved. This provides the feature of type directives for Deno.
mediaType: MediaType
Static Properties
private
_moduleCache: Map<string, SourceFile>A cache of all the source files which have been loaded indexed by the url.
private
_specifierCache: Map<string, Map<string, SourceFile>>A cache of source files based on module specifiers and containing files which is used by the TypeScript compiler to resolve the url
Static Methods
get(url: string): SourceFile | undefined
Retrieve a SourceFile
based on a url
getUrl(moduleSpecifier: string, containingFile: string): string | undefined
Retrieve a SourceFile
based on a moduleSpecifier
and containingFile
or return undefined
if not preset.
has(url: string): boolean
Determine if a source file exists or not