@@ -29,6 +29,7 @@ declare namespace ts {
2929 contains ( fileName : Path ) : boolean ;
3030 remove ( fileName : Path ) : void ;
3131 forEachValue ( f : ( key : Path , v : T ) => void ) : void ;
32+ getKeys ( ) : Path [ ] ;
3233 clear ( ) : void ;
3334 }
3435 interface TextRange {
@@ -1202,7 +1203,7 @@ declare namespace ts {
12021203 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter
12031204 * will be invoked when writing the JavaScript and declaration files.
12041205 */
1205- emit ( targetSourceFile ?: SourceFile , writeFile ?: WriteFileCallback , cancellationToken ?: CancellationToken ) : EmitResult ;
1206+ emit ( targetSourceFile ?: SourceFile , writeFile ?: WriteFileCallback , cancellationToken ?: CancellationToken , emitOnlyDtsFiles ?: boolean ) : EmitResult ;
12061207 getOptionsDiagnostics ( cancellationToken ?: CancellationToken ) : Diagnostic [ ] ;
12071208 getGlobalDiagnostics ( cancellationToken ?: CancellationToken ) : Diagnostic [ ] ;
12081209 getSyntacticDiagnostics ( sourceFile ?: SourceFile , cancellationToken ?: CancellationToken ) : Diagnostic [ ] ;
@@ -1288,6 +1289,7 @@ declare namespace ts {
12881289 getJsxElementAttributesType ( elementNode : JsxOpeningLikeElement ) : Type ;
12891290 getJsxIntrinsicTagNames ( ) : Symbol [ ] ;
12901291 isOptionalParameter ( node : ParameterDeclaration ) : boolean ;
1292+ getAmbientModules ( ) : Symbol [ ] ;
12911293 }
12921294 interface SymbolDisplayBuilder {
12931295 buildTypeDisplay ( type : Type , writer : SymbolWriter , enclosingDeclaration ?: Node , flags ?: TypeFormatFlags ) : void ;
@@ -1695,6 +1697,7 @@ declare namespace ts {
16951697 raw ?: any ;
16961698 errors : Diagnostic [ ] ;
16971699 wildcardDirectories ?: MapLike < WatchDirectoryFlags > ;
1700+ compileOnSave ?: boolean ;
16981701 }
16991702 enum WatchDirectoryFlags {
17001703 None = 0 ,
@@ -1888,20 +1891,22 @@ declare namespace ts {
18881891 function isExternalModule ( file : SourceFile ) : boolean ;
18891892 function updateSourceFile ( sourceFile : SourceFile , newText : string , textChangeRange : TextChangeRange , aggressiveChecks ?: boolean ) : SourceFile ;
18901893}
1894+ declare namespace ts {
1895+ function classicNameResolver ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
1896+ function nodeModuleNameResolver ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
1897+ function resolveModuleName ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
1898+ }
18911899declare namespace ts {
18921900 /** The version of the TypeScript compiler release */
18931901 const version : string ;
1894- function findConfigFile ( searchPath : string , fileExists : ( fileName : string ) => boolean ) : string ;
1902+ function findConfigFile ( searchPath : string , fileExists : ( fileName : string ) => boolean , configName ?: string ) : string ;
18951903 function resolveTripleslashReference ( moduleName : string , containingFile : string ) : string ;
18961904 /**
18971905 * @param {string | undefined } containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
18981906 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
18991907 * is assumed to be the same as root directory of the project.
19001908 */
19011909 function resolveTypeReferenceDirective ( typeReferenceDirectiveName : string , containingFile : string , options : CompilerOptions , host : ModuleResolutionHost ) : ResolvedTypeReferenceDirectiveWithFailedLookupLocations ;
1902- function resolveModuleName ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
1903- function nodeModuleNameResolver ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
1904- function classicNameResolver ( moduleName : string , containingFile : string , compilerOptions : CompilerOptions , host : ModuleResolutionHost ) : ResolvedModuleWithFailedLookupLocations ;
19051910 function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost ;
19061911 function getPreEmitDiagnostics ( program : Program , sourceFile ?: SourceFile , cancellationToken ?: CancellationToken ) : Diagnostic [ ] ;
19071912 interface FormatDiagnosticsHost {
@@ -1936,7 +1941,7 @@ declare namespace ts {
19361941 * @param fileName The path to the config file
19371942 * @param jsonText The text of the config file
19381943 */
1939- function parseConfigFileTextToJson ( fileName : string , jsonText : string ) : {
1944+ function parseConfigFileTextToJson ( fileName : string , jsonText : string , stripComments ?: boolean ) : {
19401945 config ?: any ;
19411946 error ?: Diagnostic ;
19421947 } ;
@@ -1948,12 +1953,13 @@ declare namespace ts {
19481953 * file to. e.g. outDir
19491954 */
19501955 function parseJsonConfigFileContent ( json : any , host : ParseConfigHost , basePath : string , existingOptions ?: CompilerOptions , configFileName ?: string ) : ParsedCommandLine ;
1956+ function convertCompileOnSaveOptionFromJson ( jsonOption : any , basePath : string , errors : Diagnostic [ ] ) : boolean ;
19511957 function convertCompilerOptionsFromJson ( jsonOptions : any , basePath : string , configFileName ?: string ) : {
19521958 options : CompilerOptions ;
19531959 errors : Diagnostic [ ] ;
19541960 } ;
19551961 function convertTypingOptionsFromJson ( jsonOptions : any , basePath : string , configFileName ?: string ) : {
1956- options : CompilerOptions ;
1962+ options : TypingOptions ;
19571963 errors : Diagnostic [ ] ;
19581964 } ;
19591965}
@@ -2039,6 +2045,20 @@ declare namespace ts {
20392045 ambientExternalModules : string [ ] ;
20402046 isLibFile : boolean ;
20412047 }
2048+ function realizeDiagnostics ( diagnostics : Diagnostic [ ] , newLine : string ) : {
2049+ message : string ;
2050+ start : number ;
2051+ length : number ;
2052+ category : string ;
2053+ code : number ;
2054+ } [ ] ;
2055+ function realizeDiagnostic ( diagnostic : Diagnostic , newLine : string ) : {
2056+ message : string ;
2057+ start : number ;
2058+ length : number ;
2059+ category : string ;
2060+ code : number ;
2061+ } ;
20422062 interface HostCancellationToken {
20432063 isCancellationRequested ( ) : boolean ;
20442064 }
@@ -2058,6 +2078,9 @@ declare namespace ts {
20582078 trace ?( s : string ) : void ;
20592079 error ?( s : string ) : void ;
20602080 useCaseSensitiveFileNames ?( ) : boolean ;
2081+ readDirectory ?( path : string , extensions ?: string [ ] , exclude ?: string [ ] , include ?: string [ ] ) : string [ ] ;
2082+ readFile ?( path : string , encoding ?: string ) : string ;
2083+ fileExists ?( path : string ) : boolean ;
20612084 resolveModuleNames ?( moduleNames : string [ ] , containingFile : string ) : ResolvedModule [ ] ;
20622085 resolveTypeReferenceDirectives ?( typeDirectiveNames : string [ ] , containingFile : string ) : ResolvedTypeReferenceDirective [ ] ;
20632086 directoryExists ?( directoryName : string ) : boolean ;
@@ -2093,18 +2116,18 @@ declare namespace ts {
20932116 getDocumentHighlights ( fileName : string , position : number , filesToSearch : string [ ] ) : DocumentHighlights [ ] ;
20942117 /** @deprecated */
20952118 getOccurrencesAtPosition ( fileName : string , position : number ) : ReferenceEntry [ ] ;
2096- getNavigateToItems ( searchValue : string , maxResultCount ?: number ) : NavigateToItem [ ] ;
2119+ getNavigateToItems ( searchValue : string , maxResultCount ?: number , excludeDts ?: boolean ) : NavigateToItem [ ] ;
20972120 getNavigationBarItems ( fileName : string ) : NavigationBarItem [ ] ;
20982121 getOutliningSpans ( fileName : string ) : OutliningSpan [ ] ;
20992122 getTodoComments ( fileName : string , descriptors : TodoCommentDescriptor [ ] ) : TodoComment [ ] ;
21002123 getBraceMatchingAtPosition ( fileName : string , position : number ) : TextSpan [ ] ;
2101- getIndentationAtPosition ( fileName : string , position : number , options : EditorOptions ) : number ;
2102- getFormattingEditsForRange ( fileName : string , start : number , end : number , options : FormatCodeOptions ) : TextChange [ ] ;
2103- getFormattingEditsForDocument ( fileName : string , options : FormatCodeOptions ) : TextChange [ ] ;
2104- getFormattingEditsAfterKeystroke ( fileName : string , position : number , key : string , options : FormatCodeOptions ) : TextChange [ ] ;
2124+ getIndentationAtPosition ( fileName : string , position : number , options : EditorOptions | EditorSettings ) : number ;
2125+ getFormattingEditsForRange ( fileName : string , start : number , end : number , options : FormatCodeOptions | FormatCodeSettings ) : TextChange [ ] ;
2126+ getFormattingEditsForDocument ( fileName : string , options : FormatCodeOptions | FormatCodeSettings ) : TextChange [ ] ;
2127+ getFormattingEditsAfterKeystroke ( fileName : string , position : number , key : string , options : FormatCodeOptions | FormatCodeSettings ) : TextChange [ ] ;
21052128 getDocCommentTemplateAtPosition ( fileName : string , position : number ) : TextInsertion ;
21062129 isValidBraceCompletionAtPosition ( fileName : string , position : number , openingBrace : number ) : boolean ;
2107- getEmitOutput ( fileName : string ) : EmitOutput ;
2130+ getEmitOutput ( fileName : string , emitOnlyDtsFiles ?: boolean ) : EmitOutput ;
21082131 getProgram ( ) : Program ;
21092132 dispose ( ) : void ;
21102133 }
@@ -2188,6 +2211,14 @@ declare namespace ts {
21882211 ConvertTabsToSpaces : boolean ;
21892212 IndentStyle : IndentStyle ;
21902213 }
2214+ interface EditorSettings {
2215+ baseIndentSize ?: number ;
2216+ indentSize : number ;
2217+ tabSize : number ;
2218+ newLineCharacter : string ;
2219+ convertTabsToSpaces : boolean ;
2220+ indentStyle : IndentStyle ;
2221+ }
21912222 enum IndentStyle {
21922223 None = 0 ,
21932224 Block = 1 ,
@@ -2205,8 +2236,21 @@ declare namespace ts {
22052236 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ?: boolean ;
22062237 PlaceOpenBraceOnNewLineForFunctions : boolean ;
22072238 PlaceOpenBraceOnNewLineForControlBlocks : boolean ;
2208- [ s : string ] : boolean | number | string | undefined ;
22092239 }
2240+ interface FormatCodeSettings extends EditorSettings {
2241+ insertSpaceAfterCommaDelimiter : boolean ;
2242+ insertSpaceAfterSemicolonInForStatements : boolean ;
2243+ insertSpaceBeforeAndAfterBinaryOperators : boolean ;
2244+ insertSpaceAfterKeywordsInControlFlowStatements : boolean ;
2245+ insertSpaceAfterFunctionKeywordForAnonymousFunctions : boolean ;
2246+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : boolean ;
2247+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets : boolean ;
2248+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces : boolean ;
2249+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces : boolean ;
2250+ placeOpenBraceOnNewLineForFunctions : boolean ;
2251+ placeOpenBraceOnNewLineForControlBlocks : boolean ;
2252+ }
2253+ function toEditorSettings ( options : EditorOptions | EditorSettings ) : EditorSettings ;
22102254 interface DefinitionInfo {
22112255 fileName : string ;
22122256 textSpan : TextSpan ;
@@ -2215,8 +2259,11 @@ declare namespace ts {
22152259 containerKind : string ;
22162260 containerName : string ;
22172261 }
2262+ interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
2263+ displayParts : SymbolDisplayPart [ ] ;
2264+ }
22182265 interface ReferencedSymbol {
2219- definition : DefinitionInfo ;
2266+ definition : ReferencedSymbolDefinitionInfo ;
22202267 references : ReferenceEntry [ ] ;
22212268 }
22222269 enum SymbolDisplayPartKind {
@@ -2304,6 +2351,12 @@ declare namespace ts {
23042351 kind : string ;
23052352 kindModifiers : string ;
23062353 sortText : string ;
2354+ /**
2355+ * An optional span that indicates the text to be replaced by this completion item. It will be
2356+ * set if the required span differs from the one generated by the default replacement behavior and should
2357+ * be used in that case
2358+ */
2359+ replacementSpan ?: TextSpan ;
23072360 }
23082361 interface CompletionEntryDetails {
23092362 name : string ;
@@ -2514,6 +2567,8 @@ declare namespace ts {
25142567 const alias : string ;
25152568 const constElement : string ;
25162569 const letElement : string ;
2570+ const directory : string ;
2571+ const externalModuleName : string ;
25172572 }
25182573 namespace ScriptElementKindModifier {
25192574 const none : string ;
0 commit comments