Package-level declarations

Types

Link copied to clipboard
external interface ApplicableRefactorInfo

A set of one or more available refactoring actions, grouped under a parent refactoring.

Link copied to clipboard
external interface ApplyCodeActionCommandResult
Link copied to clipboard
Link copied to clipboard
sealed external interface BaseType
Link copied to clipboard
external interface BigIntLiteralType : LiteralType
Link copied to clipboard
external interface CallHierarchyIncomingCall
Link copied to clipboard
external interface CallHierarchyItem
Link copied to clipboard
external interface CallHierarchyOutgoingCall
Link copied to clipboard
external interface CancellationToken
Link copied to clipboard
external interface Classifications
Link copied to clipboard
external interface CodeAction
Link copied to clipboard
Link copied to clipboard
external interface CodeFixAction : CodeAction
Link copied to clipboard
external interface CombinedCodeActions
Link copied to clipboard
external interface CombinedCodeFixScope
Link copied to clipboard
external interface CompilerHost : ModuleResolutionHost
Link copied to clipboard
external interface CompilerOptions
Link copied to clipboard
Link copied to clipboard
external interface CompletionEntry
Link copied to clipboard
sealed external interface CompletionEntryData
Link copied to clipboard
Link copied to clipboard
external interface CompletionEntryDetails
Link copied to clipboard
external interface CompletionInfo
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external class CompletionTriggerKind
Link copied to clipboard
external interface ConditionalRoot
Link copied to clipboard
external interface ConditionalType : InstantiableType
Link copied to clipboard

Reports config file diagnostics

Link copied to clipboard
external interface CreateProgramOptions
Link copied to clipboard
external interface CreateSourceFileOptions
Link copied to clipboard
external interface CustomTransformers
Link copied to clipboard
Link copied to clipboard
external interface DefinitionInfo : DocumentSpan
Link copied to clipboard
external interface DefinitionInfoAndBoundSpan
Link copied to clipboard
Link copied to clipboard
external class DiagnosticCategory
Link copied to clipboard
external interface DiagnosticRelatedInformation
Link copied to clipboard
typealias DiagnosticReporter = (diagnostic: Diagnostic) -> Unit
Link copied to clipboard
external interface DiagnosticWithLocation : Diagnostic
Link copied to clipboard
external interface DocCommentTemplateOptions
Link copied to clipboard
external interface DocumentHighlights
Link copied to clipboard
external interface EditorOptions
Link copied to clipboard
external class ElementFlags : Bitmask<ElementFlags>
Link copied to clipboard
external interface EmitOutput
Link copied to clipboard
external interface EmitResult
Link copied to clipboard
external class EndOfLineState
Link copied to clipboard
external interface EnumType : FreshableType
Link copied to clipboard
external interface EvolvingArrayType : ObjectType
Link copied to clipboard
typealias ExportMapInfoKey = Any
Link copied to clipboard
external interface ExtendedConfigCacheEntry
Link copied to clipboard
external interface FileExtensionInfo
Link copied to clipboard
external interface FileTextChanges
Link copied to clipboard
sealed external interface FlowType
Link copied to clipboard
external interface FormatCodeOptions : EditorOptions
Link copied to clipboard
external interface FormatDiagnosticsHost
Link copied to clipboard
external interface FreshableType : Type
Link copied to clipboard
Link copied to clipboard
external interface GetEffectiveTypeRootsHost
Link copied to clipboard
external interface HighlightSpan
Link copied to clipboard
external class HighlightSpanKind
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface IncompleteType : FlowType
Link copied to clipboard
external class IndentStyle
Link copied to clipboard
Link copied to clipboard
external interface IndexInfo
Link copied to clipboard
external class IndexKind
Link copied to clipboard
external interface IndexType : InstantiableType
Link copied to clipboard
sealed external interface IndexTypeType
Link copied to clipboard
external interface InlayHint
Link copied to clipboard
external interface InlayHintDisplayPart
Link copied to clipboard
external class InlayHintKind
Link copied to clipboard
external interface InstallPackageAction
Link copied to clipboard
external interface InstantiableType : Type, IndexTypeType
Link copied to clipboard
external interface InteractiveRefactorArguments
Link copied to clipboard
external interface InterfaceType : ObjectType

