createProgram

external fun createProgram(createProgramOptions: CreateProgramOptions): Program(source)

Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' that represent a compilation unit.

Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.

Parameters

createProgramOptions
  • The options for creating a program.


external fun createProgram(rootNames: ReadonlyArray<String>, options: CompilerOptions, host: CompilerHost = definedExternally, oldProgram: Program = definedExternally, configFileParsingDiagnostics: ReadonlyArray<Diagnostic> = definedExternally): Program(source)

Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' that represent a compilation unit.

Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in.

Parameters

rootNames
  • A set of root files.

options
  • The compiler options which should be used.

host
  • The host interacts with the underlying file system.

oldProgram
  • Reuses an old program structure.

configFileParsingDiagnostics
  • error during config file parsing