Properties
Extension
Extension: typeof Extension
JsxEmit
JsxEmit: typeof JsxEmit
ModuleResolutionKind
ModuleResolutionKind: typeof ModuleResolutionKind
ScriptSnapshot
ScriptSnapshot: typeof ScriptSnapshot
ScriptTarget
ScriptTarget: typeof ScriptTarget
createDocumentRegistry
createDocumentRegistry: (useCaseSensitiveFileNames?: boolean, currentDirectory?: string) => DocumentRegistry
Type declaration
- (useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry
Parameters
Optional useCaseSensitiveFileNames: boolean
Optional currentDirectory: string
Returns DocumentRegistry
createEmitAndSemanticDiagnosticsBuilderProgram
createEmitAndSemanticDiagnosticsBuilderProgram: { (newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram; (rootNames: undefined | readonly string[], options: undefined | CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram }
Type declaration
- (newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram
- (rootNames: undefined | readonly string[], options: undefined | CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram
Parameters
newProgram: Program
host: BuilderProgramHost
Optional oldProgram: EmitAndSemanticDiagnosticsBuilderProgram
Optional configFileParsingDiagnostics: readonly Diagnostic[]
Returns EmitAndSemanticDiagnosticsBuilderProgram
Parameters
rootNames: undefined | readonly string[]
options: undefined | CompilerOptions
Optional host: CompilerHost
Optional oldProgram: EmitAndSemanticDiagnosticsBuilderProgram
Optional configFileParsingDiagnostics: readonly Diagnostic[]
Optional projectReferences: readonly ProjectReference[]
Returns EmitAndSemanticDiagnosticsBuilderProgram
createIncrementalCompilerHost
createIncrementalCompilerHost: (options: CompilerOptions, system?: System) => CompilerHost
Type declaration
- (options: CompilerOptions, system?: System): CompilerHost
Parameters
options: CompilerOptions
Optional system: System
Returns CompilerHost
createIncrementalProgram
createIncrementalProgram: <T>(__namedParameters: IncrementalProgramOptions<T>) => T
Type declaration
- <T>(__namedParameters: IncrementalProgramOptions<T>): T
Type parameters
T: BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram
Parameters
__namedParameters: IncrementalProgramOptions<T>
Returns T
createLanguageService
createLanguageService: (host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode) => LanguageService
Type declaration
- (host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService
Parameters
host: LanguageServiceHost
Optional documentRegistry: DocumentRegistry
Optional syntaxOnlyOrLanguageServiceMode: boolean | LanguageServiceMode
Returns LanguageService
createModuleResolutionCache
createModuleResolutionCache: (currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions) => ModuleResolutionCache
Type declaration
- (currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache
Parameters
currentDirectory: string
getCanonicalFileName: (s: string) => string
Optional options: CompilerOptions
Returns ModuleResolutionCache
createSourceFile
createSourceFile: (fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind) => SourceFile
Type declaration
- (fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile
Parameters
fileName: string
sourceText: string
languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions
Optional setParentNodes: boolean
Optional scriptKind: ScriptKind
Returns SourceFile
displayPartsToString
displayPartsToString: (displayParts: undefined | SymbolDisplayPart[]) => string
Type declaration
- (displayParts: undefined | SymbolDisplayPart[]): string
Parameters
displayParts: undefined | SymbolDisplayPart[]
Returns string
findConfigFile
findConfigFile: (searchPath: string, fileExists: (fileName: string) => boolean, configName?: string) => string | undefined
Type declaration
- (searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined
Parameters
searchPath: string
fileExists: (fileName: string) => boolean
- (fileName: string): boolean
Parameters
Returns boolean
Optional configName: string
Returns string | undefined
flattenDiagnosticMessageText
flattenDiagnosticMessageText: (diag: undefined | string | DiagnosticMessageChain, newLine: string, indent?: number) => string
Type declaration
- (diag: undefined | string | DiagnosticMessageChain, newLine: string, indent?: number): string
Parameters
diag: undefined | string | DiagnosticMessageChain
newLine: string
Optional indent: number
Returns string
formatDiagnostics
formatDiagnostics: (diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost) => string
Type declaration
- (diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string
Parameters
diagnostics: readonly Diagnostic[]
host: FormatDiagnosticsHost
Returns string
formatDiagnosticsWithColorAndContext
formatDiagnosticsWithColorAndContext: (diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost) => string
Type declaration
- (diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string
Parameters
diagnostics: readonly Diagnostic[]
host: FormatDiagnosticsHost
Returns string
getDefaultLibFileName
getDefaultLibFileName: (options: CompilerOptions) => string
Type declaration
- (options: CompilerOptions): string
getDefaultLibFilePath
getDefaultLibFilePath: (options: CompilerOptions) => string
Type declaration
- (options: CompilerOptions): string
getPreEmitDiagnostics
getPreEmitDiagnostics: (program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken) => readonly Diagnostic[]
Type declaration
- (program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]
Parameters
program: Program
Optional sourceFile: SourceFile
Optional cancellationToken: CancellationToken
Returns readonly Diagnostic[]
parseJsonConfigFileContent
parseJsonConfigFileContent: (json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions) => ParsedCommandLine
Type declaration
- (json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine
Parameters
json: any
host: ParseConfigHost
basePath: string
Optional existingOptions: CompilerOptions
Optional configFileName: string
Optional resolutionStack: Path[]
Optional extraFileExtensions: readonly FileExtensionInfo[]
Optional extendedConfigCache: Map<ExtendedConfigCacheEntry>
Optional existingWatchOptions: WatchOptions
Returns ParsedCommandLine
readConfigFile
readConfigFile: (fileName: string, readFile: (path: string) => undefined | string) => { config?: any; error?: Diagnostic }
Type declaration
- (fileName: string, readFile: (path: string) => undefined | string): { config?: any; error?: Diagnostic }
Parameters
fileName: string
readFile: (path: string) => undefined | string
- (path: string): undefined | string
Parameters
Returns undefined | string
Returns { config?: any; error?: Diagnostic }
Optional config?: any
Optional error?: Diagnostic
resolveModuleName
resolveModuleName: (moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: CommonJS | ESNext) => ResolvedModuleWithFailedLookupLocations
Type declaration
- (moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: CommonJS | ESNext): ResolvedModuleWithFailedLookupLocations
Parameters
moduleName: string
containingFile: string
compilerOptions: CompilerOptions
host: ModuleResolutionHost
Optional cache: ModuleResolutionCache
Optional redirectedReference: ResolvedProjectReference
Optional resolutionMode: CommonJS | ESNext
Returns ResolvedModuleWithFailedLookupLocations
resolveModuleNameFromCache
resolveModuleNameFromCache: (moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: CommonJS | ESNext) => ResolvedModuleWithFailedLookupLocations | undefined
Type declaration
- (moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: CommonJS | ESNext): ResolvedModuleWithFailedLookupLocations | undefined
Parameters
moduleName: string
containingFile: string
cache: ModuleResolutionCache
Optional mode: CommonJS | ESNext
Returns ResolvedModuleWithFailedLookupLocations | undefined
resolveTypeReferenceDirective
resolveTypeReferenceDirective: (typeReferenceDirectiveName: string, containingFile: undefined | string, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: CommonJS | ESNext) => ResolvedTypeReferenceDirectiveWithFailedLookupLocations
Type declaration
- (typeReferenceDirectiveName: string, containingFile: undefined | string, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: CommonJS | ESNext): ResolvedTypeReferenceDirectiveWithFailedLookupLocations
Parameters
typeReferenceDirectiveName: string
containingFile: undefined | string
options: CompilerOptions
host: ModuleResolutionHost
Optional redirectedReference: ResolvedProjectReference
Optional cache: TypeReferenceDirectiveResolutionCache
Optional resolutionMode: CommonJS | ESNext
Returns ResolvedTypeReferenceDirectiveWithFailedLookupLocations
transpileModule
transpileModule: (input: string, transpileOptions: TranspileOptions) => TranspileOutput
Type declaration
- (input: string, transpileOptions: TranspileOptions): TranspileOutput
Parameters
input: string
transpileOptions: TranspileOptions
Returns TranspileOutput
Common TypeScript interfaces between versions. We endeavour to write ts-node's own code against these types instead of against
import "typescript"
, though we are not yet doing this consistently.Sometimes typescript@next adds an API we need to use. But we build ts-node against typescript@latest. In these cases, we must declare that API explicitly here. Our declarations include the newer typescript@next APIs. Importantly, these re-declarations are not TypeScript internals. They are public APIs that only exist in pre-release versions of typescript.