Class and interface types (ObjectFlags.Class and ObjectFlags.Interface).

Link copied to clipboard
Link copied to clipboard
external interface JSDocTagInfo
Link copied to clipboard
external interface JsxClosingTagInfo
Link copied to clipboard
external class JsxEmit
Link copied to clipboard
external interface LanguageService
Link copied to clipboard
external interface LinkedEditingInfo
Link copied to clipboard
external class ListFormat : Bitmask<ListFormat>
Link copied to clipboard
external interface LiteralType : FreshableType
Link copied to clipboard

Type of objects whose values are all of the same type. The in and for-in operators can not be safely used, since Object.prototype may be modified by outside code.

Link copied to clipboard
external interface ModeAwareCache<T>
Link copied to clipboard
external class ModuleKind
Link copied to clipboard
external interface ModuleResolutionHost
Link copied to clipboard
external class ModuleResolutionKind
Link copied to clipboard
external interface NavigateToItem
Link copied to clipboard
sealed external interface NavigateToItemMatchKind
Link copied to clipboard
external interface NavigationBarItem

Navigation bar interface designed for visual studio's dual-column layout. This does not form a proper tree. The navbar is returned as a list of top-level items, each of which has a list of child items. Child items always have an empty array for their childItems.

Link copied to clipboard
external interface NavigationTree

Node in a tree of nested declarations in a file. The top node is always a script or module node.

Link copied to clipboard
Link copied to clipboard

Stored map from non-relative module name to a table: directory -> result of module lookup in this directory We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.

Link copied to clipboard
external interface NonRelativeNameResolutionCache<T>
Link copied to clipboard
external interface NumberLiteralType : LiteralType
Link copied to clipboard
external class ObjectFlags : Bitmask<ObjectFlags>
Link copied to clipboard
external interface ObjectType : Type, BaseType, StructuredType
Link copied to clipboard
Link copied to clipboard
external class OrganizeImportsMode
Link copied to clipboard
sealed external interface OrganizeImportsTypeOrder
Link copied to clipboard
external interface OutliningSpan
Link copied to clipboard
external class OutliningSpanKind
Link copied to clipboard
external interface OutputFile
Link copied to clipboard
external interface PackageId

Unique identifier with a package name and version. If changing this, remember to change packageIdIsEqual.

Link copied to clipboard
external interface PackageJsonInfoCache
Link copied to clipboard

Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors

Link copied to clipboard
Link copied to clipboard
external interface ParsedCommandLine

Either a parsed command line or a parsed tsconfig.json

Link copied to clipboard
external interface ParsedTsconfig
Link copied to clipboard
external interface PasteEdits
Link copied to clipboard
external interface PasteEditsArgs
Link copied to clipboard
external interface PasteEditsArgsCopiedFrom
Link copied to clipboard
typealias Path = Any
Link copied to clipboard
external interface PerDirectoryResolutionCache<T>

Cached resolutions per containing directory. This assumes that any module id will have the same resolution for sibling files located in the same folder.

Link copied to clipboard
external interface PerNonRelativeNameCache<T>
Link copied to clipboard
external class PollingWatchKind
Link copied to clipboard
external interface Printer
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface ProjectReference
Link copied to clipboard
external interface QuickInfo
Link copied to clipboard
external interface ReadConfigFileResult
Link copied to clipboard
external interface RefactorActionInfo

Represents a single refactoring action - for example, the "Extract Method..." refactor might offer several actions, each corresponding to a surround class or closure to extract into.

Link copied to clipboard
external interface RefactorActionInfoRange
Link copied to clipboard
external interface RefactorActionInfoRangeEnd
Link copied to clipboard
external interface RefactorActionInfoRangeStart
Link copied to clipboard
external interface RefactorEditInfo

A set of edits to make in response to a refactor action, plus an optional location where renaming should be invoked from

