Functions

Link copied to clipboard
abstract external fun emit(targetSourceFile: SourceFile = definedExternally, writeFile: WriteFileCallback = definedExternally, cancellationToken: CancellationToken = definedExternally, emitOnlyDtsFiles: Boolean = definedExternally, customTransformers: CustomTransformers = definedExternally): EmitResult

Emits the JavaScript and declaration files. If targetSourceFile is not specified, then the JavaScript and declaration files will be produced for all the files in this program. If targetSourceFile is specified, then only the JavaScript and declaration for that specific file will be generated.

Link copied to clipboard
abstract external fun getCompilerOptions(): CompilerOptions
Link copied to clipboard
abstract external override fun getCurrentDirectory(): String
Link copied to clipboard
abstract external fun getDeclarationDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<DiagnosticWithLocation>
Link copied to clipboard
abstract external fun getGlobalDiagnostics(cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>
Link copied to clipboard
abstract external fun getIdentifierCount(): Double
Link copied to clipboard
abstract external fun getInstantiationCount(): Double
Link copied to clipboard
abstract external fun getModeForResolutionAtIndex(file: SourceFile, index: Double): ResolutionMode

Calculates the final resolution mode for an import at some index within a file's imports list. This function only returns a result when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes, which cause an import or require condition to be used during resolution regardless of module resolution settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript. Some examples:

Link copied to clipboard

Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes, which cause an import or require condition to be used during resolution regardless of module resolution settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript. Some examples:

Link copied to clipboard
abstract external fun getNodeCount(): Double
Link copied to clipboard
abstract external fun getOptionsDiagnostics(cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract external fun getRootFileNames(): ReadonlyArray<String>

Get a list of root file names that were passed to a 'createProgram'

Link copied to clipboard
abstract external fun getSemanticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<Diagnostic>

The first time this is called, it will return global diagnostics (no location).

Link copied to clipboard
abstract external fun getSourceFile(fileName: String): SourceFile?
Link copied to clipboard
abstract external fun getSourceFileByPath(path: Path): SourceFile?
Link copied to clipboard
abstract external fun getSourceFiles(): ReadonlyArray<SourceFile>

Get a list of files in the program

Link copied to clipboard
abstract external fun getSymbolCount(): Double
Link copied to clipboard
abstract external fun getSyntacticDiagnostics(sourceFile: SourceFile = definedExternally, cancellationToken: CancellationToken = definedExternally): ReadonlyArray<DiagnosticWithLocation>
Link copied to clipboard
abstract external fun getTypeChecker(): TypeChecker

Gets a type checker that can be used to semantically analyze source files in the program.

Link copied to clipboard
abstract external fun getTypeCount(): Double
Link copied to clipboard
abstract external fun isSourceFileDefaultLibrary(file: SourceFile): Boolean
Link copied to clipboard
abstract external fun isSourceFileFromExternalLibrary(file: SourceFile): Boolean