namespace ts { export interface Node { getSourceFile ( ) : SourceFile ; getChildCount ( sourceFile ? ) : number ; getChildAt ( index , sourceFile ? ) : Node ; getChildren ( sourceFile ? ) : Node [ ] ; getChildren ( sourceFile ? ) : Node [ ] ; getStart ( sourceFile ? , includeJsDocComment ? ) : number ; getStart ( sourceFile ? , includeJsDocComment ? ) : number ; getFullStart ( ) : number ; getEnd ( ) : number ; getWidth ( sourceFile ? ) : number ; getFullWidth ( ) : number ; getLeadingTriviaWidth ( sourceFile ? ) : number ; getFullText ( sourceFile ? ) : string ; getText ( sourceFile ? ) : string ; getFirstToken ( sourceFile ? ) : Node | undefined ; getFirstToken ( sourceFile ? ) : Node | undefined ; getLastToken ( sourceFile ? ) : Node | undefined ; getLastToken ( sourceFile ? ) : Node | undefined ; forEachChild < T > ( cbNode , cbNodeArray ? ) : T | undefined ; } export interface Identifier { readonly text : string ; } export interface PrivateIdentifier { readonly text : string ; } export interface Symbol { readonly name : string ; getFlags ( ) : SymbolFlags ; getEscapedName ( ) : __String ; getName ( ) : string ; getDeclarations ( ) : Declaration [ ] | undefined ; getDocumentationComment ( typeChecker ) : SymbolDisplayPart [ ] ; getContextualDocumentationComment ( context , checker ) : SymbolDisplayPart [ ] ; getJsDocTags ( checker ? ) : JSDocTagInfo [ ] ; } export interface Type { getFlags ( ) : TypeFlags ; getSymbol ( ) : Symbol | undefined ; getProperties ( ) : Symbol [ ] ; getProperty ( propertyName ) : Symbol | undefined ; getApparentProperties ( ) : Symbol [ ] ; getCallSignatures ( ) : readonly Signature [ ] ; getConstructSignatures ( ) : readonly Signature [ ] ; getStringIndexType ( ) : Type | undefined ; getNumberIndexType ( ) : Type | undefined ; getBaseTypes ( ) : BaseType [ ] | undefined ; getNonNullableType ( ) : Type ; getNonOptionalType ( ) : Type ; isNullableType ( ) : boolean ; getConstraint ( ) : Type | undefined ; getDefault ( ) : Type | undefined ; isUnion ( ) : this is UnionType ; isIntersection ( ) : this is IntersectionType ; isUnionOrIntersection ( ) : this is UnionOrIntersectionType ; isLiteral ( ) : this is LiteralType ; isStringLiteral ( ) : this is StringLiteralType ; isNumberLiteral ( ) : this is NumberLiteralType ; isTypeParameter ( ) : this is TypeParameter ; isClassOrInterface ( ) : this is InterfaceType ; isClass ( ) : this is InterfaceType ; isIndexType ( ) : this is IndexType ; } export interface TypeReference { typeArguments ? : readonly Type [ ] ; } export interface Signature { getDeclaration ( ) : SignatureDeclaration ; getTypeParameters ( ) : TypeParameter [ ] | undefined ; getParameters ( ) : Symbol [ ] ; getTypeParameterAtPosition ( pos ) : Type ; getReturnType ( ) : Type ; getDocumentationComment ( typeChecker ) : SymbolDisplayPart [ ] ; getJsDocTags ( ) : JSDocTagInfo [ ] ; } export interface SourceFile { version : string ; scriptSnapshot : IScriptSnapshot | undefined ; nameTable : UnderscoreEscapedMap < number > | undefined ; getNamedDeclarations ( ) : ESMap < string , readonly Declaration [ ] > ; getLineAndCharacterOfPosition ( pos ) : LineAndCharacter ; getLineEndOfPosition ( pos ) : number ; getLineStarts ( ) : readonly number [ ] ; getPositionOfLineAndCharacter ( line , character ) : number ; update ( newText , textChangeRange ) : SourceFile ; sourceMapper ? : DocumentPositionMapper ; } export interface SourceFileLike { getLineAndCharacterOfPosition ( pos ) : LineAndCharacter ; } export interface SourceMapSource { getLineAndCharacterOfPosition ( pos ) : LineAndCharacter ; } /**
     * Represents an immutable snapshot of a script at a specified time.Once acquired, the
     * snapshot is observably immutable. i.e. the same calls with the same parameters will return
     * the same values.
     */ export interface IScriptSnapshot { /** Gets a portion of the script snapshot specified by [start, end). */ getText ( start , end ) : string ; /** Gets the length of this script snapshot. */ getLength ( ) : number ; /**
         * Gets the TextChangeRange that describe how the text changed between this text and
         * an older version.  This information is used by the incremental parser to determine
         * what sections of the script need to be re-parsed.  'undefined' can be returned if the
         * change range cannot be determined.  However, in that case, incremental parsing will
         * not happen and the entire document will be re - parsed.
         */ getChangeRange ( oldSnapshot ) : TextChangeRange | undefined ; /** Releases all resources held by this script snapshot */ dispose ? ( ) : void ; } export namespace ScriptSnapshot { class StringScriptSnapshot implements IScriptSnapshot { constructor ( private text ) { } public getText ( start , end ) { return start === 0 && end === this . text . length ? this . text : this . text . substring ( start , end ) ; } public getLength ( ) { return this . text . length ; } public getChangeRange ( ) { return undefined ; } } export function fromString ( text ) { return new StringScriptSnapshot ( text ) ; } } export interface PreProcessedFileInfo { referencedFiles : FileReference [ ] ; typeReferenceDirectives : FileReference [ ] ; libReferenceDirectives : FileReference [ ] ; importedFiles : FileReference [ ] ; ambientExternalModules ? : string [ ] ; isLibFile : boolean ; } export interface HostCancellationToken { isCancellationRequested ( ) : boolean ; } export interface InstallPackageOptions { fileName : Path ; packageName : string ; } export const enum PackageJsonDependencyGroup { Dependencies = 1 << 0 , DevDependencies = 1 << 1 , PeerDependencies = 1 << 2 , OptionalDependencies = 1 << 3 , All = Dependencies | DevDependencies | PeerDependencies | OptionalDependencies } export interface PackageJsonInfo { fileName : string ; parseable : boolean ; dependencies ? : ESMap < string , string > ; devDependencies ? : ESMap < string , string > ; peerDependencies ? : ESMap < string , string > ; optionalDependencies ? : ESMap < string , string > ; get ( dependencyName , inGroups ? ) : string | undefined ; has ( dependencyName , inGroups ? ) : boolean ; } export interface FormattingHost { getNewLine ? ( ) : string ; } export const enum PackageJsonAutoImportPreference { Off , On , Auto } export interface PerformanceEvent { kind : "UpdateGraph" | "CreatePackageJsonAutoImportProvider" ; durationMs : number ; } export enum LanguageServiceMode { Semantic , PartialSemantic , Syntactic } export interface IncompleteCompletionsCache { get ( ) : CompletionInfo | undefined ; set ( response ) : void ; clear ( ) : void ; } export interface LanguageServiceHost extends GetEffectiveTypeRootsHost { getCompilationSettings ( ) : CompilerOptions ; getNewLine ? ( ) : string ; getProjectVersion ? ( ) : string ; getScriptFileNames ( ) : string [ ] ; getScriptKind ? ( fileName ) : ScriptKind ; getScriptVersion ( fileName ) : string ; getScriptSnapshot ( fileName ) : IScriptSnapshot | undefined ; getProjectReferences ? ( ) : readonly ProjectReference [ ] | undefined ; getLocalizedDiagnosticMessages ? ( ) : any ; getCancellationToken ? ( ) : HostCancellationToken ; getCurrentDirectory ( ) : string ; getDefaultLibFileName ( options ) : string ; log ? ( s ) : void ; trace ? ( s ) : void ; error ? ( s ) : void ; useCaseSensitiveFileNames ? ( ) : boolean ; readDirectory ? ( path , extensions ? , exclude ? , include ? , depth ? ) : string [ ] ; readFile ? ( path , encoding ? ) : string | undefined ; realpath ? ( path ) : string ; fileExists ? ( path ) : boolean ; getTypeRootsVersion ? ( ) : number ; resolveModuleNames ? ( moduleNames , containingFile , reusedNames , redirectedReference , options , containingSourceFile ? ) : ( ResolvedModule | undefined ) [ ] ; getResolvedModuleWithFailedLookupLocationsFromCache ? ( modulename , containingFile , resolutionMode ? ) : ResolvedModuleWithFailedLookupLocations | undefined ; resolveTypeReferenceDirectives ? ( typeDirectiveNames , containingFile , redirectedReference , options ) : ( ResolvedTypeReferenceDirective | undefined ) [ ] ; hasInvalidatedResolution ? : HasInvalidatedResolution ; hasChangedAutomaticTypeDirectiveNames ? : HasChangedAutomaticTypeDirectiveNames ; getGlobalTypingsCacheLocation ? ( ) : string | undefined ; getSymlinkCache ? ( files ? ) : SymlinkCache ; getDirectories ? ( directoryName ) : string [ ] ; /**
         * Gets a set of custom transformers to use during emit.
         */ getCustomTransformers ? ( ) : CustomTransformers | undefined ; isKnownTypesPackageName ? ( name ) : boolean ; installPackage ? ( options ) : Promise < ApplyCodeActionCommandResult > ; writeFile ? ( fileName , content ) : void ; getDocumentPositionMapper ? ( generatedFileName , sourceFileName ? ) : DocumentPositionMapper | undefined ; getSourceFileLike ? ( fileName ) : SourceFileLike | undefined ; getPackageJsonsVisibleToFile ? ( fileName , rootDir ? ) : readonly PackageJsonInfo [ ] ; getNearestAncestorDirectoryWithPackageJson ? ( fileName ) : string | undefined ; getPackageJsonsForAutoImport ? ( rootDir ? ) : readonly PackageJsonInfo [ ] ; getCachedExportInfoMap ? ( ) : ExportInfoMap ; getModuleSpecifierCache ? ( ) : ModuleSpecifierCache ; setCompilerHost ? ( host ) : void ; useSourceOfProjectReferenceRedirect ? ( ) : boolean ; getPackageJsonAutoImportProvider ? ( ) : Program | undefined ; sendPerformanceEvent ? ( kind , durationMs ) : void ; getParsedCommandLine ? ( fileName ) : ParsedCommandLine | undefined ; onReleaseParsedCommandLine ? ( configFileName , oldResolvedRef , optionOptions ) : void ; getIncompleteCompletionsCache ? ( ) : IncompleteCompletionsCache ; } export const emptyOptions = { } ; export type WithMetadata < T > = T & { metadata ? : unknown ; } ; export const enum SemanticClassificationFormat { Original = "original" , TwentyTwenty = "2020" } export interface LanguageService { /** This is used as a part of restarting the language service. */ cleanupSemanticCache ( ) : void ; param fileName getSyntacticDiagnostics ( fileName ) : DiagnosticWithLocation [ ] ; param fileName getSemanticDiagnostics ( fileName ) : Diagnostic [ ] ; param fileName getSuggestionDiagnostics ( fileName ) : DiagnosticWithLocation [ ] ; /**
         * Gets global diagnostics related to the program configuration and compiler options.
         */ getCompilerOptionsDiagnostics ( ) : Diagnostic [ ] ; deprecated getSyntacticClassifications ( fileName , span ) : ClassifiedSpan [ ] ; getSyntacticClassifications ( fileName , span , format ) : ClassifiedSpan [ ] | ClassifiedSpan2020 [ ] ; deprecated getSemanticClassifications ( fileName , span ) : ClassifiedSpan [ ] ; getSemanticClassifications ( fileName , span , format ) : ClassifiedSpan [ ] | ClassifiedSpan2020 [ ] ; /** Encoded as triples of [start, length, ClassificationType]. */ getEncodedSyntacticClassifications ( fileName , span ) : Classifications ; param fileName param position param format returns getEncodedSemanticClassifications ( fileName , span , format ? ) : Classifications ; param fileName param position param options param formattingSettings getCompletionsAtPosition ( fileName , position , options , formattingSettings ? ) : WithMetadata < CompletionInfo > | undefined ; param fileName param position param entryName param formatOptions param source param preferences param data getCompletionEntryDetails ( fileName , position , entryName , formatOptions , source , preferences , data ) : CompletionEntryDetails | undefined ; getCompletionEntrySymbol ( fileName , position , name , source ) : Symbol | undefined ; param fileName param position getQuickInfoAtPosition ( fileName , position ) : QuickInfo | undefined ; getNameOrDottedNameSpan ( fileName , startPos , endPos ) : TextSpan | undefined ; getBreakpointStatementAtPosition ( fileName , position ) : TextSpan | undefined ; getSignatureHelpItems ( fileName , position , options ) : SignatureHelpItems | undefined ; getRenameInfo ( fileName , position , options ? ) : RenameInfo ; findRenameLocations ( fileName , position , findInStrings , findInComments , providePrefixAndSuffixTextForRename ? ) : readonly RenameLocation [ ] | undefined ; getSmartSelectionRange ( fileName , position ) : SelectionRange ; getDefinitionAtPosition ( fileName , position ) : readonly DefinitionInfo [ ] | undefined ; getDefinitionAndBoundSpan ( fileName , position ) : DefinitionInfoAndBoundSpan | undefined ; getTypeDefinitionAtPosition ( fileName , position ) : readonly DefinitionInfo [ ] | undefined ; getImplementationAtPosition ( fileName , position ) : readonly ImplementationLocation [ ] | undefined ; getReferencesAtPosition ( fileName , position ) : ReferenceEntry [ ] | undefined ; findReferences ( fileName , position ) : ReferencedSymbol [ ] | undefined ; getDocumentHighlights ( fileName , position , filesToSearch ) : DocumentHighlights [ ] | undefined ; getFileReferences ( fileName ) : ReferenceEntry [ ] ; deprecated getOccurrencesAtPosition ( fileName , position ) : readonly ReferenceEntry [ ] | undefined ; getNavigateToItems ( searchValue , maxResultCount ? , fileName ? , excludeDtsFiles ? ) : NavigateToItem [ ] ; getNavigationBarItems ( fileName ) : NavigationBarItem [ ] ; getNavigationTree ( fileName ) : NavigationTree ; prepareCallHierarchy ( fileName , position ) : CallHierarchyItem | CallHierarchyItem [ ] | undefined ; provideCallHierarchyIncomingCalls ( fileName , position ) : CallHierarchyIncomingCall [ ] ; provideCallHierarchyOutgoingCalls ( fileName , position ) : CallHierarchyOutgoingCall [ ] ; provideInlayHints ( fileName , span , preferences ) : InlayHint [ ] ; getOutliningSpans ( fileName ) : OutliningSpan [ ] ; getTodoComments ( fileName , descriptors ) : TodoComment [ ] ; getBraceMatchingAtPosition ( fileName , position ) : TextSpan [ ] ; getIndentationAtPosition ( fileName , position , options ) : number ; getFormattingEditsForRange ( fileName , start , end , options ) : TextChange [ ] ; getFormattingEditsForDocument ( fileName , options ) : TextChange [ ] ; getFormattingEditsAfterKeystroke ( fileName , position , key , options ) : TextChange [ ] ; getDocCommentTemplateAtPosition ( fileName , position , options ? ) : TextInsertion | undefined ; isValidBraceCompletionAtPosition ( fileName , position , openingBrace ) : boolean ; /**
         * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag.
         * Editors should call this after `>` is typed.
         */ getJsxClosingTagAtPosition ( fileName , position ) : JsxClosingTagInfo | undefined ; getSpanOfEnclosingComment ( fileName , position , onlyMultiLine ) : TextSpan | undefined ; toLineColumnOffset ? ( fileName , position ) : LineAndCharacter ; internal getSourceMapper ( ) : SourceMapper ; internal clearSourceMapperCache ( ) : void ; getCodeFixesAtPosition ( fileName , start , end , errorCodes , formatOptions , preferences ) : readonly CodeFixAction [ ] ; getCombinedCodeFix ( scope , fixId , formatOptions , preferences ) : CombinedCodeActions ; applyCodeActionCommand ( action , formatSettings ? ) : Promise < ApplyCodeActionCommandResult > ; applyCodeActionCommand ( action , formatSettings ? ) : Promise < ApplyCodeActionCommandResult [ ] > ; applyCodeActionCommand ( action , formatSettings ? ) : Promise < ApplyCodeActionCommandResult | ApplyCodeActionCommandResult [ ] > ; deprecated applyCodeActionCommand ( fileName , action ) : Promise < ApplyCodeActionCommandResult > ; deprecated applyCodeActionCommand ( fileName , action ) : Promise < ApplyCodeActionCommandResult [ ] > ; deprecated applyCodeActionCommand ( fileName , action ) : Promise < ApplyCodeActionCommandResult | ApplyCodeActionCommandResult [ ] > ; getApplicableRefactors ( fileName , positionOrRange , preferences , triggerReason ? , kind ? ) : ApplicableRefactorInfo [ ] ; getEditsForRefactor ( fileName , formatOptions , positionOrRange , refactorName , actionName , preferences ) : RefactorEditInfo | undefined ; organizeImports ( args , formatOptions , preferences ) : readonly FileTextChanges [ ] ; getEditsForFileRename ( oldFilePath , newFilePath , formatOptions , preferences ) : readonly FileTextChanges [ ] ; getEmitOutput ( fileName , emitOnlyDtsFiles ? , forceDtsEmit ? ) : EmitOutput ; getProgram ( ) : Program | undefined ; getNonBoundSourceFile ( fileName ) : SourceFile ; getAutoImportProvider ( ) : Program | undefined ; toggleLineComment ( fileName , textRange ) : TextChange [ ] ; toggleMultilineComment ( fileName , textRange ) : TextChange [ ] ; commentSelection ( fileName , textRange ) : TextChange [ ] ; uncommentSelection ( fileName , textRange ) : TextChange [ ] ; dispose ( ) : void ; } export interface JsxClosingTagInfo { readonly newText : string ; } export interface CombinedCodeFixScope { type : "file" ; fileName : string ; } export interface OrganizeImportsArgs extends CombinedCodeFixScope { skipDestructiveCodeActions ? : boolean ; } export type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " " ; export const enum CompletionTriggerKind { /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */ Invoked = 1 , /** Completion was triggered by a trigger character. */ TriggerCharacter = 2 , /** Completion was re-triggered as the current completion list is incomplete. */ TriggerForIncompleteCompletions = 3 } export interface GetCompletionsAtPositionOptions extends UserPreferences { /**
         * If the editor is asking for completions because a certain character was typed
         * (as opposed to when the user explicitly requested them) this should be set.
         */ triggerCharacter ? : CompletionsTriggerCharacter ; triggerKind ? : CompletionTriggerKind ; deprecated includeExternalModuleExports ? : boolean ; deprecated includeInsertTextCompletions ? : boolean ; } export interface InlayHintsOptions extends UserPreferences { readonly includeInlayParameterNameHints ? : "none" | "literals" | "all" ; readonly includeInlayParameterNameHintsWhenArgumentMatchesName ? : boolean ; readonly includeInlayFunctionParameterTypeHints ? : boolean ; readonly includeInlayVariableTypeHints ? : boolean ; readonly includeInlayPropertyDeclarationTypeHints ? : boolean ; readonly includeInlayFunctionLikeReturnTypeHints ? : boolean ; readonly includeInlayEnumMemberValueHints ? : boolean ; } export type SignatureHelpTriggerCharacter = "," | "(" | "<" ; export type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")" ; export interface SignatureHelpItemsOptions { triggerReason ? : SignatureHelpTriggerReason ; } export type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason ; /**
     * Signals that the user manually requested signature help.
     * The language service will unconditionally attempt to provide a result.
     */ export interface SignatureHelpInvokedReason { kind : "invoked" ; triggerCharacter ? : undefined ; } /**
     * 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.
     */ export interface SignatureHelpCharacterTypedReason { kind : "characterTyped" ; /**
         * Character that was responsible for triggering signature help.
         */ triggerCharacter : SignatureHelpTriggerCharacter ; } /**
     * 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.
     */ export interface SignatureHelpRetriggeredReason { kind : "retrigger" ; /**
         * Character that was responsible for triggering signature help.
         */ triggerCharacter ? : SignatureHelpRetriggerCharacter ; } export interface ApplyCodeActionCommandResult { successMessage : string ; } export interface Classifications { spans : number [ ] ; endOfLineState : EndOfLineState ; } export interface ClassifiedSpan { textSpan : TextSpan ; classificationType : ClassificationTypeNames ; } export interface ClassifiedSpan2020 { textSpan : TextSpan ; classificationType : number ; } /**
     * 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`.
     */ export interface NavigationBarItem { text : string ; kind : ScriptElementKind ; kindModifiers : string ; spans : TextSpan [ ] ; childItems : NavigationBarItem [ ] ; indent : number ; bolded : boolean ; grayed : boolean ; } /**
     * Node in a tree of nested declarations in a file.
     * The top node is always a script or module node.
     */ export interface NavigationTree { /** Name of the declaration, or a short description, e.g. "<class>". */ text : string ; kind : ScriptElementKind ; /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */ kindModifiers : string ; /**
         * Spans of the nodes that generated this declaration.
         * There will be more than one if this is the result of merging.
         */ spans : TextSpan [ ] ; nameSpan : TextSpan | undefined ; /** Present if non-empty */ childItems ? : NavigationTree [ ] ; } export interface CallHierarchyItem { name : string ; kind : ScriptElementKind ; kindModifiers ? : string ; file : string ; span : TextSpan ; selectionSpan : TextSpan ; containerName ? : string ; } export interface CallHierarchyIncomingCall { from : CallHierarchyItem ; fromSpans : TextSpan [ ] ; } export interface CallHierarchyOutgoingCall { to : CallHierarchyItem ; fromSpans : TextSpan [ ] ; } export const enum InlayHintKind { Type = "Type" , Parameter = "Parameter" , Enum = "Enum" } export interface InlayHint { text : string ; position : number ; kind : InlayHintKind ; whitespaceBefore ? : boolean ; whitespaceAfter ? : boolean ; } export interface TodoCommentDescriptor { text : string ; priority : number ; } export interface TodoComment { descriptor : TodoCommentDescriptor ; message : string ; position : number ; } export interface TextChange { span : TextSpan ; newText : string ; } export interface FileTextChanges { fileName : string ; textChanges : readonly TextChange [ ] ; isNewFile ? : boolean ; } export interface CodeAction { /** Description of the code action to display in the UI of the editor */ description : string ; /** Text changes to apply to each file as part of the code action */ changes : FileTextChanges [ ] ; /**
         * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
         * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
         */ commands ? : CodeActionCommand [ ] ; } export interface CodeFixAction extends CodeAction { /** Short name to identify the fix, for use by telemetry. */ fixName : string ; /**
         * If present, one may call 'getCombinedCodeFix' with this fixId.
         * This may be omitted to indicate that the code fix can't be applied in a group.
         */ fixId ? : { } ; fixAllDescription ? : string ; } export interface CombinedCodeActions { changes : readonly FileTextChanges [ ] ; commands ? : readonly CodeActionCommand [ ] ; } export type CodeActionCommand = InstallPackageAction ; export interface InstallPackageAction { readonly type : "install package" ; readonly file : string ; readonly packageName : string ; } /**
     * A set of one or more available refactoring actions, grouped under a parent refactoring.
     */ export interface ApplicableRefactorInfo { /**
         * The programmatic name of the refactoring
         */ name : string ; /**
         * A description of this refactoring category to show to the user.
         * If the refactoring gets inlined (see below), this text will not be visible.
         */ description : string ; /**
         * Inlineable refactorings can have their actions hoisted out to the top level
         * of a context menu. Non-inlineanable refactorings should always be shown inside
         * their parent grouping.
         *
         * If not specified, this value is assumed to be 'true'
         */ inlineable ? : boolean ; actions : 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.
     */ export interface RefactorActionInfo { /**
         * The programmatic name of the refactoring action
         */ name : string ; /**
         * A description of this refactoring action to show to the user.
         * If the parent refactoring is inlined away, this will be the only text shown,
         * so this description should make sense by itself if the parent is inlineable=true
         */ description : string ; /**
         * A message to show to the user if the refactoring cannot be applied in
         * the current context.
         */ notApplicableReason ? : string ; /**
         * The hierarchical dotted name of the refactor action.
         */ kind ? : string ; } /**
     * A set of edits to make in response to a refactor action, plus an optional
     * location where renaming should be invoked from
     */ export interface RefactorEditInfo { edits : FileTextChanges [ ] ; renameFilename ? : string ; renameLocation ? : number ; commands ? : CodeActionCommand [ ] ; } export type RefactorTriggerReason = "implicit" | "invoked" ; export interface TextInsertion { newText : string ; /** The position in newText the caret should point to after the insertion. */ caretOffset : number ; } export interface DocumentSpan { textSpan : TextSpan ; fileName : string ; /**
         * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
         * then the original filename and span will be specified here
         */ originalTextSpan ? : TextSpan ; originalFileName ? : string ; /**
         * If DocumentSpan.textSpan is the span for name of the declaration,
         * then this is the span for relevant declaration
         */ contextSpan ? : TextSpan ; originalContextSpan ? : TextSpan ; } export interface RenameLocation extends DocumentSpan { readonly prefixText ? : string ; readonly suffixText ? : string ; } export interface ReferenceEntry extends DocumentSpan { isWriteAccess : boolean ; isDefinition : boolean ; isInString ? : true ; } export interface ImplementationLocation extends DocumentSpan { kind : ScriptElementKind ; displayParts : SymbolDisplayPart [ ] ; } export const enum HighlightSpanKind { none = "none" , definition = "definition" , reference = "reference" , writtenReference = "writtenReference" } export interface HighlightSpan { fileName ? : string ; isInString ? : true ; textSpan : TextSpan ; contextSpan ? : TextSpan ; kind : HighlightSpanKind ; } export interface NavigateToItem { name : string ; kind : ScriptElementKind ; kindModifiers : string ; matchKind : "exact" | "prefix" | "substring" | "camelCase" ; isCaseSensitive : boolean ; fileName : string ; textSpan : TextSpan ; containerName : string ; containerKind : ScriptElementKind ; } export enum IndentStyle { None = 0 , Block = 1 , Smart = 2 } export enum SemicolonPreference { Ignore = "ignore" , Insert = "insert" , Remove = "remove" } export interface EditorOptions { BaseIndentSize ? : number ; IndentSize : number ; TabSize : number ; NewLineCharacter : string ; ConvertTabsToSpaces : boolean ; IndentStyle : IndentStyle ; } export interface EditorSettings { baseIndentSize ? : number ; indentSize ? : number ; tabSize ? : number ; newLineCharacter ? : string ; convertTabsToSpaces ? : boolean ; indentStyle ? : IndentStyle ; trimTrailingWhitespace ? : boolean ; } export interface FormatCodeOptions extends EditorOptions { InsertSpaceAfterCommaDelimiter : boolean ; InsertSpaceAfterSemicolonInForStatements : boolean ; InsertSpaceBeforeAndAfterBinaryOperators : boolean ; InsertSpaceAfterConstructor ? : boolean ; InsertSpaceAfterKeywordsInControlFlowStatements : boolean ; InsertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean ; InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean ; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets : boolean ; InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ? : boolean ; InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces : boolean ; InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ? : boolean ; InsertSpaceAfterTypeAssertion ? : boolean ; InsertSpaceBeforeFunctionParenthesis ? : boolean ; PlaceOpenBraceOnNewLineForFunctions : boolean ; PlaceOpenBraceOnNewLineForControlBlocks : boolean ; insertSpaceBeforeTypeAnnotation ? : boolean ; } export interface FormatCodeSettings extends EditorSettings { readonly insertSpaceAfterCommaDelimiter ? : boolean ; readonly insertSpaceAfterSemicolonInForStatements ? : boolean ; readonly insertSpaceBeforeAndAfterBinaryOperators ? : boolean ; readonly insertSpaceAfterConstructor ? : boolean ; readonly insertSpaceAfterKeywordsInControlFlowStatements ? : boolean ; readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces ? : boolean ; readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ? : boolean ; readonly insertSpaceAfterTypeAssertion ? : boolean ; readonly insertSpaceBeforeFunctionParenthesis ? : boolean ; readonly placeOpenBraceOnNewLineForFunctions ? : boolean ; readonly placeOpenBraceOnNewLineForControlBlocks ? : boolean ; readonly insertSpaceBeforeTypeAnnotation ? : boolean ; readonly indentMultiLineObjectLiteralBeginningOnBlankLine ? : boolean ; readonly semicolons ? : SemicolonPreference ; } export function getDefaultFormatCodeSettings ( newLineCharacter ? ) { return { indentSize : 4 , tabSize : 4 , newLineCharacter : newLineCharacter || "\n" , convertTabsToSpaces : true , indentStyle : IndentStyle . Smart , insertSpaceAfterConstructor : false , insertSpaceAfterCommaDelimiter : true , insertSpaceAfterSemicolonInForStatements : true , insertSpaceBeforeAndAfterBinaryOperators : true , insertSpaceAfterKeywordsInControlFlowStatements : true , insertSpaceAfterFunctionKeywordForAnonymousFunctions : false , insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : false , insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets : false , insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces : true , insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces : false , insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces : false , insertSpaceBeforeFunctionParenthesis : false , placeOpenBraceOnNewLineForFunctions : false , placeOpenBraceOnNewLineForControlBlocks : false , semicolons : SemicolonPreference . Ignore , trimTrailingWhitespace : true } ; } export const testFormatSettings = getDefaultFormatCodeSettings ( "\n" ) ; export interface DefinitionInfo extends DocumentSpan { kind : ScriptElementKind ; name : string ; containerKind : ScriptElementKind ; containerName : string ; unverified ? : boolean ; isLocal ? : boolean ; } export interface DefinitionInfoAndBoundSpan { definitions ? : readonly DefinitionInfo [ ] ; textSpan : TextSpan ; } export interface ReferencedSymbolDefinitionInfo extends DefinitionInfo { displayParts : SymbolDisplayPart [ ] ; } export interface ReferencedSymbol { definition : ReferencedSymbolDefinitionInfo ; references : ReferenceEntry [ ] ; } export enum SymbolDisplayPartKind { aliasName , className , enumName , fieldName , interfaceName , keyword , lineBreak , numericLiteral , stringLiteral , localName , methodName , moduleName , operator , parameterName , propertyName , punctuation , space , text , typeParameterName , enumMemberName , functionName , regularExpressionLiteral , link , linkName , linkText } export interface SymbolDisplayPart { text : string ; kind : string ; } export interface JSDocLinkDisplayPart extends SymbolDisplayPart { target : DocumentSpan ; } export interface JSDocTagInfo { name : string ; text ? : SymbolDisplayPart [ ] ; } export interface QuickInfo { kind : ScriptElementKind ; kindModifiers : string ; textSpan : TextSpan ; displayParts ? : SymbolDisplayPart [ ] ; documentation ? : SymbolDisplayPart [ ] ; tags ? : JSDocTagInfo [ ] ; } export type RenameInfo = RenameInfoSuccess | RenameInfoFailure ; export interface RenameInfoSuccess { canRename : true ; /**
         * File or directory to rename.
         * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
         */ fileToRename ? : string ; displayName : string ; fullDisplayName : string ; kind : ScriptElementKind ; kindModifiers : string ; triggerSpan : TextSpan ; } export interface RenameInfoFailure { canRename : false ; localizedErrorMessage : string ; } export interface RenameInfoOptions { readonly allowRenameOfImportPath ? : boolean ; } export interface DocCommentTemplateOptions { readonly generateReturnInDocTemplate ? : boolean ; } export interface SignatureHelpParameter { name : string ; documentation : SymbolDisplayPart [ ] ; displayParts : SymbolDisplayPart [ ] ; isOptional : boolean ; isRest ? : boolean ; } export interface SelectionRange { textSpan : TextSpan ; parent ? : SelectionRange ; } /**
     * 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?'.
     */ export interface SignatureHelpItem { isVariadic : boolean ; prefixDisplayParts : SymbolDisplayPart [ ] ; suffixDisplayParts : SymbolDisplayPart [ ] ; separatorDisplayParts : SymbolDisplayPart [ ] ; parameters : SignatureHelpParameter [ ] ; documentation : SymbolDisplayPart [ ] ; tags : JSDocTagInfo [ ] ; } /**
     * Represents a set of signature help items, and the preferred item that should be selected.
     */ export interface SignatureHelpItems { items : SignatureHelpItem [ ] ; applicableSpan : TextSpan ; selectedItemIndex : number ; argumentIndex : number ; argumentCount : number ; } export interface CompletionInfo { /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion : boolean ; isMemberCompletion : boolean ; /**
         * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use
         * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
         * must be used to commit that completion entry.
         */ optionalReplacementSpan ? : TextSpan ; /**
         * true when the current location also allows for a new identifier
         */ isNewIdentifierLocation : boolean ; /**
         * Indicates to client to continue requesting completions on subsequent keystrokes.
         */ isIncomplete ? : true ; entries : CompletionEntry [ ] ; } export interface CompletionEntryDataAutoImport { /**
         * The name of the property or export in the module's symbol table. Differs from the completion name
         * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
         */ exportName : string ; moduleSpecifier ? : string ; /** The file name declaring the export's module symbol, if it was an external module */ fileName ? : string ; /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */ ambientModuleName ? : string ; /** True if the export was found in the package.json AutoImportProvider */ isPackageJsonImport ? : true ; } export interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport { /** The key in the `ExportMapCache` where the completion entry's `SymbolExportInfo[]` is found */ exportMapKey : string ; } export interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport { moduleSpecifier : string ; } export type CompletionEntryData = CompletionEntryDataUnresolved | CompletionEntryDataResolved ; export interface CompletionEntry { name : string ; kind : ScriptElementKind ; kindModifiers ? : string ; sortText : string ; insertText ? : string ; isSnippet ? : true ; /**
         * An optional span that indicates the text to be replaced by this completion item.
         * If present, this span should be used instead of the default one.
         * It will be set if the required span differs from the one generated by the default replacement behavior.
         */ replacementSpan ? : TextSpan ; hasAction ? : true ; source ? : string ; sourceDisplay ? : SymbolDisplayPart [ ] ; isRecommended ? : true ; isFromUncheckedFile ? : true ; isPackageJsonImport ? : true ; isImportStatementCompletion ? : true ; /**
         * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
         * that allows TS Server to look up the symbol represented by the completion item, disambiguating
         * items with the same name. Currently only defined for auto-import completions, but the type is
         * `unknown` in the protocol, so it can be changed as needed to support other kinds of completions.
         * The presence of this property should generally not be used to assume that this completion entry
         * is an auto-import.
         */ data ? : CompletionEntryData ; } export interface CompletionEntryDetails { name : string ; kind : ScriptElementKind ; kindModifiers : string ; displayParts : SymbolDisplayPart [ ] ; documentation ? : SymbolDisplayPart [ ] ; tags ? : JSDocTagInfo [ ] ; codeActions ? : CodeAction [ ] ; deprecated source ? : SymbolDisplayPart [ ] ; sourceDisplay ? : SymbolDisplayPart [ ] ; } export interface OutliningSpan { /** The span of the document to actually collapse. */ textSpan : TextSpan ; /** The span of the document to display when the user hovers over the collapsed span. */ hintSpan : TextSpan ; /** The text to display in the editor for the collapsed region. */ bannerText : string ; /**
         * Whether or not this region should be automatically collapsed when
         * the 'Collapse to Definitions' command is invoked.
         */ autoCollapse : boolean ; /**
         * Classification of the contents of the span
         */ kind : OutliningSpanKind ; } export const enum OutliningSpanKind { /** Single or multi-line comments */ Comment = "comment" , /** Sections marked by '// #region' and '// #endregion' comments */ Region = "region" , /** Declarations and expressions */ Code = "code" , /** Contiguous blocks of import declarations */ Imports = "imports" } export const enum OutputFileType { JavaScript , SourceMap , Declaration } export const enum EndOfLineState { None , InMultiLineCommentTrivia , InSingleQuoteStringLiteral , InDoubleQuoteStringLiteral , InTemplateHeadOrNoSubstitutionTemplate , InTemplateMiddleOrTail , InTemplateSubstitutionPosition } export enum TokenClass { Punctuation , Keyword , Operator , Comment , Whitespace , Identifier , NumberLiteral , BigIntLiteral , StringLiteral , RegExpLiteral } export interface ClassificationResult { finalLexState : EndOfLineState ; entries : ClassificationInfo [ ] ; } export interface ClassificationInfo { length : number ; classification : TokenClass ; } export interface Classifier { param text param lexState param syntacticClassifierAbsent deprecated getClassificationsForLine ( text , lexState , syntacticClassifierAbsent ) : ClassificationResult ; getEncodedLexicalClassifications ( text , endOfLineState , syntacticClassifierAbsent ) : Classifications ; } export const enum ScriptElementKind { unknown = "" , warning = "warning" , /** predefined type (void) or keyword (class) */ keyword = "keyword" , /** top level script node */ scriptElement = "script" , /** module foo {} */ moduleElement = "module" , /** class X {} */ classElement = "class" , /** var x = class X {} */ localClassElement = "local class" , /** interface Y {} */ interfaceElement = "interface" , /** type T = ... */ typeElement = "type" , /** enum E */ enumElement = "enum" , enumMemberElement = "enum member" , /**
         * Inside module and script only
         * const v = ..
         */ variableElement = "var" , /** Inside function */ localVariableElement = "local var" , /**
         * Inside module and script only
         * function f() { }
         */ functionElement = "function" , /** Inside function */ localFunctionElement = "local function" , /** class X { [public|private]* foo() {} } */ memberFunctionElement = "method" , /** class X { [public|private]* [get|set] foo:number; } */ memberGetAccessorElement = "getter" , memberSetAccessorElement = "setter" , /**
         * class X { [public|private]* foo:number; }
         * interface Y { foo:number; }
         */ memberVariableElement = "property" , /**
         * class X { constructor() { } }
         * class X { static { } }
         */ constructorImplementationElement = "constructor" , /** interface Y { ():number; } */ callSignatureElement = "call" , /** interface Y { []:number; } */ indexSignatureElement = "index" , /** interface Y { new():Y; } */ constructSignatureElement = "construct" , /** function foo(*Y*: string) */ parameterElement = "parameter" , typeParameterElement = "type parameter" , primitiveType = "primitive type" , label = "label" , alias = "alias" , constElement = "const" , letElement = "let" , directory = "directory" , externalModuleName = "external module name" , /**
         * <JsxTagName attribute1 attribute2={0} />
         */ jsxAttribute = "JSX attribute" , /** String literal */ string = "string" , /** Jsdoc @link: in ` C `, the before and after text " {@link " and "} "  link = "link" , /** Jsdoc @link: in ` C `, the entity name "C"  linkName = "link name" , /** Jsdoc @link: in ` C `, the link text "link text"  linkText = "link text" } export const enum ScriptElementKindModifier { none = "" , publicMemberModifier = "public" , privateMemberModifier = "private" , protectedMemberModifier = "protected" , exportedModifier = "export" , ambientModifier = "declare" , staticModifier = "static" , abstractModifier = "abstract" , optionalModifier = "optional" , deprecatedModifier = "deprecated" , dtsModifier = ".d.ts" , tsModifier = ".ts" , tsxModifier = ".tsx" , jsModifier = ".js" , jsxModifier = ".jsx" , jsonModifier = ".json" , dmtsModifier = ".d.mts" , mtsModifier = ".mts" , mjsModifier = ".mjs" , dctsModifier = ".d.cts" , ctsModifier = ".cts" , cjsModifier = ".cjs" } export const enum ClassificationTypeNames { comment = "comment" , identifier = "identifier" , keyword = "keyword" , numericLiteral = "number" , bigintLiteral = "bigint" , operator = "operator" , stringLiteral = "string" , whiteSpace = "whitespace" , text = "text" , punctuation = "punctuation" , className = "class name" , enumName = "enum name" , interfaceName = "interface name" , moduleName = "module name" , typeParameterName = "type parameter name" , typeAliasName = "type alias name" , parameterName = "parameter name" , docCommentTagName = "doc comment tag name" , jsxOpenTagName = "jsx open tag name" , jsxCloseTagName = "jsx close tag name" , jsxSelfClosingTagName = "jsx self closing tag name" , jsxAttribute = "jsx attribute" , jsxText = "jsx text" , jsxAttributeStringLiteralValue = "jsx attribute string literal value" } export const enum ClassificationType { comment = 1 , identifier = 2 , keyword = 3 , numericLiteral = 4 , operator = 5 , stringLiteral = 6 , regularExpressionLiteral = 7 , whiteSpace = 8 , text = 9 , punctuation = 10 , className = 11 , enumName = 12 , interfaceName = 13 , moduleName = 14 , typeParameterName = 15 , typeAliasName = 16 , parameterName = 17 , docCommentTagName = 18 , jsxOpenTagName = 19 , jsxCloseTagName = 20 , jsxSelfClosingTagName = 21 , jsxAttribute = 22 , jsxText = 23 , jsxAttributeStringLiteralValue = 24 , bigintLiteral = 25 } internal export interface CodeFixRegistration { errorCodes : readonly number [ ] ; getCodeActions ( context ) : CodeFixAction [ ] | undefined ; fixIds ? : readonly string [ ] ; getAllCodeActions ? ( context ) : CombinedCodeActions ; } internal export interface CodeFixContextBase extends textChanges . TextChangesContext { sourceFile : SourceFile ; program : Program ; cancellationToken : CancellationToken ; preferences : UserPreferences ; } internal export interface CodeFixAllContext extends CodeFixContextBase { fixId : { } ; } internal export interface CodeFixContext extends CodeFixContextBase { errorCode : number ; span : TextSpan ; } internal export interface Refactor { /** List of action kinds a refactor can provide.
         * Used to skip unnecessary calculation when specific refactors are requested. */ kinds ? : string [ ] ; /** Compute the associated code actions */ getEditsForAction ( context , actionName ) : RefactorEditInfo | undefined ; /** Compute (quickly) which actions are available here */ getAvailableActions ( context ) : readonly ApplicableRefactorInfo [ ] ; } internal export interface RefactorContext extends textChanges . TextChangesContext { file : SourceFile ; startPosition : number ; endPosition ? : number ; program : Program ; cancellationToken ? : CancellationToken ; preferences : UserPreferences ; triggerReason ? : RefactorTriggerReason ; kind ? : string ; } export interface InlayHintsContext { file : SourceFile ; program : Program ; cancellationToken : CancellationToken ; host : LanguageServiceHost ; span : TextSpan ; preferences : InlayHintsOptions ; } }