Link copied to clipboard
sealed external interface RefactorTriggerReason
Link copied to clipboard
external interface ReferencedSymbol
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface ReferenceEntry : DocumentSpan
Link copied to clipboard
sealed external interface RenameInfo
Link copied to clipboard
external interface RenameInfoFailure : RenameInfo
Link copied to clipboard
external interface RenameInfoSuccess : RenameInfo
Link copied to clipboard
external interface RenameLocation : DocumentSpan
Link copied to clipboard
typealias ResolutionMode = Any?
Link copied to clipboard
external interface ResolvedModule

Represents the result of module resolution. Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off. The Program will then filter results based on these flags.

Link copied to clipboard
external interface ResolvedModuleFull : ResolvedModule

ResolvedModule with an explicitly provided extension property. Prefer this over ResolvedModule. If changing this, remember to change moduleResolutionIsEqualTo.

Link copied to clipboard
external interface ResolvedProjectReference
Link copied to clipboard
Link copied to clipboard
external class ScriptElementKind
Link copied to clipboard
external interface ScriptReferenceHost
Link copied to clipboard
external interface SelectionRange
Link copied to clipboard
Link copied to clipboard
external interface Signature
Link copied to clipboard

Signals that the signature help request came from a user typing a character. Depending on the character and the syntactic context, the request may or may not be served a result.

Link copied to clipboard

Signals that the user manually requested signature help. The language service will unconditionally attempt to provide a result.

Link copied to clipboard
external interface SignatureHelpItem

Represents a single signature to show in signature help. The id is used for subsequent calls into the language service to ask questions about the signature help item in the context of any documents that have been updated. i.e. after an edit has happened, while signature help is still active, the host can ask important questions like 'what parameter is the user currently contained within?'.

Link copied to clipboard
external interface SignatureHelpItems

Represents a set of signature help items, and the preferred item that should be selected.

Link copied to clipboard
external interface SignatureHelpItemsOptions
Link copied to clipboard
external interface SignatureHelpParameter

Signature help information for a single parameter

Link copied to clipboard

Signals that this signature help request came from typing a character or moving the cursor. This should only occur if a signature help session was already active and the editor needs to see if it should adjust. The language service will unconditionally attempt to provide a result. triggerCharacter can be undefined for a retrigger caused by a cursor move.

Link copied to clipboard
sealed external interface SignatureHelpTriggerReason
Link copied to clipboard
external class SignatureKind
Link copied to clipboard
external interface StringLiteralType : LiteralType
Link copied to clipboard
external interface StringMappingType : InstantiableType
Link copied to clipboard
sealed external interface StructuredType
Link copied to clipboard
external interface SubstitutionType : InstantiableType
Link copied to clipboard
external interface Symbol
Link copied to clipboard
external class SymbolFlags : Bitmask<SymbolFlags>
Link copied to clipboard
Link copied to clipboard

SymbolTable based on ES6 Map interface.

Link copied to clipboard
Link copied to clipboard
external interface TextChange
Link copied to clipboard
external interface TextInsertion
Link copied to clipboard
Link copied to clipboard
external interface TodoComment
Link copied to clipboard
external interface TodoCommentDescriptor
Link copied to clipboard
external interface TranspileOptions
Link copied to clipboard
external interface TranspileOutput
Link copied to clipboard
external interface TupleType : GenericType
Link copied to clipboard
external interface TupleTypeReference : TypeReference
Link copied to clipboard
external interface Type : FlowType
Link copied to clipboard
external interface TypeAcquisition
Link copied to clipboard
external interface TypeChecker
Link copied to clipboard
external class TypeFlags : Bitmask<TypeFlags>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface TypePredicate
Link copied to clipboard
external interface TypePredicateBase
Link copied to clipboard
external interface TypePredicateKind
Link copied to clipboard
external interface TypeReference : ObjectType

Type references (ObjectFlags.Reference). When a class or interface has type parameters or a "this" type, references to the class or interface are made using type references. The typeArguments property specifies the types to substitute for the type parameters of the class or interface and optionally includes an extra element that specifies the type to substitute for "this" in the resulting instantiation. When no extra argument is present, the type reference itself is substituted for "this". The typeArguments property is undefined if the class or interface has no type parameters and the reference isn't specifying an explicit "this" argument.

Link copied to clipboard
sealed external interface TypeVariable : BaseType
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface UniqueESSymbolType : Type
Link copied to clipboard
external interface UserPreferences
Link copied to clipboard
sealed external interface UserPreferencesOrganizeImportsCaseFirst
Link copied to clipboard
sealed external interface UserPreferencesOrganizeImportsCollation
Link copied to clipboard
sealed external interface UserPreferencesQuotePreference
Link copied to clipboard
external class WatchDirectoryFlags
Link copied to clipboard
external class WatchDirectoryKind
Link copied to clipboard
external class WatchFileKind
Link copied to clipboard
external interface WatchOptions
Link copied to clipboard
external interface WithMetadata<T>
Link copied to clipboard
typealias WriteFileCallback = (fileName: String, text: String, writeByteOrderMark: Boolean, onError: (message: String) -> Unit?, ReadonlyArray<SourceFile>?, data: WriteFileCallbackData?) -> Unit
Link copied to clipboard
external interface WriteFileCallbackData

Properties

Link copied to clipboard
val UserPreferencesIncludeInlayParameterNameHints.Companion.all: UserPreferencesIncludeInlayParameterNameHints
Link copied to clipboard
val UserPreferencesImportModuleSpecifierEnding.Companion.auto: UserPreferencesImportModuleSpecifierEnding
val UserPreferencesIncludePackageJsonAutoImports.Companion.auto: UserPreferencesIncludePackageJsonAutoImports
val UserPreferencesJsxAttributeCompletionStyle.Companion.auto: UserPreferencesJsxAttributeCompletionStyle
val UserPreferencesQuotePreference.Companion.auto: UserPreferencesQuotePreference
Link copied to clipboard
val UserPreferencesJsxAttributeCompletionStyle.Companion.braces: UserPreferencesJsxAttributeCompletionStyle
Link copied to clipboard
val NavigateToItemMatchKind.Companion.camelCase: NavigateToItemMatchKind
Link copied to clipboard
val UserPreferencesQuotePreference.Companion.double: UserPreferencesQuotePreference
Link copied to clipboard
val NavigateToItemMatchKind.Companion.exact: NavigateToItemMatchKind
Link copied to clipboard
val UserPreferencesOrganizeImportsCaseFirst.Companion.false: UserPreferencesOrganizeImportsCaseFirst
Link copied to clipboard
val OrganizeImportsTypeOrder.Companion.first: OrganizeImportsTypeOrder
Link copied to clipboard
val RefactorTriggerReason.Companion.implicit: RefactorTriggerReason
Link copied to clipboard
val UserPreferencesImportModuleSpecifierEnding.Companion.index: UserPreferencesImportModuleSpecifierEnding
Link copied to clipboard
val OrganizeImportsTypeOrder.Companion.inline: OrganizeImportsTypeOrder
Link copied to clipboard
val RefactorTriggerReason.Companion.invoked: RefactorTriggerReason
Link copied to clipboard
val UserPreferencesImportModuleSpecifierEnding.Companion.JS: UserPreferencesImportModuleSpecifierEnding
Link copied to clipboard
val OrganizeImportsTypeOrder.Companion.last: OrganizeImportsTypeOrder
Link copied to clipboard
val UserPreferencesIncludeInlayParameterNameHints.Companion.literals: UserPreferencesIncludeInlayParameterNameHints
Link copied to clipboard
val UserPreferencesOrganizeImportsCaseFirst.Companion.lower: UserPreferencesOrganizeImportsCaseFirst
Link copied to clipboard
val UserPreferencesImportModuleSpecifierEnding.Companion.minimal: UserPreferencesImportModuleSpecifierEnding
Link copied to clipboard
val UserPreferencesIncludeInlayParameterNameHints.Companion.none: UserPreferencesIncludeInlayParameterNameHints
val UserPreferencesJsxAttributeCompletionStyle.Companion.none: UserPreferencesJsxAttributeCompletionStyle
Link copied to clipboard
val UserPreferencesImportModuleSpecifierPreference.Companion.nonRelative: UserPreferencesImportModuleSpecifierPreference
Link copied to clipboard
val UserPreferencesIncludePackageJsonAutoImports.Companion.off: UserPreferencesIncludePackageJsonAutoImports
Link copied to clipboard
val UserPreferencesIncludePackageJsonAutoImports.Companion.on: UserPreferencesIncludePackageJsonAutoImports
Link copied to clipboard
val UserPreferencesOrganizeImportsCollation.Companion.ordinal: UserPreferencesOrganizeImportsCollation
Link copied to clipboard
val NavigateToItemMatchKind.Companion.prefix: NavigateToItemMatchKind
Link copied to clipboard
val UserPreferencesImportModuleSpecifierPreference.Companion.projectRelative: UserPreferencesImportModuleSpecifierPreference
Link copied to clipboard
val UserPreferencesImportModuleSpecifierPreference.Companion.relative: UserPreferencesImportModuleSpecifierPreference
Link copied to clipboard
val UserPreferencesImportModuleSpecifierPreference.Companion.shortest: UserPreferencesImportModuleSpecifierPreference
Link copied to clipboard
val UserPreferencesQuotePreference.Companion.single: UserPreferencesQuotePreference
Link copied to clipboard
val NavigateToItemMatchKind.Companion.substring: NavigateToItemMatchKind
Link copied to clipboard
val UserPreferencesOrganizeImportsCollation.Companion.unicode: UserPreferencesOrganizeImportsCollation
Link copied to clipboard
val UserPreferencesOrganizeImportsCaseFirst.Companion.upper: UserPreferencesOrganizeImportsCaseFirst

Functions

Link copied to clipboard
external fun createProgram(createProgramOptions: CreateProgramOptions): Program
external fun createProgram(rootNames: ReadonlyArray<String>, options: CompilerOptions, host: CompilerHost = definedExternally, oldProgram: Program = definedExternally, configFileParsingDiagnostics: ReadonlyArray<Diagnostic> = definedExternally): Program

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

Link copied to clipboard
Link copied to clipboard

Given a set of options, returns the set of type directive names that should be included for this program automatically. This list could either come from the config file, and/or from enumerating the types root + initial secondary types lookup location given "*" compat wildcard. More type directives might appear in the program later as a result of loading actual source files; this list is only the set of defaults that are implicitly included.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get the path of the default library files (lib.d.ts) as distributed with the typescript node package. The functionality is not supported if the ts module is consumed outside of a node module.

Link copied to clipboard
external fun getImpliedNodeFormatForFile(fileName: String, packageJsonInfoCache: PackageJsonInfoCache?, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode

A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the options parameter.

Link copied to clipboard
external fun getModeForFileReference(ref: String, containingFileMode: ResolutionMode): ResolutionMode
external fun getModeForFileReference(ref: FileReference, containingFileMode: ResolutionMode): ResolutionMode

Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.

Link copied to clipboard
external fun getModeForResolutionAtIndex(file: SourceFile, index: Int, compilerOptions: CompilerOptions): ResolutionMode

Use program.getModeForResolutionAtIndex, which retrieves the correct compilerOptions, instead of this function whenever possible. Calculates the final resolution mode for an import at some index within a file's imports list. This is the resolution mode explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In --module node16 or nodenext, this may depend on the file's impliedNodeFormat. In --module preserve, it depends only on the input syntax of the reference. In other module modes, when overriding import attributes are not provided, this function returns undefined, as the result would have no impact on module resolution, emit, or type checking.

Link copied to clipboard

Use program.getModeForUsageLocation, which retrieves the correct compilerOptions, instead of this function whenever possible. 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
external fun getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: String, ignoreCase: Boolean): ReadonlyArray<String>
Link copied to clipboard
external fun getParsedCommandLineOfConfigFile(configFileName: String, optionsToExtend: CompilerOptions?, host: ParseConfigFileHost, extendedConfigCache: ReadonlyMap<String, ExtendedConfigCacheEntry> = definedExternally, watchOptionsToExtend: WatchOptions = definedExternally, extraFileExtensions: ReadonlyArray<FileExtensionInfo> = definedExternally): ParsedCommandLine?

Reads the config file, reports errors if any and exits if the config file cannot be found

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