typescript.d.ts (588085B)
1 /*! ***************************************************************************** 2 Copyright (c) Microsoft Corporation. All rights reserved. 3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 this file except in compliance with the License. You may obtain a copy of the 5 License at http://www.apache.org/licenses/LICENSE-2.0 6 7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 MERCHANTABLITY OR NON-INFRINGEMENT. 11 12 See the Apache Version 2.0 License for specific language governing permissions 13 and limitations under the License. 14 ***************************************************************************** */ 15 16 declare namespace ts { 17 namespace server { 18 namespace protocol { 19 export import ApplicableRefactorInfo = ts.ApplicableRefactorInfo; 20 export import ClassificationType = ts.ClassificationType; 21 export import CompletionsTriggerCharacter = ts.CompletionsTriggerCharacter; 22 export import CompletionTriggerKind = ts.CompletionTriggerKind; 23 export import InlayHintKind = ts.InlayHintKind; 24 export import OrganizeImportsMode = ts.OrganizeImportsMode; 25 export import RefactorActionInfo = ts.RefactorActionInfo; 26 export import RefactorTriggerReason = ts.RefactorTriggerReason; 27 export import RenameInfoFailure = ts.RenameInfoFailure; 28 export import SemicolonPreference = ts.SemicolonPreference; 29 export import SignatureHelpCharacterTypedReason = ts.SignatureHelpCharacterTypedReason; 30 export import SignatureHelpInvokedReason = ts.SignatureHelpInvokedReason; 31 export import SignatureHelpParameter = ts.SignatureHelpParameter; 32 export import SignatureHelpRetriggerCharacter = ts.SignatureHelpRetriggerCharacter; 33 export import SignatureHelpRetriggeredReason = ts.SignatureHelpRetriggeredReason; 34 export import SignatureHelpTriggerCharacter = ts.SignatureHelpTriggerCharacter; 35 export import SignatureHelpTriggerReason = ts.SignatureHelpTriggerReason; 36 export import SymbolDisplayPart = ts.SymbolDisplayPart; 37 export import UserPreferences = ts.UserPreferences; 38 type ChangePropertyTypes< 39 T, 40 Substitutions extends { 41 [K in keyof T]?: any; 42 }, 43 > = { 44 [K in keyof T]: K extends keyof Substitutions ? Substitutions[K] : T[K]; 45 }; 46 type ChangeStringIndexSignature<T, NewStringIndexSignatureType> = { 47 [K in keyof T]: string extends K ? NewStringIndexSignatureType : T[K]; 48 }; 49 export enum CommandTypes { 50 JsxClosingTag = "jsxClosingTag", 51 LinkedEditingRange = "linkedEditingRange", 52 Brace = "brace", 53 BraceCompletion = "braceCompletion", 54 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", 55 Change = "change", 56 Close = "close", 57 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */ 58 Completions = "completions", 59 CompletionInfo = "completionInfo", 60 CompletionDetails = "completionEntryDetails", 61 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", 62 CompileOnSaveEmitFile = "compileOnSaveEmitFile", 63 Configure = "configure", 64 Definition = "definition", 65 DefinitionAndBoundSpan = "definitionAndBoundSpan", 66 Implementation = "implementation", 67 Exit = "exit", 68 FileReferences = "fileReferences", 69 Format = "format", 70 Formatonkey = "formatonkey", 71 Geterr = "geterr", 72 GeterrForProject = "geterrForProject", 73 SemanticDiagnosticsSync = "semanticDiagnosticsSync", 74 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", 75 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", 76 NavBar = "navbar", 77 Navto = "navto", 78 NavTree = "navtree", 79 NavTreeFull = "navtree-full", 80 DocumentHighlights = "documentHighlights", 81 Open = "open", 82 Quickinfo = "quickinfo", 83 References = "references", 84 Reload = "reload", 85 Rename = "rename", 86 Saveto = "saveto", 87 SignatureHelp = "signatureHelp", 88 FindSourceDefinition = "findSourceDefinition", 89 Status = "status", 90 TypeDefinition = "typeDefinition", 91 ProjectInfo = "projectInfo", 92 ReloadProjects = "reloadProjects", 93 Unknown = "unknown", 94 OpenExternalProject = "openExternalProject", 95 OpenExternalProjects = "openExternalProjects", 96 CloseExternalProject = "closeExternalProject", 97 UpdateOpen = "updateOpen", 98 GetOutliningSpans = "getOutliningSpans", 99 TodoComments = "todoComments", 100 Indentation = "indentation", 101 DocCommentTemplate = "docCommentTemplate", 102 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", 103 GetCodeFixes = "getCodeFixes", 104 GetCombinedCodeFix = "getCombinedCodeFix", 105 ApplyCodeActionCommand = "applyCodeActionCommand", 106 GetSupportedCodeFixes = "getSupportedCodeFixes", 107 GetApplicableRefactors = "getApplicableRefactors", 108 GetEditsForRefactor = "getEditsForRefactor", 109 GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions", 110 PreparePasteEdits = "preparePasteEdits", 111 GetPasteEdits = "getPasteEdits", 112 OrganizeImports = "organizeImports", 113 GetEditsForFileRename = "getEditsForFileRename", 114 ConfigurePlugin = "configurePlugin", 115 SelectionRange = "selectionRange", 116 ToggleLineComment = "toggleLineComment", 117 ToggleMultilineComment = "toggleMultilineComment", 118 CommentSelection = "commentSelection", 119 UncommentSelection = "uncommentSelection", 120 PrepareCallHierarchy = "prepareCallHierarchy", 121 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls", 122 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls", 123 ProvideInlayHints = "provideInlayHints", 124 WatchChange = "watchChange", 125 MapCode = "mapCode", 126 } 127 /** 128 * A TypeScript Server message 129 */ 130 export interface Message { 131 /** 132 * Sequence number of the message 133 */ 134 seq: number; 135 /** 136 * One of "request", "response", or "event" 137 */ 138 type: "request" | "response" | "event"; 139 } 140 /** 141 * Client-initiated request message 142 */ 143 export interface Request extends Message { 144 type: "request"; 145 /** 146 * The command to execute 147 */ 148 command: string; 149 /** 150 * Object containing arguments for the command 151 */ 152 arguments?: any; 153 } 154 /** 155 * Request to reload the project structure for all the opened files 156 */ 157 export interface ReloadProjectsRequest extends Request { 158 command: CommandTypes.ReloadProjects; 159 } 160 /** 161 * Server-initiated event message 162 */ 163 export interface Event extends Message { 164 type: "event"; 165 /** 166 * Name of event 167 */ 168 event: string; 169 /** 170 * Event-specific information 171 */ 172 body?: any; 173 } 174 /** 175 * Response by server to client request message. 176 */ 177 export interface Response extends Message { 178 type: "response"; 179 /** 180 * Sequence number of the request message. 181 */ 182 request_seq: number; 183 /** 184 * Outcome of the request. 185 */ 186 success: boolean; 187 /** 188 * The command requested. 189 */ 190 command: string; 191 /** 192 * If success === false, this should always be provided. 193 * Otherwise, may (or may not) contain a success message. 194 */ 195 message?: string; 196 /** 197 * Contains message body if success === true. 198 */ 199 body?: any; 200 /** 201 * Contains extra information that plugin can include to be passed on 202 */ 203 metadata?: unknown; 204 /** 205 * Exposes information about the performance of this request-response pair. 206 */ 207 performanceData?: PerformanceData; 208 } 209 export interface PerformanceData { 210 /** 211 * Time spent updating the program graph, in milliseconds. 212 */ 213 updateGraphDurationMs?: number; 214 /** 215 * The time spent creating or updating the auto-import program, in milliseconds. 216 */ 217 createAutoImportProviderProgramDurationMs?: number; 218 /** 219 * The time spent computing diagnostics, in milliseconds. 220 */ 221 diagnosticsDuration?: FileDiagnosticPerformanceData[]; 222 } 223 /** 224 * Time spent computing each kind of diagnostics, in milliseconds. 225 */ 226 export type DiagnosticPerformanceData = { 227 [Kind in DiagnosticEventKind]?: number; 228 }; 229 export interface FileDiagnosticPerformanceData extends DiagnosticPerformanceData { 230 /** 231 * The file for which the performance data is reported. 232 */ 233 file: string; 234 } 235 /** 236 * Arguments for FileRequest messages. 237 */ 238 export interface FileRequestArgs { 239 /** 240 * The file for the request (absolute pathname required). 241 */ 242 file: string; 243 projectFileName?: string; 244 } 245 export interface StatusRequest extends Request { 246 command: CommandTypes.Status; 247 } 248 export interface StatusResponseBody { 249 /** 250 * The TypeScript version (`ts.version`). 251 */ 252 version: string; 253 } 254 /** 255 * Response to StatusRequest 256 */ 257 export interface StatusResponse extends Response { 258 body: StatusResponseBody; 259 } 260 /** 261 * Requests a JS Doc comment template for a given position 262 */ 263 export interface DocCommentTemplateRequest extends FileLocationRequest { 264 command: CommandTypes.DocCommentTemplate; 265 } 266 /** 267 * Response to DocCommentTemplateRequest 268 */ 269 export interface DocCommandTemplateResponse extends Response { 270 body?: TextInsertion; 271 } 272 /** 273 * A request to get TODO comments from the file 274 */ 275 export interface TodoCommentRequest extends FileRequest { 276 command: CommandTypes.TodoComments; 277 arguments: TodoCommentRequestArgs; 278 } 279 /** 280 * Arguments for TodoCommentRequest request. 281 */ 282 export interface TodoCommentRequestArgs extends FileRequestArgs { 283 /** 284 * Array of target TodoCommentDescriptors that describes TODO comments to be found 285 */ 286 descriptors: TodoCommentDescriptor[]; 287 } 288 /** 289 * Response for TodoCommentRequest request. 290 */ 291 export interface TodoCommentsResponse extends Response { 292 body?: TodoComment[]; 293 } 294 /** 295 * A request to determine if the caret is inside a comment. 296 */ 297 export interface SpanOfEnclosingCommentRequest extends FileLocationRequest { 298 command: CommandTypes.GetSpanOfEnclosingComment; 299 arguments: SpanOfEnclosingCommentRequestArgs; 300 } 301 export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs { 302 /** 303 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined. 304 */ 305 onlyMultiLine: boolean; 306 } 307 /** 308 * Request to obtain outlining spans in file. 309 */ 310 export interface OutliningSpansRequest extends FileRequest { 311 command: CommandTypes.GetOutliningSpans; 312 } 313 export type OutliningSpan = ChangePropertyTypes<ts.OutliningSpan, { 314 textSpan: TextSpan; 315 hintSpan: TextSpan; 316 }>; 317 /** 318 * Response to OutliningSpansRequest request. 319 */ 320 export interface OutliningSpansResponse extends Response { 321 body?: OutliningSpan[]; 322 } 323 /** 324 * A request to get indentation for a location in file 325 */ 326 export interface IndentationRequest extends FileLocationRequest { 327 command: CommandTypes.Indentation; 328 arguments: IndentationRequestArgs; 329 } 330 /** 331 * Response for IndentationRequest request. 332 */ 333 export interface IndentationResponse extends Response { 334 body?: IndentationResult; 335 } 336 /** 337 * Indentation result representing where indentation should be placed 338 */ 339 export interface IndentationResult { 340 /** 341 * The base position in the document that the indent should be relative to 342 */ 343 position: number; 344 /** 345 * The number of columns the indent should be at relative to the position's column. 346 */ 347 indentation: number; 348 } 349 /** 350 * Arguments for IndentationRequest request. 351 */ 352 export interface IndentationRequestArgs extends FileLocationRequestArgs { 353 /** 354 * An optional set of settings to be used when computing indentation. 355 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings. 356 */ 357 options?: EditorSettings; 358 } 359 /** 360 * Arguments for ProjectInfoRequest request. 361 */ 362 export interface ProjectInfoRequestArgs extends FileRequestArgs { 363 /** 364 * Indicate if the file name list of the project is needed 365 */ 366 needFileNameList: boolean; 367 /** 368 * if true returns details about default configured project calculation 369 */ 370 needDefaultConfiguredProjectInfo?: boolean; 371 } 372 /** 373 * A request to get the project information of the current file. 374 */ 375 export interface ProjectInfoRequest extends Request { 376 command: CommandTypes.ProjectInfo; 377 arguments: ProjectInfoRequestArgs; 378 } 379 /** 380 * A request to retrieve compiler options diagnostics for a project 381 */ 382 export interface CompilerOptionsDiagnosticsRequest extends Request { 383 arguments: CompilerOptionsDiagnosticsRequestArgs; 384 } 385 /** 386 * Arguments for CompilerOptionsDiagnosticsRequest request. 387 */ 388 export interface CompilerOptionsDiagnosticsRequestArgs { 389 /** 390 * Name of the project to retrieve compiler options diagnostics. 391 */ 392 projectFileName: string; 393 } 394 /** 395 * Details about the default project for the file if tsconfig file is found 396 */ 397 export interface DefaultConfiguredProjectInfo { 398 /** List of config files looked and did not match because file was not part of root file names */ 399 notMatchedByConfig?: readonly string[]; 400 /** List of projects which were loaded but file was not part of the project or is file from referenced project */ 401 notInProject?: readonly string[]; 402 /** Configured project used as default */ 403 defaultProject?: string; 404 } 405 /** 406 * Response message body for "projectInfo" request 407 */ 408 export interface ProjectInfo { 409 /** 410 * For configured project, this is the normalized path of the 'tsconfig.json' file 411 * For inferred project, this is undefined 412 */ 413 configFileName: string; 414 /** 415 * The list of normalized file name in the project, including 'lib.d.ts' 416 */ 417 fileNames?: string[]; 418 /** 419 * Indicates if the project has a active language service instance 420 */ 421 languageServiceDisabled?: boolean; 422 /** 423 * Information about default project 424 */ 425 configuredProjectInfo?: DefaultConfiguredProjectInfo; 426 } 427 /** 428 * Represents diagnostic info that includes location of diagnostic in two forms 429 * - start position and length of the error span 430 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span. 431 */ 432 export interface DiagnosticWithLinePosition { 433 message: string; 434 start: number; 435 length: number; 436 startLocation: Location; 437 endLocation: Location; 438 category: string; 439 code: number; 440 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ 441 reportsUnnecessary?: {}; 442 reportsDeprecated?: {}; 443 relatedInformation?: DiagnosticRelatedInformation[]; 444 } 445 /** 446 * Response message for "projectInfo" request 447 */ 448 export interface ProjectInfoResponse extends Response { 449 body?: ProjectInfo; 450 } 451 /** 452 * Request whose sole parameter is a file name. 453 */ 454 export interface FileRequest extends Request { 455 arguments: FileRequestArgs; 456 } 457 /** 458 * Instances of this interface specify a location in a source file: 459 * (file, line, character offset), where line and character offset are 1-based. 460 */ 461 export interface FileLocationRequestArgs extends FileRequestArgs { 462 /** 463 * The line number for the request (1-based). 464 */ 465 line: number; 466 /** 467 * The character offset (on the line) for the request (1-based). 468 */ 469 offset: number; 470 } 471 export type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs; 472 /** 473 * Request refactorings at a given position or selection area. 474 */ 475 export interface GetApplicableRefactorsRequest extends Request { 476 command: CommandTypes.GetApplicableRefactors; 477 arguments: GetApplicableRefactorsRequestArgs; 478 } 479 export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & { 480 triggerReason?: RefactorTriggerReason; 481 kind?: string; 482 /** 483 * Include refactor actions that require additional arguments to be passed when 484 * calling 'GetEditsForRefactor'. When true, clients should inspect the 485 * `isInteractive` property of each returned `RefactorActionInfo` 486 * and ensure they are able to collect the appropriate arguments for any 487 * interactive refactor before offering it. 488 */ 489 includeInteractiveActions?: boolean; 490 }; 491 /** 492 * Response is a list of available refactorings. 493 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring 494 */ 495 export interface GetApplicableRefactorsResponse extends Response { 496 body?: ApplicableRefactorInfo[]; 497 } 498 /** 499 * Request refactorings at a given position or selection area to move to an existing file. 500 */ 501 export interface GetMoveToRefactoringFileSuggestionsRequest extends Request { 502 command: CommandTypes.GetMoveToRefactoringFileSuggestions; 503 arguments: GetMoveToRefactoringFileSuggestionsRequestArgs; 504 } 505 export type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & { 506 kind?: string; 507 }; 508 /** 509 * Response is a list of available files. 510 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring 511 */ 512 export interface GetMoveToRefactoringFileSuggestions extends Response { 513 body: { 514 newFileName: string; 515 files: string[]; 516 }; 517 } 518 /** 519 * Request to check if `pasteEdits` should be provided for a given location post copying text from that location. 520 */ 521 export interface PreparePasteEditsRequest extends FileRequest { 522 command: CommandTypes.PreparePasteEdits; 523 arguments: PreparePasteEditsRequestArgs; 524 } 525 export interface PreparePasteEditsRequestArgs extends FileRequestArgs { 526 copiedTextSpan: TextSpan[]; 527 } 528 export interface PreparePasteEditsResponse extends Response { 529 body: boolean; 530 } 531 /** 532 * Request refactorings at a given position post pasting text from some other location. 533 */ 534 export interface GetPasteEditsRequest extends Request { 535 command: CommandTypes.GetPasteEdits; 536 arguments: GetPasteEditsRequestArgs; 537 } 538 export interface GetPasteEditsRequestArgs extends FileRequestArgs { 539 /** The text that gets pasted in a file. */ 540 pastedText: string[]; 541 /** Locations of where the `pastedText` gets added in a file. If the length of the `pastedText` and `pastedLocations` are not the same, 542 * then the `pastedText` is combined into one and added at all the `pastedLocations`. 543 */ 544 pasteLocations: TextSpan[]; 545 /** The source location of each `pastedText`. If present, the length of `spans` must be equal to the length of `pastedText`. */ 546 copiedFrom?: { 547 file: string; 548 spans: TextSpan[]; 549 }; 550 } 551 export interface GetPasteEditsResponse extends Response { 552 body: PasteEditsAction; 553 } 554 export interface PasteEditsAction { 555 edits: FileCodeEdits[]; 556 fixId?: {}; 557 } 558 export interface GetEditsForRefactorRequest extends Request { 559 command: CommandTypes.GetEditsForRefactor; 560 arguments: GetEditsForRefactorRequestArgs; 561 } 562 /** 563 * Request the edits that a particular refactoring action produces. 564 * Callers must specify the name of the refactor and the name of the action. 565 */ 566 export type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & { 567 refactor: string; 568 action: string; 569 interactiveRefactorArguments?: InteractiveRefactorArguments; 570 }; 571 export interface GetEditsForRefactorResponse extends Response { 572 body?: RefactorEditInfo; 573 } 574 export interface RefactorEditInfo { 575 edits: FileCodeEdits[]; 576 /** 577 * An optional location where the editor should start a rename operation once 578 * the refactoring edits have been applied 579 */ 580 renameLocation?: Location; 581 renameFilename?: string; 582 notApplicableReason?: string; 583 } 584 /** 585 * Organize imports by: 586 * 1) Removing unused imports 587 * 2) Coalescing imports from the same module 588 * 3) Sorting imports 589 */ 590 export interface OrganizeImportsRequest extends Request { 591 command: CommandTypes.OrganizeImports; 592 arguments: OrganizeImportsRequestArgs; 593 } 594 export type OrganizeImportsScope = GetCombinedCodeFixScope; 595 export interface OrganizeImportsRequestArgs { 596 scope: OrganizeImportsScope; 597 /** @deprecated Use `mode` instead */ 598 skipDestructiveCodeActions?: boolean; 599 mode?: OrganizeImportsMode; 600 } 601 export interface OrganizeImportsResponse extends Response { 602 body: readonly FileCodeEdits[]; 603 } 604 export interface GetEditsForFileRenameRequest extends Request { 605 command: CommandTypes.GetEditsForFileRename; 606 arguments: GetEditsForFileRenameRequestArgs; 607 } 608 /** Note: Paths may also be directories. */ 609 export interface GetEditsForFileRenameRequestArgs { 610 readonly oldFilePath: string; 611 readonly newFilePath: string; 612 } 613 export interface GetEditsForFileRenameResponse extends Response { 614 body: readonly FileCodeEdits[]; 615 } 616 /** 617 * Request for the available codefixes at a specific position. 618 */ 619 export interface CodeFixRequest extends Request { 620 command: CommandTypes.GetCodeFixes; 621 arguments: CodeFixRequestArgs; 622 } 623 export interface GetCombinedCodeFixRequest extends Request { 624 command: CommandTypes.GetCombinedCodeFix; 625 arguments: GetCombinedCodeFixRequestArgs; 626 } 627 export interface GetCombinedCodeFixResponse extends Response { 628 body: CombinedCodeActions; 629 } 630 export interface ApplyCodeActionCommandRequest extends Request { 631 command: CommandTypes.ApplyCodeActionCommand; 632 arguments: ApplyCodeActionCommandRequestArgs; 633 } 634 export interface ApplyCodeActionCommandResponse extends Response { 635 } 636 export interface FileRangeRequestArgs extends FileRequestArgs, FileRange { 637 } 638 /** 639 * Instances of this interface specify errorcodes on a specific location in a sourcefile. 640 */ 641 export interface CodeFixRequestArgs extends FileRangeRequestArgs { 642 /** 643 * Errorcodes we want to get the fixes for. 644 */ 645 errorCodes: readonly number[]; 646 } 647 export interface GetCombinedCodeFixRequestArgs { 648 scope: GetCombinedCodeFixScope; 649 fixId: {}; 650 } 651 export interface GetCombinedCodeFixScope { 652 type: "file"; 653 args: FileRequestArgs; 654 } 655 export interface ApplyCodeActionCommandRequestArgs { 656 /** May also be an array of commands. */ 657 command: {}; 658 } 659 /** 660 * Response for GetCodeFixes request. 661 */ 662 export interface GetCodeFixesResponse extends Response { 663 body?: CodeAction[]; 664 } 665 /** 666 * A request whose arguments specify a file location (file, line, col). 667 */ 668 export interface FileLocationRequest extends FileRequest { 669 arguments: FileLocationRequestArgs; 670 } 671 /** 672 * A request to get codes of supported code fixes. 673 */ 674 export interface GetSupportedCodeFixesRequest extends Request { 675 command: CommandTypes.GetSupportedCodeFixes; 676 arguments?: Partial<FileRequestArgs>; 677 } 678 /** 679 * A response for GetSupportedCodeFixesRequest request. 680 */ 681 export interface GetSupportedCodeFixesResponse extends Response { 682 /** 683 * List of error codes supported by the server. 684 */ 685 body?: string[]; 686 } 687 /** 688 * A request to get encoded semantic classifications for a span in the file 689 */ 690 export interface EncodedSemanticClassificationsRequest extends FileRequest { 691 arguments: EncodedSemanticClassificationsRequestArgs; 692 } 693 /** 694 * Arguments for EncodedSemanticClassificationsRequest request. 695 */ 696 export interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs { 697 /** 698 * Start position of the span. 699 */ 700 start: number; 701 /** 702 * Length of the span. 703 */ 704 length: number; 705 /** 706 * Optional parameter for the semantic highlighting response, if absent it 707 * defaults to "original". 708 */ 709 format?: "original" | "2020"; 710 } 711 /** The response for a EncodedSemanticClassificationsRequest */ 712 export interface EncodedSemanticClassificationsResponse extends Response { 713 body?: EncodedSemanticClassificationsResponseBody; 714 } 715 /** 716 * Implementation response message. Gives series of text spans depending on the format ar. 717 */ 718 export interface EncodedSemanticClassificationsResponseBody { 719 endOfLineState: EndOfLineState; 720 spans: number[]; 721 } 722 /** 723 * Arguments in document highlight request; include: filesToSearch, file, 724 * line, offset. 725 */ 726 export interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { 727 /** 728 * List of files to search for document highlights. 729 */ 730 filesToSearch: string[]; 731 } 732 /** 733 * Go to definition request; value of command field is 734 * "definition". Return response giving the file locations that 735 * define the symbol found in file at location line, col. 736 */ 737 export interface DefinitionRequest extends FileLocationRequest { 738 command: CommandTypes.Definition; 739 } 740 export interface DefinitionAndBoundSpanRequest extends FileLocationRequest { 741 readonly command: CommandTypes.DefinitionAndBoundSpan; 742 } 743 export interface FindSourceDefinitionRequest extends FileLocationRequest { 744 readonly command: CommandTypes.FindSourceDefinition; 745 } 746 export interface DefinitionAndBoundSpanResponse extends Response { 747 readonly body: DefinitionInfoAndBoundSpan; 748 } 749 /** 750 * Go to type request; value of command field is 751 * "typeDefinition". Return response giving the file locations that 752 * define the type for the symbol found in file at location line, col. 753 */ 754 export interface TypeDefinitionRequest extends FileLocationRequest { 755 command: CommandTypes.TypeDefinition; 756 } 757 /** 758 * Go to implementation request; value of command field is 759 * "implementation". Return response giving the file locations that 760 * implement the symbol found in file at location line, col. 761 */ 762 export interface ImplementationRequest extends FileLocationRequest { 763 command: CommandTypes.Implementation; 764 } 765 /** 766 * Location in source code expressed as (one-based) line and (one-based) column offset. 767 */ 768 export interface Location { 769 line: number; 770 offset: number; 771 } 772 /** 773 * Object found in response messages defining a span of text in source code. 774 */ 775 export interface TextSpan { 776 /** 777 * First character of the definition. 778 */ 779 start: Location; 780 /** 781 * One character past last character of the definition. 782 */ 783 end: Location; 784 } 785 /** 786 * Object found in response messages defining a span of text in a specific source file. 787 */ 788 export interface FileSpan extends TextSpan { 789 /** 790 * File containing text span. 791 */ 792 file: string; 793 } 794 export interface JSDocTagInfo { 795 /** Name of the JSDoc tag */ 796 name: string; 797 /** 798 * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment 799 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise. 800 */ 801 text?: string | SymbolDisplayPart[]; 802 } 803 export interface TextSpanWithContext extends TextSpan { 804 contextStart?: Location; 805 contextEnd?: Location; 806 } 807 export interface FileSpanWithContext extends FileSpan, TextSpanWithContext { 808 } 809 export interface DefinitionInfo extends FileSpanWithContext { 810 /** 811 * When true, the file may or may not exist. 812 */ 813 unverified?: boolean; 814 } 815 export interface DefinitionInfoAndBoundSpan { 816 definitions: readonly DefinitionInfo[]; 817 textSpan: TextSpan; 818 } 819 /** 820 * Definition response message. Gives text range for definition. 821 */ 822 export interface DefinitionResponse extends Response { 823 body?: DefinitionInfo[]; 824 } 825 export interface DefinitionInfoAndBoundSpanResponse extends Response { 826 body?: DefinitionInfoAndBoundSpan; 827 } 828 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */ 829 export type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse; 830 /** 831 * Definition response message. Gives text range for definition. 832 */ 833 export interface TypeDefinitionResponse extends Response { 834 body?: FileSpanWithContext[]; 835 } 836 /** 837 * Implementation response message. Gives text range for implementations. 838 */ 839 export interface ImplementationResponse extends Response { 840 body?: FileSpanWithContext[]; 841 } 842 /** 843 * Request to get brace completion for a location in the file. 844 */ 845 export interface BraceCompletionRequest extends FileLocationRequest { 846 command: CommandTypes.BraceCompletion; 847 arguments: BraceCompletionRequestArgs; 848 } 849 /** 850 * Argument for BraceCompletionRequest request. 851 */ 852 export interface BraceCompletionRequestArgs extends FileLocationRequestArgs { 853 /** 854 * Kind of opening brace 855 */ 856 openingBrace: string; 857 } 858 export interface JsxClosingTagRequest extends FileLocationRequest { 859 readonly command: CommandTypes.JsxClosingTag; 860 readonly arguments: JsxClosingTagRequestArgs; 861 } 862 export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs { 863 } 864 export interface JsxClosingTagResponse extends Response { 865 readonly body: TextInsertion; 866 } 867 export interface LinkedEditingRangeRequest extends FileLocationRequest { 868 readonly command: CommandTypes.LinkedEditingRange; 869 } 870 export interface LinkedEditingRangesBody { 871 ranges: TextSpan[]; 872 wordPattern?: string; 873 } 874 export interface LinkedEditingRangeResponse extends Response { 875 readonly body: LinkedEditingRangesBody; 876 } 877 /** 878 * Get document highlights request; value of command field is 879 * "documentHighlights". Return response giving spans that are relevant 880 * in the file at a given line and column. 881 */ 882 export interface DocumentHighlightsRequest extends FileLocationRequest { 883 command: CommandTypes.DocumentHighlights; 884 arguments: DocumentHighlightsRequestArgs; 885 } 886 /** 887 * Span augmented with extra information that denotes the kind of the highlighting to be used for span. 888 */ 889 export interface HighlightSpan extends TextSpanWithContext { 890 kind: HighlightSpanKind; 891 } 892 /** 893 * Represents a set of highligh spans for a give name 894 */ 895 export interface DocumentHighlightsItem { 896 /** 897 * File containing highlight spans. 898 */ 899 file: string; 900 /** 901 * Spans to highlight in file. 902 */ 903 highlightSpans: HighlightSpan[]; 904 } 905 /** 906 * Response for a DocumentHighlightsRequest request. 907 */ 908 export interface DocumentHighlightsResponse extends Response { 909 body?: DocumentHighlightsItem[]; 910 } 911 /** 912 * Find references request; value of command field is 913 * "references". Return response giving the file locations that 914 * reference the symbol found in file at location line, col. 915 */ 916 export interface ReferencesRequest extends FileLocationRequest { 917 command: CommandTypes.References; 918 } 919 export interface ReferencesResponseItem extends FileSpanWithContext { 920 /** 921 * Text of line containing the reference. Including this 922 * with the response avoids latency of editor loading files 923 * to show text of reference line (the server already has loaded the referencing files). 924 * 925 * If {@link UserPreferences.disableLineTextInReferences} is enabled, the property won't be filled 926 */ 927 lineText?: string; 928 /** 929 * True if reference is a write location, false otherwise. 930 */ 931 isWriteAccess: boolean; 932 /** 933 * Present only if the search was triggered from a declaration. 934 * True indicates that the references refers to the same symbol 935 * (i.e. has the same meaning) as the declaration that began the 936 * search. 937 */ 938 isDefinition?: boolean; 939 } 940 /** 941 * The body of a "references" response message. 942 */ 943 export interface ReferencesResponseBody { 944 /** 945 * The file locations referencing the symbol. 946 */ 947 refs: readonly ReferencesResponseItem[]; 948 /** 949 * The name of the symbol. 950 */ 951 symbolName: string; 952 /** 953 * The start character offset of the symbol (on the line provided by the references request). 954 */ 955 symbolStartOffset: number; 956 /** 957 * The full display name of the symbol. 958 */ 959 symbolDisplayString: string; 960 } 961 /** 962 * Response to "references" request. 963 */ 964 export interface ReferencesResponse extends Response { 965 body?: ReferencesResponseBody; 966 } 967 export interface FileReferencesRequest extends FileRequest { 968 command: CommandTypes.FileReferences; 969 } 970 export interface FileReferencesResponseBody { 971 /** 972 * The file locations referencing the symbol. 973 */ 974 refs: readonly ReferencesResponseItem[]; 975 /** 976 * The name of the symbol. 977 */ 978 symbolName: string; 979 } 980 export interface FileReferencesResponse extends Response { 981 body?: FileReferencesResponseBody; 982 } 983 /** 984 * Argument for RenameRequest request. 985 */ 986 export interface RenameRequestArgs extends FileLocationRequestArgs { 987 /** 988 * Should text at specified location be found/changed in comments? 989 */ 990 findInComments?: boolean; 991 /** 992 * Should text at specified location be found/changed in strings? 993 */ 994 findInStrings?: boolean; 995 } 996 /** 997 * Rename request; value of command field is "rename". Return 998 * response giving the file locations that reference the symbol 999 * found in file at location line, col. Also return full display 1000 * name of the symbol so that client can print it unambiguously. 1001 */ 1002 export interface RenameRequest extends FileLocationRequest { 1003 command: CommandTypes.Rename; 1004 arguments: RenameRequestArgs; 1005 } 1006 /** 1007 * Information about the item to be renamed. 1008 */ 1009 export type RenameInfo = RenameInfoSuccess | RenameInfoFailure; 1010 export type RenameInfoSuccess = ChangePropertyTypes<ts.RenameInfoSuccess, { 1011 triggerSpan: TextSpan; 1012 }>; 1013 /** 1014 * A group of text spans, all in 'file'. 1015 */ 1016 export interface SpanGroup { 1017 /** The file to which the spans apply */ 1018 file: string; 1019 /** The text spans in this group */ 1020 locs: RenameTextSpan[]; 1021 } 1022 export interface RenameTextSpan extends TextSpanWithContext { 1023 readonly prefixText?: string; 1024 readonly suffixText?: string; 1025 } 1026 export interface RenameResponseBody { 1027 /** 1028 * Information about the item to be renamed. 1029 */ 1030 info: RenameInfo; 1031 /** 1032 * An array of span groups (one per file) that refer to the item to be renamed. 1033 */ 1034 locs: readonly SpanGroup[]; 1035 } 1036 /** 1037 * Rename response message. 1038 */ 1039 export interface RenameResponse extends Response { 1040 body?: RenameResponseBody; 1041 } 1042 /** 1043 * Represents a file in external project. 1044 * External project is project whose set of files, compilation options and open\close state 1045 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio). 1046 * External project will exist even if all files in it are closed and should be closed explicitly. 1047 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will 1048 * create configured project for every config file but will maintain a link that these projects were created 1049 * as a result of opening external project so they should be removed once external project is closed. 1050 */ 1051 export interface ExternalFile { 1052 /** 1053 * Name of file file 1054 */ 1055 fileName: string; 1056 /** 1057 * Script kind of the file 1058 */ 1059 scriptKind?: ScriptKindName | ScriptKind; 1060 /** 1061 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript) 1062 */ 1063 hasMixedContent?: boolean; 1064 /** 1065 * Content of the file 1066 */ 1067 content?: string; 1068 } 1069 /** 1070 * Represent an external project 1071 */ 1072 export interface ExternalProject { 1073 /** 1074 * Project name 1075 */ 1076 projectFileName: string; 1077 /** 1078 * List of root files in project 1079 */ 1080 rootFiles: ExternalFile[]; 1081 /** 1082 * Compiler options for the project 1083 */ 1084 options: ExternalProjectCompilerOptions; 1085 /** 1086 * Explicitly specified type acquisition for the project 1087 */ 1088 typeAcquisition?: TypeAcquisition; 1089 } 1090 export interface CompileOnSaveMixin { 1091 /** 1092 * If compile on save is enabled for the project 1093 */ 1094 compileOnSave?: boolean; 1095 } 1096 /** 1097 * For external projects, some of the project settings are sent together with 1098 * compiler settings. 1099 */ 1100 export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions; 1101 export interface FileWithProjectReferenceRedirectInfo { 1102 /** 1103 * Name of file 1104 */ 1105 fileName: string; 1106 /** 1107 * True if the file is primarily included in a referenced project 1108 */ 1109 isSourceOfProjectReferenceRedirect: boolean; 1110 } 1111 /** 1112 * Represents a set of changes that happen in project 1113 */ 1114 export interface ProjectChanges { 1115 /** 1116 * List of added files 1117 */ 1118 added: string[] | FileWithProjectReferenceRedirectInfo[]; 1119 /** 1120 * List of removed files 1121 */ 1122 removed: string[] | FileWithProjectReferenceRedirectInfo[]; 1123 /** 1124 * List of updated files 1125 */ 1126 updated: string[] | FileWithProjectReferenceRedirectInfo[]; 1127 /** 1128 * List of files that have had their project reference redirect status updated 1129 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true 1130 */ 1131 updatedRedirects?: FileWithProjectReferenceRedirectInfo[]; 1132 } 1133 /** 1134 * Information found in a configure request. 1135 */ 1136 export interface ConfigureRequestArguments { 1137 /** 1138 * Information about the host, for example 'Emacs 24.4' or 1139 * 'Sublime Text version 3075' 1140 */ 1141 hostInfo?: string; 1142 /** 1143 * If present, tab settings apply only to this file. 1144 */ 1145 file?: string; 1146 /** 1147 * The format options to use during formatting and other code editing features. 1148 */ 1149 formatOptions?: FormatCodeSettings; 1150 preferences?: UserPreferences; 1151 /** 1152 * The host's additional supported .js file extensions 1153 */ 1154 extraFileExtensions?: FileExtensionInfo[]; 1155 watchOptions?: WatchOptions; 1156 } 1157 export enum WatchFileKind { 1158 FixedPollingInterval = "FixedPollingInterval", 1159 PriorityPollingInterval = "PriorityPollingInterval", 1160 DynamicPriorityPolling = "DynamicPriorityPolling", 1161 FixedChunkSizePolling = "FixedChunkSizePolling", 1162 UseFsEvents = "UseFsEvents", 1163 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory", 1164 } 1165 export enum WatchDirectoryKind { 1166 UseFsEvents = "UseFsEvents", 1167 FixedPollingInterval = "FixedPollingInterval", 1168 DynamicPriorityPolling = "DynamicPriorityPolling", 1169 FixedChunkSizePolling = "FixedChunkSizePolling", 1170 } 1171 export enum PollingWatchKind { 1172 FixedInterval = "FixedInterval", 1173 PriorityInterval = "PriorityInterval", 1174 DynamicPriority = "DynamicPriority", 1175 FixedChunkSize = "FixedChunkSize", 1176 } 1177 export interface WatchOptions { 1178 watchFile?: WatchFileKind | ts.WatchFileKind; 1179 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind; 1180 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind; 1181 synchronousWatchDirectory?: boolean; 1182 excludeDirectories?: string[]; 1183 excludeFiles?: string[]; 1184 [option: string]: CompilerOptionsValue | undefined; 1185 } 1186 /** 1187 * Configure request; value of command field is "configure". Specifies 1188 * host information, such as host type, tab size, and indent size. 1189 */ 1190 export interface ConfigureRequest extends Request { 1191 command: CommandTypes.Configure; 1192 arguments: ConfigureRequestArguments; 1193 } 1194 /** 1195 * Response to "configure" request. This is just an acknowledgement, so 1196 * no body field is required. 1197 */ 1198 export interface ConfigureResponse extends Response { 1199 } 1200 export interface ConfigurePluginRequestArguments { 1201 pluginName: string; 1202 configuration: any; 1203 } 1204 export interface ConfigurePluginRequest extends Request { 1205 command: CommandTypes.ConfigurePlugin; 1206 arguments: ConfigurePluginRequestArguments; 1207 } 1208 export interface ConfigurePluginResponse extends Response { 1209 } 1210 export interface SelectionRangeRequest extends FileRequest { 1211 command: CommandTypes.SelectionRange; 1212 arguments: SelectionRangeRequestArgs; 1213 } 1214 export interface SelectionRangeRequestArgs extends FileRequestArgs { 1215 locations: Location[]; 1216 } 1217 export interface SelectionRangeResponse extends Response { 1218 body?: SelectionRange[]; 1219 } 1220 export interface SelectionRange { 1221 textSpan: TextSpan; 1222 parent?: SelectionRange; 1223 } 1224 export interface ToggleLineCommentRequest extends FileRequest { 1225 command: CommandTypes.ToggleLineComment; 1226 arguments: FileRangeRequestArgs; 1227 } 1228 export interface ToggleMultilineCommentRequest extends FileRequest { 1229 command: CommandTypes.ToggleMultilineComment; 1230 arguments: FileRangeRequestArgs; 1231 } 1232 export interface CommentSelectionRequest extends FileRequest { 1233 command: CommandTypes.CommentSelection; 1234 arguments: FileRangeRequestArgs; 1235 } 1236 export interface UncommentSelectionRequest extends FileRequest { 1237 command: CommandTypes.UncommentSelection; 1238 arguments: FileRangeRequestArgs; 1239 } 1240 /** 1241 * Information found in an "open" request. 1242 */ 1243 export interface OpenRequestArgs extends FileRequestArgs { 1244 /** 1245 * Used when a version of the file content is known to be more up to date than the one on disk. 1246 * Then the known content will be used upon opening instead of the disk copy 1247 */ 1248 fileContent?: string; 1249 /** 1250 * Used to specify the script kind of the file explicitly. It could be one of the following: 1251 * "TS", "JS", "TSX", "JSX" 1252 */ 1253 scriptKindName?: ScriptKindName; 1254 /** 1255 * Used to limit the searching for project config file. If given the searching will stop at this 1256 * root path; otherwise it will go all the way up to the dist root path. 1257 */ 1258 projectRootPath?: string; 1259 } 1260 export type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; 1261 /** 1262 * Open request; value of command field is "open". Notify the 1263 * server that the client has file open. The server will not 1264 * monitor the filesystem for changes in this file and will assume 1265 * that the client is updating the server (using the change and/or 1266 * reload messages) when the file changes. Server does not currently 1267 * send a response to an open request. 1268 */ 1269 export interface OpenRequest extends Request { 1270 command: CommandTypes.Open; 1271 arguments: OpenRequestArgs; 1272 } 1273 /** 1274 * Request to open or update external project 1275 */ 1276 export interface OpenExternalProjectRequest extends Request { 1277 command: CommandTypes.OpenExternalProject; 1278 arguments: OpenExternalProjectArgs; 1279 } 1280 /** 1281 * Arguments to OpenExternalProjectRequest request 1282 */ 1283 export type OpenExternalProjectArgs = ExternalProject; 1284 /** 1285 * Request to open multiple external projects 1286 */ 1287 export interface OpenExternalProjectsRequest extends Request { 1288 command: CommandTypes.OpenExternalProjects; 1289 arguments: OpenExternalProjectsArgs; 1290 } 1291 /** 1292 * Arguments to OpenExternalProjectsRequest 1293 */ 1294 export interface OpenExternalProjectsArgs { 1295 /** 1296 * List of external projects to open or update 1297 */ 1298 projects: ExternalProject[]; 1299 } 1300 /** 1301 * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so 1302 * no body field is required. 1303 */ 1304 export interface OpenExternalProjectResponse extends Response { 1305 } 1306 /** 1307 * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so 1308 * no body field is required. 1309 */ 1310 export interface OpenExternalProjectsResponse extends Response { 1311 } 1312 /** 1313 * Request to close external project. 1314 */ 1315 export interface CloseExternalProjectRequest extends Request { 1316 command: CommandTypes.CloseExternalProject; 1317 arguments: CloseExternalProjectRequestArgs; 1318 } 1319 /** 1320 * Arguments to CloseExternalProjectRequest request 1321 */ 1322 export interface CloseExternalProjectRequestArgs { 1323 /** 1324 * Name of the project to close 1325 */ 1326 projectFileName: string; 1327 } 1328 /** 1329 * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so 1330 * no body field is required. 1331 */ 1332 export interface CloseExternalProjectResponse extends Response { 1333 } 1334 /** 1335 * Request to synchronize list of open files with the client 1336 */ 1337 export interface UpdateOpenRequest extends Request { 1338 command: CommandTypes.UpdateOpen; 1339 arguments: UpdateOpenRequestArgs; 1340 } 1341 /** 1342 * Arguments to UpdateOpenRequest 1343 */ 1344 export interface UpdateOpenRequestArgs { 1345 /** 1346 * List of newly open files 1347 */ 1348 openFiles?: OpenRequestArgs[]; 1349 /** 1350 * List of open files files that were changes 1351 */ 1352 changedFiles?: FileCodeEdits[]; 1353 /** 1354 * List of files that were closed 1355 */ 1356 closedFiles?: string[]; 1357 } 1358 /** 1359 * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects. 1360 */ 1361 export type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition; 1362 /** 1363 * Request to set compiler options for inferred projects. 1364 * External projects are opened / closed explicitly. 1365 * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders. 1366 * This configuration file will be used to obtain a list of files and configuration settings for the project. 1367 * Inferred projects are created when user opens a loose file that is not the part of external project 1368 * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false, 1369 * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true. 1370 */ 1371 export interface SetCompilerOptionsForInferredProjectsRequest extends Request { 1372 command: CommandTypes.CompilerOptionsForInferredProjects; 1373 arguments: SetCompilerOptionsForInferredProjectsArgs; 1374 } 1375 /** 1376 * Argument for SetCompilerOptionsForInferredProjectsRequest request. 1377 */ 1378 export interface SetCompilerOptionsForInferredProjectsArgs { 1379 /** 1380 * Compiler options to be used with inferred projects. 1381 */ 1382 options: InferredProjectCompilerOptions; 1383 /** 1384 * Specifies the project root path used to scope compiler options. 1385 * It is an error to provide this property if the server has not been started with 1386 * `useInferredProjectPerProjectRoot` enabled. 1387 */ 1388 projectRootPath?: string; 1389 } 1390 /** 1391 * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so 1392 * no body field is required. 1393 */ 1394 export interface SetCompilerOptionsForInferredProjectsResponse extends Response { 1395 } 1396 /** 1397 * Exit request; value of command field is "exit". Ask the server process 1398 * to exit. 1399 */ 1400 export interface ExitRequest extends Request { 1401 command: CommandTypes.Exit; 1402 } 1403 /** 1404 * Close request; value of command field is "close". Notify the 1405 * server that the client has closed a previously open file. If 1406 * file is still referenced by open files, the server will resume 1407 * monitoring the filesystem for changes to file. Server does not 1408 * currently send a response to a close request. 1409 */ 1410 export interface CloseRequest extends FileRequest { 1411 command: CommandTypes.Close; 1412 } 1413 export interface WatchChangeRequest extends Request { 1414 command: CommandTypes.WatchChange; 1415 arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[]; 1416 } 1417 export interface WatchChangeRequestArgs { 1418 id: number; 1419 created?: string[]; 1420 deleted?: string[]; 1421 updated?: string[]; 1422 } 1423 /** 1424 * Request to obtain the list of files that should be regenerated if target file is recompiled. 1425 * NOTE: this us query-only operation and does not generate any output on disk. 1426 */ 1427 export interface CompileOnSaveAffectedFileListRequest extends FileRequest { 1428 command: CommandTypes.CompileOnSaveAffectedFileList; 1429 } 1430 /** 1431 * Contains a list of files that should be regenerated in a project 1432 */ 1433 export interface CompileOnSaveAffectedFileListSingleProject { 1434 /** 1435 * Project name 1436 */ 1437 projectFileName: string; 1438 /** 1439 * List of files names that should be recompiled 1440 */ 1441 fileNames: string[]; 1442 /** 1443 * true if project uses outFile or out compiler option 1444 */ 1445 projectUsesOutFile: boolean; 1446 } 1447 /** 1448 * Response for CompileOnSaveAffectedFileListRequest request; 1449 */ 1450 export interface CompileOnSaveAffectedFileListResponse extends Response { 1451 body: CompileOnSaveAffectedFileListSingleProject[]; 1452 } 1453 /** 1454 * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk. 1455 */ 1456 export interface CompileOnSaveEmitFileRequest extends FileRequest { 1457 command: CommandTypes.CompileOnSaveEmitFile; 1458 arguments: CompileOnSaveEmitFileRequestArgs; 1459 } 1460 /** 1461 * Arguments for CompileOnSaveEmitFileRequest 1462 */ 1463 export interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs { 1464 /** 1465 * if true - then file should be recompiled even if it does not have any changes. 1466 */ 1467 forced?: boolean; 1468 includeLinePosition?: boolean; 1469 /** if true - return response as object with emitSkipped and diagnostics */ 1470 richResponse?: boolean; 1471 } 1472 export interface CompileOnSaveEmitFileResponse extends Response { 1473 body: boolean | EmitResult; 1474 } 1475 export interface EmitResult { 1476 emitSkipped: boolean; 1477 diagnostics: Diagnostic[] | DiagnosticWithLinePosition[]; 1478 } 1479 /** 1480 * Quickinfo request; value of command field is 1481 * "quickinfo". Return response giving a quick type and 1482 * documentation string for the symbol found in file at location 1483 * line, col. 1484 */ 1485 export interface QuickInfoRequest extends FileLocationRequest { 1486 command: CommandTypes.Quickinfo; 1487 arguments: FileLocationRequestArgs; 1488 } 1489 export interface QuickInfoRequestArgs extends FileLocationRequestArgs { 1490 /** 1491 * This controls how many levels of definitions will be expanded in the quick info response. 1492 * The default value is 0. 1493 */ 1494 verbosityLevel?: number; 1495 } 1496 /** 1497 * Body of QuickInfoResponse. 1498 */ 1499 export interface QuickInfoResponseBody { 1500 /** 1501 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). 1502 */ 1503 kind: ScriptElementKind; 1504 /** 1505 * Optional modifiers for the kind (such as 'public'). 1506 */ 1507 kindModifiers: string; 1508 /** 1509 * Starting file location of symbol. 1510 */ 1511 start: Location; 1512 /** 1513 * One past last character of symbol. 1514 */ 1515 end: Location; 1516 /** 1517 * Type and kind of symbol. 1518 */ 1519 displayString: string; 1520 /** 1521 * Documentation associated with symbol. 1522 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise. 1523 */ 1524 documentation: string | SymbolDisplayPart[]; 1525 /** 1526 * JSDoc tags associated with symbol. 1527 */ 1528 tags: JSDocTagInfo[]; 1529 /** 1530 * Whether the verbosity level can be increased for this quick info response. 1531 */ 1532 canIncreaseVerbosityLevel?: boolean; 1533 } 1534 /** 1535 * Quickinfo response message. 1536 */ 1537 export interface QuickInfoResponse extends Response { 1538 body?: QuickInfoResponseBody; 1539 } 1540 /** 1541 * Arguments for format messages. 1542 */ 1543 export interface FormatRequestArgs extends FileLocationRequestArgs { 1544 /** 1545 * Last line of range for which to format text in file. 1546 */ 1547 endLine: number; 1548 /** 1549 * Character offset on last line of range for which to format text in file. 1550 */ 1551 endOffset: number; 1552 /** 1553 * Format options to be used. 1554 */ 1555 options?: FormatCodeSettings; 1556 } 1557 /** 1558 * Format request; value of command field is "format". Return 1559 * response giving zero or more edit instructions. The edit 1560 * instructions will be sorted in file order. Applying the edit 1561 * instructions in reverse to file will result in correctly 1562 * reformatted text. 1563 */ 1564 export interface FormatRequest extends FileLocationRequest { 1565 command: CommandTypes.Format; 1566 arguments: FormatRequestArgs; 1567 } 1568 /** 1569 * Object found in response messages defining an editing 1570 * instruction for a span of text in source code. The effect of 1571 * this instruction is to replace the text starting at start and 1572 * ending one character before end with newText. For an insertion, 1573 * the text span is empty. For a deletion, newText is empty. 1574 */ 1575 export interface CodeEdit { 1576 /** 1577 * First character of the text span to edit. 1578 */ 1579 start: Location; 1580 /** 1581 * One character past last character of the text span to edit. 1582 */ 1583 end: Location; 1584 /** 1585 * Replace the span defined above with this string (may be 1586 * the empty string). 1587 */ 1588 newText: string; 1589 } 1590 export interface FileCodeEdits { 1591 fileName: string; 1592 textChanges: CodeEdit[]; 1593 } 1594 export interface CodeFixResponse extends Response { 1595 /** The code actions that are available */ 1596 body?: CodeFixAction[]; 1597 } 1598 export interface CodeAction { 1599 /** Description of the code action to display in the UI of the editor */ 1600 description: string; 1601 /** Text changes to apply to each file as part of the code action */ 1602 changes: FileCodeEdits[]; 1603 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */ 1604 commands?: {}[]; 1605 } 1606 export interface CombinedCodeActions { 1607 changes: readonly FileCodeEdits[]; 1608 commands?: readonly {}[]; 1609 } 1610 export interface CodeFixAction extends CodeAction { 1611 /** Short name to identify the fix, for use by telemetry. */ 1612 fixName: string; 1613 /** 1614 * If present, one may call 'getCombinedCodeFix' with this fixId. 1615 * This may be omitted to indicate that the code fix can't be applied in a group. 1616 */ 1617 fixId?: {}; 1618 /** Should be present if and only if 'fixId' is. */ 1619 fixAllDescription?: string; 1620 } 1621 /** 1622 * Format and format on key response message. 1623 */ 1624 export interface FormatResponse extends Response { 1625 body?: CodeEdit[]; 1626 } 1627 /** 1628 * Arguments for format on key messages. 1629 */ 1630 export interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { 1631 /** 1632 * Key pressed (';', '\n', or '}'). 1633 */ 1634 key: string; 1635 options?: FormatCodeSettings; 1636 } 1637 /** 1638 * Format on key request; value of command field is 1639 * "formatonkey". Given file location and key typed (as string), 1640 * return response giving zero or more edit instructions. The 1641 * edit instructions will be sorted in file order. Applying the 1642 * edit instructions in reverse to file will result in correctly 1643 * reformatted text. 1644 */ 1645 export interface FormatOnKeyRequest extends FileLocationRequest { 1646 command: CommandTypes.Formatonkey; 1647 arguments: FormatOnKeyRequestArgs; 1648 } 1649 /** 1650 * Arguments for completions messages. 1651 */ 1652 export interface CompletionsRequestArgs extends FileLocationRequestArgs { 1653 /** 1654 * Optional prefix to apply to possible completions. 1655 */ 1656 prefix?: string; 1657 /** 1658 * Character that was responsible for triggering completion. 1659 * Should be `undefined` if a user manually requested completion. 1660 */ 1661 triggerCharacter?: CompletionsTriggerCharacter; 1662 triggerKind?: CompletionTriggerKind; 1663 /** 1664 * @deprecated Use UserPreferences.includeCompletionsForModuleExports 1665 */ 1666 includeExternalModuleExports?: boolean; 1667 /** 1668 * @deprecated Use UserPreferences.includeCompletionsWithInsertText 1669 */ 1670 includeInsertTextCompletions?: boolean; 1671 } 1672 /** 1673 * Completions request; value of command field is "completions". 1674 * Given a file location (file, line, col) and a prefix (which may 1675 * be the empty string), return the possible completions that 1676 * begin with prefix. 1677 */ 1678 export interface CompletionsRequest extends FileLocationRequest { 1679 command: CommandTypes.Completions | CommandTypes.CompletionInfo; 1680 arguments: CompletionsRequestArgs; 1681 } 1682 /** 1683 * Arguments for completion details request. 1684 */ 1685 export interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { 1686 /** 1687 * Names of one or more entries for which to obtain details. 1688 */ 1689 entryNames: (string | CompletionEntryIdentifier)[]; 1690 } 1691 export interface CompletionEntryIdentifier { 1692 name: string; 1693 source?: string; 1694 data?: unknown; 1695 } 1696 /** 1697 * Completion entry details request; value of command field is 1698 * "completionEntryDetails". Given a file location (file, line, 1699 * col) and an array of completion entry names return more 1700 * detailed information for each completion entry. 1701 */ 1702 export interface CompletionDetailsRequest extends FileLocationRequest { 1703 command: CommandTypes.CompletionDetails; 1704 arguments: CompletionDetailsRequestArgs; 1705 } 1706 /** A part of a symbol description that links from a jsdoc @link tag to a declaration */ 1707 export interface JSDocLinkDisplayPart extends SymbolDisplayPart { 1708 /** The location of the declaration that the @link tag links to. */ 1709 target: FileSpan; 1710 } 1711 export type CompletionEntry = ChangePropertyTypes<Omit<ts.CompletionEntry, "symbol">, { 1712 replacementSpan: TextSpan; 1713 data: unknown; 1714 }>; 1715 /** 1716 * Additional completion entry details, available on demand 1717 */ 1718 export type CompletionEntryDetails = ChangePropertyTypes<ts.CompletionEntryDetails, { 1719 tags: JSDocTagInfo[]; 1720 codeActions: CodeAction[]; 1721 }>; 1722 /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */ 1723 export interface CompletionsResponse extends Response { 1724 body?: CompletionEntry[]; 1725 } 1726 export interface CompletionInfoResponse extends Response { 1727 body?: CompletionInfo; 1728 } 1729 export type CompletionInfo = ChangePropertyTypes<ts.CompletionInfo, { 1730 entries: readonly CompletionEntry[]; 1731 optionalReplacementSpan: TextSpan; 1732 }>; 1733 export interface CompletionDetailsResponse extends Response { 1734 body?: CompletionEntryDetails[]; 1735 } 1736 /** 1737 * Represents a single signature to show in signature help. 1738 */ 1739 export type SignatureHelpItem = ChangePropertyTypes<ts.SignatureHelpItem, { 1740 tags: JSDocTagInfo[]; 1741 }>; 1742 /** 1743 * Signature help items found in the response of a signature help request. 1744 */ 1745 export interface SignatureHelpItems { 1746 /** 1747 * The signature help items. 1748 */ 1749 items: SignatureHelpItem[]; 1750 /** 1751 * The span for which signature help should appear on a signature 1752 */ 1753 applicableSpan: TextSpan; 1754 /** 1755 * The item selected in the set of available help items. 1756 */ 1757 selectedItemIndex: number; 1758 /** 1759 * The argument selected in the set of parameters. 1760 */ 1761 argumentIndex: number; 1762 /** 1763 * The argument count 1764 */ 1765 argumentCount: number; 1766 } 1767 /** 1768 * Arguments of a signature help request. 1769 */ 1770 export interface SignatureHelpRequestArgs extends FileLocationRequestArgs { 1771 /** 1772 * Reason why signature help was invoked. 1773 * See each individual possible 1774 */ 1775 triggerReason?: SignatureHelpTriggerReason; 1776 } 1777 /** 1778 * Signature help request; value of command field is "signatureHelp". 1779 * Given a file location (file, line, col), return the signature 1780 * help. 1781 */ 1782 export interface SignatureHelpRequest extends FileLocationRequest { 1783 command: CommandTypes.SignatureHelp; 1784 arguments: SignatureHelpRequestArgs; 1785 } 1786 /** 1787 * Response object for a SignatureHelpRequest. 1788 */ 1789 export interface SignatureHelpResponse extends Response { 1790 body?: SignatureHelpItems; 1791 } 1792 export interface InlayHintsRequestArgs extends FileRequestArgs { 1793 /** 1794 * Start position of the span. 1795 */ 1796 start: number; 1797 /** 1798 * Length of the span. 1799 */ 1800 length: number; 1801 } 1802 export interface InlayHintsRequest extends Request { 1803 command: CommandTypes.ProvideInlayHints; 1804 arguments: InlayHintsRequestArgs; 1805 } 1806 export type InlayHintItem = ChangePropertyTypes<ts.InlayHint, { 1807 position: Location; 1808 displayParts: InlayHintItemDisplayPart[]; 1809 }>; 1810 export interface InlayHintItemDisplayPart { 1811 text: string; 1812 span?: FileSpan; 1813 } 1814 export interface InlayHintsResponse extends Response { 1815 body?: InlayHintItem[]; 1816 } 1817 export interface MapCodeRequestArgs extends FileRequestArgs { 1818 /** 1819 * The files and changes to try and apply/map. 1820 */ 1821 mapping: MapCodeRequestDocumentMapping; 1822 } 1823 export interface MapCodeRequestDocumentMapping { 1824 /** 1825 * The specific code to map/insert/replace in the file. 1826 */ 1827 contents: string[]; 1828 /** 1829 * Areas of "focus" to inform the code mapper with. For example, cursor 1830 * location, current selection, viewport, etc. Nested arrays denote 1831 * priority: toplevel arrays are more important than inner arrays, and 1832 * inner array priorities are based on items within that array. Items 1833 * earlier in the arrays have higher priority. 1834 */ 1835 focusLocations?: TextSpan[][]; 1836 } 1837 export interface MapCodeRequest extends FileRequest { 1838 command: CommandTypes.MapCode; 1839 arguments: MapCodeRequestArgs; 1840 } 1841 export interface MapCodeResponse extends Response { 1842 body: readonly FileCodeEdits[]; 1843 } 1844 /** 1845 * Synchronous request for semantic diagnostics of one file. 1846 */ 1847 export interface SemanticDiagnosticsSyncRequest extends FileRequest { 1848 command: CommandTypes.SemanticDiagnosticsSync; 1849 arguments: SemanticDiagnosticsSyncRequestArgs; 1850 } 1851 export interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs { 1852 includeLinePosition?: boolean; 1853 } 1854 /** 1855 * Response object for synchronous sematic diagnostics request. 1856 */ 1857 export interface SemanticDiagnosticsSyncResponse extends Response { 1858 body?: Diagnostic[] | DiagnosticWithLinePosition[]; 1859 } 1860 export interface SuggestionDiagnosticsSyncRequest extends FileRequest { 1861 command: CommandTypes.SuggestionDiagnosticsSync; 1862 arguments: SuggestionDiagnosticsSyncRequestArgs; 1863 } 1864 export type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs; 1865 export type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse; 1866 /** 1867 * Synchronous request for syntactic diagnostics of one file. 1868 */ 1869 export interface SyntacticDiagnosticsSyncRequest extends FileRequest { 1870 command: CommandTypes.SyntacticDiagnosticsSync; 1871 arguments: SyntacticDiagnosticsSyncRequestArgs; 1872 } 1873 export interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs { 1874 includeLinePosition?: boolean; 1875 } 1876 /** 1877 * Response object for synchronous syntactic diagnostics request. 1878 */ 1879 export interface SyntacticDiagnosticsSyncResponse extends Response { 1880 body?: Diagnostic[] | DiagnosticWithLinePosition[]; 1881 } 1882 /** 1883 * Arguments for GeterrForProject request. 1884 */ 1885 export interface GeterrForProjectRequestArgs { 1886 /** 1887 * the file requesting project error list 1888 */ 1889 file: string; 1890 /** 1891 * Delay in milliseconds to wait before starting to compute 1892 * errors for the files in the file list 1893 */ 1894 delay: number; 1895 } 1896 /** 1897 * GeterrForProjectRequest request; value of command field is 1898 * "geterrForProject". It works similarly with 'Geterr', only 1899 * it request for every file in this project. 1900 */ 1901 export interface GeterrForProjectRequest extends Request { 1902 command: CommandTypes.GeterrForProject; 1903 arguments: GeterrForProjectRequestArgs; 1904 } 1905 /** 1906 * Arguments for geterr messages. 1907 */ 1908 export interface GeterrRequestArgs { 1909 /** 1910 * List of file names for which to compute compiler errors. 1911 * The files will be checked in list order. 1912 */ 1913 files: (string | FileRangesRequestArgs)[]; 1914 /** 1915 * Delay in milliseconds to wait before starting to compute 1916 * errors for the files in the file list 1917 */ 1918 delay: number; 1919 } 1920 /** 1921 * Geterr request; value of command field is "geterr". Wait for 1922 * delay milliseconds and then, if during the wait no change or 1923 * reload messages have arrived for the first file in the files 1924 * list, get the syntactic errors for the file, field requests, 1925 * and then get the semantic errors for the file. Repeat with a 1926 * smaller delay for each subsequent file on the files list. Best 1927 * practice for an editor is to send a file list containing each 1928 * file that is currently visible, in most-recently-used order. 1929 */ 1930 export interface GeterrRequest extends Request { 1931 command: CommandTypes.Geterr; 1932 arguments: GeterrRequestArgs; 1933 } 1934 export interface FileRange { 1935 /** 1936 * The line number for the request (1-based). 1937 */ 1938 startLine: number; 1939 /** 1940 * The character offset (on the line) for the request (1-based). 1941 */ 1942 startOffset: number; 1943 /** 1944 * The line number for the request (1-based). 1945 */ 1946 endLine: number; 1947 /** 1948 * The character offset (on the line) for the request (1-based). 1949 */ 1950 endOffset: number; 1951 } 1952 export interface FileRangesRequestArgs extends Pick<FileRequestArgs, "file"> { 1953 ranges: FileRange[]; 1954 } 1955 export type RequestCompletedEventName = "requestCompleted"; 1956 /** 1957 * Event that is sent when server have finished processing request with specified id. 1958 */ 1959 export interface RequestCompletedEvent extends Event { 1960 event: RequestCompletedEventName; 1961 body: RequestCompletedEventBody; 1962 } 1963 export interface RequestCompletedEventBody { 1964 request_seq: number; 1965 performanceData?: PerformanceData; 1966 } 1967 /** 1968 * Item of diagnostic information found in a DiagnosticEvent message. 1969 */ 1970 export interface Diagnostic { 1971 /** 1972 * Starting file location at which text applies. 1973 */ 1974 start: Location; 1975 /** 1976 * The last file location at which the text applies. 1977 */ 1978 end: Location; 1979 /** 1980 * Text of diagnostic message. 1981 */ 1982 text: string; 1983 /** 1984 * The category of the diagnostic message, e.g. "error", "warning", or "suggestion". 1985 */ 1986 category: string; 1987 reportsUnnecessary?: {}; 1988 reportsDeprecated?: {}; 1989 /** 1990 * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites 1991 */ 1992 relatedInformation?: DiagnosticRelatedInformation[]; 1993 /** 1994 * The error code of the diagnostic message. 1995 */ 1996 code?: number; 1997 /** 1998 * The name of the plugin reporting the message. 1999 */ 2000 source?: string; 2001 } 2002 export interface DiagnosticWithFileName extends Diagnostic { 2003 /** 2004 * Name of the file the diagnostic is in 2005 */ 2006 fileName: string; 2007 } 2008 /** 2009 * Represents additional spans returned with a diagnostic which are relevant to it 2010 */ 2011 export interface DiagnosticRelatedInformation { 2012 /** 2013 * The category of the related information message, e.g. "error", "warning", or "suggestion". 2014 */ 2015 category: string; 2016 /** 2017 * The code used ot identify the related information 2018 */ 2019 code: number; 2020 /** 2021 * Text of related or additional information. 2022 */ 2023 message: string; 2024 /** 2025 * Associated location 2026 */ 2027 span?: FileSpan; 2028 } 2029 export interface DiagnosticEventBody { 2030 /** 2031 * The file for which diagnostic information is reported. 2032 */ 2033 file: string; 2034 /** 2035 * An array of diagnostic information items. 2036 */ 2037 diagnostics: Diagnostic[]; 2038 /** 2039 * Spans where the region diagnostic was requested, if this is a region semantic diagnostic event. 2040 */ 2041 spans?: TextSpan[]; 2042 } 2043 export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag" | "regionSemanticDiag"; 2044 /** 2045 * Event message for DiagnosticEventKind event types. 2046 * These events provide syntactic and semantic errors for a file. 2047 */ 2048 export interface DiagnosticEvent extends Event { 2049 body?: DiagnosticEventBody; 2050 event: DiagnosticEventKind; 2051 } 2052 export interface ConfigFileDiagnosticEventBody { 2053 /** 2054 * The file which trigged the searching and error-checking of the config file 2055 */ 2056 triggerFile: string; 2057 /** 2058 * The name of the found config file. 2059 */ 2060 configFile: string; 2061 /** 2062 * An arry of diagnostic information items for the found config file. 2063 */ 2064 diagnostics: DiagnosticWithFileName[]; 2065 } 2066 /** 2067 * Event message for "configFileDiag" event type. 2068 * This event provides errors for a found config file. 2069 */ 2070 export interface ConfigFileDiagnosticEvent extends Event { 2071 body?: ConfigFileDiagnosticEventBody; 2072 event: "configFileDiag"; 2073 } 2074 export type ProjectLanguageServiceStateEventName = "projectLanguageServiceState"; 2075 export interface ProjectLanguageServiceStateEvent extends Event { 2076 event: ProjectLanguageServiceStateEventName; 2077 body?: ProjectLanguageServiceStateEventBody; 2078 } 2079 export interface ProjectLanguageServiceStateEventBody { 2080 /** 2081 * Project name that has changes in the state of language service. 2082 * For configured projects this will be the config file path. 2083 * For external projects this will be the name of the projects specified when project was open. 2084 * For inferred projects this event is not raised. 2085 */ 2086 projectName: string; 2087 /** 2088 * True if language service state switched from disabled to enabled 2089 * and false otherwise. 2090 */ 2091 languageServiceEnabled: boolean; 2092 } 2093 export type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground"; 2094 export interface ProjectsUpdatedInBackgroundEvent extends Event { 2095 event: ProjectsUpdatedInBackgroundEventName; 2096 body: ProjectsUpdatedInBackgroundEventBody; 2097 } 2098 export interface ProjectsUpdatedInBackgroundEventBody { 2099 /** 2100 * Current set of open files 2101 */ 2102 openFiles: string[]; 2103 } 2104 export type ProjectLoadingStartEventName = "projectLoadingStart"; 2105 export interface ProjectLoadingStartEvent extends Event { 2106 event: ProjectLoadingStartEventName; 2107 body: ProjectLoadingStartEventBody; 2108 } 2109 export interface ProjectLoadingStartEventBody { 2110 /** name of the project */ 2111 projectName: string; 2112 /** reason for loading */ 2113 reason: string; 2114 } 2115 export type ProjectLoadingFinishEventName = "projectLoadingFinish"; 2116 export interface ProjectLoadingFinishEvent extends Event { 2117 event: ProjectLoadingFinishEventName; 2118 body: ProjectLoadingFinishEventBody; 2119 } 2120 export interface ProjectLoadingFinishEventBody { 2121 /** name of the project */ 2122 projectName: string; 2123 } 2124 export type SurveyReadyEventName = "surveyReady"; 2125 export interface SurveyReadyEvent extends Event { 2126 event: SurveyReadyEventName; 2127 body: SurveyReadyEventBody; 2128 } 2129 export interface SurveyReadyEventBody { 2130 /** Name of the survey. This is an internal machine- and programmer-friendly name */ 2131 surveyId: string; 2132 } 2133 export type LargeFileReferencedEventName = "largeFileReferenced"; 2134 export interface LargeFileReferencedEvent extends Event { 2135 event: LargeFileReferencedEventName; 2136 body: LargeFileReferencedEventBody; 2137 } 2138 export interface LargeFileReferencedEventBody { 2139 /** 2140 * name of the large file being loaded 2141 */ 2142 file: string; 2143 /** 2144 * size of the file 2145 */ 2146 fileSize: number; 2147 /** 2148 * max file size allowed on the server 2149 */ 2150 maxFileSize: number; 2151 } 2152 export type CreateFileWatcherEventName = "createFileWatcher"; 2153 export interface CreateFileWatcherEvent extends Event { 2154 readonly event: CreateFileWatcherEventName; 2155 readonly body: CreateFileWatcherEventBody; 2156 } 2157 export interface CreateFileWatcherEventBody { 2158 readonly id: number; 2159 readonly path: string; 2160 } 2161 export type CreateDirectoryWatcherEventName = "createDirectoryWatcher"; 2162 export interface CreateDirectoryWatcherEvent extends Event { 2163 readonly event: CreateDirectoryWatcherEventName; 2164 readonly body: CreateDirectoryWatcherEventBody; 2165 } 2166 export interface CreateDirectoryWatcherEventBody { 2167 readonly id: number; 2168 readonly path: string; 2169 readonly recursive: boolean; 2170 readonly ignoreUpdate?: boolean; 2171 } 2172 export type CloseFileWatcherEventName = "closeFileWatcher"; 2173 export interface CloseFileWatcherEvent extends Event { 2174 readonly event: CloseFileWatcherEventName; 2175 readonly body: CloseFileWatcherEventBody; 2176 } 2177 export interface CloseFileWatcherEventBody { 2178 readonly id: number; 2179 } 2180 /** 2181 * Arguments for reload request. 2182 */ 2183 export interface ReloadRequestArgs extends FileRequestArgs { 2184 /** 2185 * Name of temporary file from which to reload file 2186 * contents. May be same as file. 2187 */ 2188 tmpfile: string; 2189 } 2190 /** 2191 * Reload request message; value of command field is "reload". 2192 * Reload contents of file with name given by the 'file' argument 2193 * from temporary file with name given by the 'tmpfile' argument. 2194 * The two names can be identical. 2195 */ 2196 export interface ReloadRequest extends FileRequest { 2197 command: CommandTypes.Reload; 2198 arguments: ReloadRequestArgs; 2199 } 2200 /** 2201 * Response to "reload" request. This is just an acknowledgement, so 2202 * no body field is required. 2203 */ 2204 export interface ReloadResponse extends Response { 2205 } 2206 /** 2207 * Arguments for saveto request. 2208 */ 2209 export interface SavetoRequestArgs extends FileRequestArgs { 2210 /** 2211 * Name of temporary file into which to save server's view of 2212 * file contents. 2213 */ 2214 tmpfile: string; 2215 } 2216 /** 2217 * Saveto request message; value of command field is "saveto". 2218 * For debugging purposes, save to a temporaryfile (named by 2219 * argument 'tmpfile') the contents of file named by argument 2220 * 'file'. The server does not currently send a response to a 2221 * "saveto" request. 2222 */ 2223 export interface SavetoRequest extends FileRequest { 2224 command: CommandTypes.Saveto; 2225 arguments: SavetoRequestArgs; 2226 } 2227 /** 2228 * Arguments for navto request message. 2229 */ 2230 export interface NavtoRequestArgs { 2231 /** 2232 * Search term to navigate to from current location; term can 2233 * be '.*' or an identifier prefix. 2234 */ 2235 searchValue: string; 2236 /** 2237 * Optional limit on the number of items to return. 2238 */ 2239 maxResultCount?: number; 2240 /** 2241 * The file for the request (absolute pathname required). 2242 */ 2243 file?: string; 2244 /** 2245 * Optional flag to indicate we want results for just the current file 2246 * or the entire project. 2247 */ 2248 currentFileOnly?: boolean; 2249 projectFileName?: string; 2250 } 2251 /** 2252 * Navto request message; value of command field is "navto". 2253 * Return list of objects giving file locations and symbols that 2254 * match the search term given in argument 'searchTerm'. The 2255 * context for the search is given by the named file. 2256 */ 2257 export interface NavtoRequest extends Request { 2258 command: CommandTypes.Navto; 2259 arguments: NavtoRequestArgs; 2260 } 2261 /** 2262 * An item found in a navto response. 2263 */ 2264 export interface NavtoItem extends FileSpan { 2265 /** 2266 * The symbol's name. 2267 */ 2268 name: string; 2269 /** 2270 * The symbol's kind (such as 'className' or 'parameterName'). 2271 */ 2272 kind: ScriptElementKind; 2273 /** 2274 * exact, substring, or prefix. 2275 */ 2276 matchKind: string; 2277 /** 2278 * If this was a case sensitive or insensitive match. 2279 */ 2280 isCaseSensitive: boolean; 2281 /** 2282 * Optional modifiers for the kind (such as 'public'). 2283 */ 2284 kindModifiers?: string; 2285 /** 2286 * Name of symbol's container symbol (if any); for example, 2287 * the class name if symbol is a class member. 2288 */ 2289 containerName?: string; 2290 /** 2291 * Kind of symbol's container symbol (if any). 2292 */ 2293 containerKind?: ScriptElementKind; 2294 } 2295 /** 2296 * Navto response message. Body is an array of navto items. Each 2297 * item gives a symbol that matched the search term. 2298 */ 2299 export interface NavtoResponse extends Response { 2300 body?: NavtoItem[]; 2301 } 2302 /** 2303 * Arguments for change request message. 2304 */ 2305 export interface ChangeRequestArgs extends FormatRequestArgs { 2306 /** 2307 * Optional string to insert at location (file, line, offset). 2308 */ 2309 insertString?: string; 2310 } 2311 /** 2312 * Change request message; value of command field is "change". 2313 * Update the server's view of the file named by argument 'file'. 2314 * Server does not currently send a response to a change request. 2315 */ 2316 export interface ChangeRequest extends FileLocationRequest { 2317 command: CommandTypes.Change; 2318 arguments: ChangeRequestArgs; 2319 } 2320 /** 2321 * Response to "brace" request. 2322 */ 2323 export interface BraceResponse extends Response { 2324 body?: TextSpan[]; 2325 } 2326 /** 2327 * Brace matching request; value of command field is "brace". 2328 * Return response giving the file locations of matching braces 2329 * found in file at location line, offset. 2330 */ 2331 export interface BraceRequest extends FileLocationRequest { 2332 command: CommandTypes.Brace; 2333 } 2334 /** 2335 * NavBar items request; value of command field is "navbar". 2336 * Return response giving the list of navigation bar entries 2337 * extracted from the requested file. 2338 */ 2339 export interface NavBarRequest extends FileRequest { 2340 command: CommandTypes.NavBar; 2341 } 2342 /** 2343 * NavTree request; value of command field is "navtree". 2344 * Return response giving the navigation tree of the requested file. 2345 */ 2346 export interface NavTreeRequest extends FileRequest { 2347 command: CommandTypes.NavTree; 2348 } 2349 export interface NavigationBarItem { 2350 /** 2351 * The item's display text. 2352 */ 2353 text: string; 2354 /** 2355 * The symbol's kind (such as 'className' or 'parameterName'). 2356 */ 2357 kind: ScriptElementKind; 2358 /** 2359 * Optional modifiers for the kind (such as 'public'). 2360 */ 2361 kindModifiers?: string; 2362 /** 2363 * The definition locations of the item. 2364 */ 2365 spans: TextSpan[]; 2366 /** 2367 * Optional children. 2368 */ 2369 childItems?: NavigationBarItem[]; 2370 /** 2371 * Number of levels deep this item should appear. 2372 */ 2373 indent: number; 2374 } 2375 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */ 2376 export interface NavigationTree { 2377 text: string; 2378 kind: ScriptElementKind; 2379 kindModifiers: string; 2380 spans: TextSpan[]; 2381 nameSpan: TextSpan | undefined; 2382 childItems?: NavigationTree[]; 2383 } 2384 export type TelemetryEventName = "telemetry"; 2385 export interface TelemetryEvent extends Event { 2386 event: TelemetryEventName; 2387 body: TelemetryEventBody; 2388 } 2389 export interface TelemetryEventBody { 2390 telemetryEventName: string; 2391 payload: any; 2392 } 2393 export type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed"; 2394 export interface TypesInstallerInitializationFailedEvent extends Event { 2395 event: TypesInstallerInitializationFailedEventName; 2396 body: TypesInstallerInitializationFailedEventBody; 2397 } 2398 export interface TypesInstallerInitializationFailedEventBody { 2399 message: string; 2400 } 2401 export type TypingsInstalledTelemetryEventName = "typingsInstalled"; 2402 export interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody { 2403 telemetryEventName: TypingsInstalledTelemetryEventName; 2404 payload: TypingsInstalledTelemetryEventPayload; 2405 } 2406 export interface TypingsInstalledTelemetryEventPayload { 2407 /** 2408 * Comma separated list of installed typing packages 2409 */ 2410 installedPackages: string; 2411 /** 2412 * true if install request succeeded, otherwise - false 2413 */ 2414 installSuccess: boolean; 2415 /** 2416 * version of typings installer 2417 */ 2418 typingsInstallerVersion: string; 2419 } 2420 export type BeginInstallTypesEventName = "beginInstallTypes"; 2421 export type EndInstallTypesEventName = "endInstallTypes"; 2422 export interface BeginInstallTypesEvent extends Event { 2423 event: BeginInstallTypesEventName; 2424 body: BeginInstallTypesEventBody; 2425 } 2426 export interface EndInstallTypesEvent extends Event { 2427 event: EndInstallTypesEventName; 2428 body: EndInstallTypesEventBody; 2429 } 2430 export interface InstallTypesEventBody { 2431 /** 2432 * correlation id to match begin and end events 2433 */ 2434 eventId: number; 2435 /** 2436 * list of packages to install 2437 */ 2438 packages: readonly string[]; 2439 } 2440 export interface BeginInstallTypesEventBody extends InstallTypesEventBody { 2441 } 2442 export interface EndInstallTypesEventBody extends InstallTypesEventBody { 2443 /** 2444 * true if installation succeeded, otherwise false 2445 */ 2446 success: boolean; 2447 } 2448 export interface NavBarResponse extends Response { 2449 body?: NavigationBarItem[]; 2450 } 2451 export interface NavTreeResponse extends Response { 2452 body?: NavigationTree; 2453 } 2454 export type CallHierarchyItem = ChangePropertyTypes<ts.CallHierarchyItem, { 2455 span: TextSpan; 2456 selectionSpan: TextSpan; 2457 }>; 2458 export interface CallHierarchyIncomingCall { 2459 from: CallHierarchyItem; 2460 fromSpans: TextSpan[]; 2461 } 2462 export interface CallHierarchyOutgoingCall { 2463 to: CallHierarchyItem; 2464 fromSpans: TextSpan[]; 2465 } 2466 export interface PrepareCallHierarchyRequest extends FileLocationRequest { 2467 command: CommandTypes.PrepareCallHierarchy; 2468 } 2469 export interface PrepareCallHierarchyResponse extends Response { 2470 readonly body: CallHierarchyItem | CallHierarchyItem[]; 2471 } 2472 export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest { 2473 command: CommandTypes.ProvideCallHierarchyIncomingCalls; 2474 } 2475 export interface ProvideCallHierarchyIncomingCallsResponse extends Response { 2476 readonly body: CallHierarchyIncomingCall[]; 2477 } 2478 export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest { 2479 command: CommandTypes.ProvideCallHierarchyOutgoingCalls; 2480 } 2481 export interface ProvideCallHierarchyOutgoingCallsResponse extends Response { 2482 readonly body: CallHierarchyOutgoingCall[]; 2483 } 2484 export enum IndentStyle { 2485 None = "None", 2486 Block = "Block", 2487 Smart = "Smart", 2488 } 2489 export type EditorSettings = ChangePropertyTypes<ts.EditorSettings, { 2490 indentStyle: IndentStyle | ts.IndentStyle; 2491 }>; 2492 export type FormatCodeSettings = ChangePropertyTypes<ts.FormatCodeSettings, { 2493 indentStyle: IndentStyle | ts.IndentStyle; 2494 }>; 2495 export type CompilerOptions = ChangePropertyTypes<ChangeStringIndexSignature<ts.CompilerOptions, CompilerOptionsValue>, { 2496 jsx: JsxEmit | ts.JsxEmit; 2497 module: ModuleKind | ts.ModuleKind; 2498 moduleResolution: ModuleResolutionKind | ts.ModuleResolutionKind; 2499 newLine: NewLineKind | ts.NewLineKind; 2500 target: ScriptTarget | ts.ScriptTarget; 2501 }>; 2502 export enum JsxEmit { 2503 None = "none", 2504 Preserve = "preserve", 2505 ReactNative = "react-native", 2506 React = "react", 2507 ReactJSX = "react-jsx", 2508 ReactJSXDev = "react-jsxdev", 2509 } 2510 export enum ModuleKind { 2511 None = "none", 2512 CommonJS = "commonjs", 2513 AMD = "amd", 2514 UMD = "umd", 2515 System = "system", 2516 ES6 = "es6", 2517 ES2015 = "es2015", 2518 ES2020 = "es2020", 2519 ES2022 = "es2022", 2520 ESNext = "esnext", 2521 Node16 = "node16", 2522 Node18 = "node18", 2523 Node20 = "node20", 2524 NodeNext = "nodenext", 2525 Preserve = "preserve", 2526 } 2527 export enum ModuleResolutionKind { 2528 Classic = "classic", 2529 /** @deprecated Renamed to `Node10` */ 2530 Node = "node", 2531 /** @deprecated Renamed to `Node10` */ 2532 NodeJs = "node", 2533 Node10 = "node10", 2534 Node16 = "node16", 2535 NodeNext = "nodenext", 2536 Bundler = "bundler", 2537 } 2538 export enum NewLineKind { 2539 Crlf = "Crlf", 2540 Lf = "Lf", 2541 } 2542 export enum ScriptTarget { 2543 /** @deprecated */ 2544 ES3 = "es3", 2545 ES5 = "es5", 2546 ES6 = "es6", 2547 ES2015 = "es2015", 2548 ES2016 = "es2016", 2549 ES2017 = "es2017", 2550 ES2018 = "es2018", 2551 ES2019 = "es2019", 2552 ES2020 = "es2020", 2553 ES2021 = "es2021", 2554 ES2022 = "es2022", 2555 ES2023 = "es2023", 2556 ES2024 = "es2024", 2557 ESNext = "esnext", 2558 JSON = "json", 2559 Latest = "esnext", 2560 } 2561 } 2562 namespace typingsInstaller { 2563 interface Log { 2564 isEnabled(): boolean; 2565 writeLine(text: string): void; 2566 } 2567 type RequestCompletedAction = (success: boolean) => void; 2568 interface PendingRequest { 2569 requestId: number; 2570 packageNames: string[]; 2571 cwd: string; 2572 onRequestCompleted: RequestCompletedAction; 2573 } 2574 abstract class TypingsInstaller { 2575 protected readonly installTypingHost: InstallTypingHost; 2576 private readonly globalCachePath; 2577 private readonly safeListPath; 2578 private readonly typesMapLocation; 2579 private readonly throttleLimit; 2580 protected readonly log: Log; 2581 private readonly packageNameToTypingLocation; 2582 private readonly missingTypingsSet; 2583 private readonly knownCachesSet; 2584 private readonly projectWatchers; 2585 private safeList; 2586 private pendingRunRequests; 2587 private installRunCount; 2588 private inFlightRequestCount; 2589 abstract readonly typesRegistry: Map<string, MapLike<string>>; 2590 constructor(installTypingHost: InstallTypingHost, globalCachePath: string, safeListPath: Path, typesMapLocation: Path, throttleLimit: number, log?: Log); 2591 closeProject(req: CloseProject): void; 2592 private closeWatchers; 2593 install(req: DiscoverTypings): void; 2594 private initializeSafeList; 2595 private processCacheLocation; 2596 private filterTypings; 2597 protected ensurePackageDirectoryExists(directory: string): void; 2598 private installTypings; 2599 private ensureDirectoryExists; 2600 private watchFiles; 2601 private createSetTypings; 2602 private installTypingsAsync; 2603 private executeWithThrottling; 2604 protected abstract installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void; 2605 protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | WatchTypingLocations): void; 2606 protected readonly latestDistTag = "latest"; 2607 } 2608 } 2609 type ActionSet = "action::set"; 2610 type ActionInvalidate = "action::invalidate"; 2611 type ActionPackageInstalled = "action::packageInstalled"; 2612 type EventTypesRegistry = "event::typesRegistry"; 2613 type EventBeginInstallTypes = "event::beginInstallTypes"; 2614 type EventEndInstallTypes = "event::endInstallTypes"; 2615 type EventInitializationFailed = "event::initializationFailed"; 2616 type ActionWatchTypingLocations = "action::watchTypingLocations"; 2617 interface TypingInstallerResponse { 2618 readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed | ActionWatchTypingLocations; 2619 } 2620 interface TypingInstallerRequestWithProjectName { 2621 readonly projectName: string; 2622 } 2623 interface DiscoverTypings extends TypingInstallerRequestWithProjectName { 2624 readonly fileNames: string[]; 2625 readonly projectRootPath: Path; 2626 readonly compilerOptions: CompilerOptions; 2627 readonly typeAcquisition: TypeAcquisition; 2628 readonly unresolvedImports: SortedReadonlyArray<string>; 2629 readonly cachePath?: string; 2630 readonly kind: "discover"; 2631 } 2632 interface CloseProject extends TypingInstallerRequestWithProjectName { 2633 readonly kind: "closeProject"; 2634 } 2635 interface TypesRegistryRequest { 2636 readonly kind: "typesRegistry"; 2637 } 2638 interface InstallPackageRequest extends TypingInstallerRequestWithProjectName { 2639 readonly kind: "installPackage"; 2640 readonly fileName: Path; 2641 readonly packageName: string; 2642 readonly projectRootPath: Path; 2643 readonly id: number; 2644 } 2645 interface PackageInstalledResponse extends ProjectResponse { 2646 readonly kind: ActionPackageInstalled; 2647 readonly id: number; 2648 readonly success: boolean; 2649 readonly message: string; 2650 } 2651 interface InitializationFailedResponse extends TypingInstallerResponse { 2652 readonly kind: EventInitializationFailed; 2653 readonly message: string; 2654 readonly stack?: string; 2655 } 2656 interface ProjectResponse extends TypingInstallerResponse { 2657 readonly projectName: string; 2658 } 2659 interface InvalidateCachedTypings extends ProjectResponse { 2660 readonly kind: ActionInvalidate; 2661 } 2662 interface InstallTypes extends ProjectResponse { 2663 readonly kind: EventBeginInstallTypes | EventEndInstallTypes; 2664 readonly eventId: number; 2665 readonly typingsInstallerVersion: string; 2666 readonly packagesToInstall: readonly string[]; 2667 } 2668 interface BeginInstallTypes extends InstallTypes { 2669 readonly kind: EventBeginInstallTypes; 2670 } 2671 interface EndInstallTypes extends InstallTypes { 2672 readonly kind: EventEndInstallTypes; 2673 readonly installSuccess: boolean; 2674 } 2675 interface InstallTypingHost extends JsTyping.TypingResolutionHost { 2676 useCaseSensitiveFileNames: boolean; 2677 writeFile(path: string, content: string): void; 2678 createDirectory(path: string): void; 2679 getCurrentDirectory?(): string; 2680 } 2681 interface SetTypings extends ProjectResponse { 2682 readonly typeAcquisition: TypeAcquisition; 2683 readonly compilerOptions: CompilerOptions; 2684 readonly typings: string[]; 2685 readonly unresolvedImports: SortedReadonlyArray<string>; 2686 readonly kind: ActionSet; 2687 } 2688 interface WatchTypingLocations extends ProjectResponse { 2689 /** if files is undefined, retain same set of watchers */ 2690 readonly files: readonly string[] | undefined; 2691 readonly kind: ActionWatchTypingLocations; 2692 } 2693 interface CompressedData { 2694 length: number; 2695 compressionKind: string; 2696 data: any; 2697 } 2698 type ModuleImportResult = { 2699 module: {}; 2700 error: undefined; 2701 } | { 2702 module: undefined; 2703 error: { 2704 stack?: string; 2705 message?: string; 2706 }; 2707 }; 2708 /** @deprecated Use {@link ModuleImportResult} instead. */ 2709 type RequireResult = ModuleImportResult; 2710 interface ServerHost extends System { 2711 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher; 2712 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher; 2713 preferNonRecursiveWatch?: boolean; 2714 setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 2715 clearTimeout(timeoutId: any): void; 2716 setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; 2717 clearImmediate(timeoutId: any): void; 2718 gc?(): void; 2719 trace?(s: string): void; 2720 require?(initialPath: string, moduleName: string): ModuleImportResult; 2721 } 2722 interface InstallPackageOptionsWithProject extends InstallPackageOptions { 2723 projectName: string; 2724 projectRootPath: Path; 2725 } 2726 interface ITypingsInstaller { 2727 isKnownTypesPackageName(name: string): boolean; 2728 installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>; 2729 enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void; 2730 attach(projectService: ProjectService): void; 2731 onProjectClosed(p: Project): void; 2732 readonly globalTypingsCacheLocation: string | undefined; 2733 } 2734 function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings; 2735 function toNormalizedPath(fileName: string): NormalizedPath; 2736 function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path; 2737 function asNormalizedPath(fileName: string): NormalizedPath; 2738 function createNormalizedPathMap<T>(): NormalizedPathMap<T>; 2739 function isInferredProjectName(name: string): boolean; 2740 function makeInferredProjectName(counter: number): string; 2741 function createSortedArray<T>(): SortedArray<T>; 2742 enum LogLevel { 2743 terse = 0, 2744 normal = 1, 2745 requestTime = 2, 2746 verbose = 3, 2747 } 2748 const emptyArray: SortedReadonlyArray<never>; 2749 interface Logger { 2750 close(): void; 2751 hasLevel(level: LogLevel): boolean; 2752 loggingEnabled(): boolean; 2753 perftrc(s: string): void; 2754 info(s: string): void; 2755 startGroup(): void; 2756 endGroup(): void; 2757 msg(s: string, type?: Msg): void; 2758 getLogFileName(): string | undefined; 2759 } 2760 enum Msg { 2761 Err = "Err", 2762 Info = "Info", 2763 Perf = "Perf", 2764 } 2765 namespace Errors { 2766 function ThrowNoProject(): never; 2767 function ThrowProjectLanguageServiceDisabled(): never; 2768 function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never; 2769 } 2770 type NormalizedPath = string & { 2771 __normalizedPathTag: any; 2772 }; 2773 interface NormalizedPathMap<T> { 2774 get(path: NormalizedPath): T | undefined; 2775 set(path: NormalizedPath, value: T): void; 2776 contains(path: NormalizedPath): boolean; 2777 remove(path: NormalizedPath): void; 2778 } 2779 function isDynamicFileName(fileName: NormalizedPath): boolean; 2780 class ScriptInfo { 2781 private readonly host; 2782 readonly fileName: NormalizedPath; 2783 readonly scriptKind: ScriptKind; 2784 readonly hasMixedContent: boolean; 2785 readonly path: Path; 2786 /** 2787 * All projects that include this file 2788 */ 2789 readonly containingProjects: Project[]; 2790 private formatSettings; 2791 private preferences; 2792 private realpath; 2793 constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: number); 2794 isScriptOpen(): boolean; 2795 open(newText: string | undefined): void; 2796 close(fileExists?: boolean): void; 2797 getSnapshot(): IScriptSnapshot; 2798 private ensureRealPath; 2799 getFormatCodeSettings(): FormatCodeSettings | undefined; 2800 getPreferences(): protocol.UserPreferences | undefined; 2801 attachToProject(project: Project): boolean; 2802 isAttached(project: Project): boolean; 2803 detachFromProject(project: Project): void; 2804 detachAllProjects(): void; 2805 getDefaultProject(): Project; 2806 registerFileUpdate(): void; 2807 setOptions(formatSettings: FormatCodeSettings, preferences: protocol.UserPreferences | undefined): void; 2808 getLatestVersion(): string; 2809 saveTo(fileName: string): void; 2810 reloadFromFile(tempFileName?: NormalizedPath): boolean; 2811 editContent(start: number, end: number, newText: string): void; 2812 markContainingProjectsAsDirty(): void; 2813 isOrphan(): boolean; 2814 /** 2815 * @param line 1 based index 2816 */ 2817 lineToTextSpan(line: number): TextSpan; 2818 /** 2819 * @param line 1 based index 2820 * @param offset 1 based index 2821 */ 2822 lineOffsetToPosition(line: number, offset: number): number; 2823 positionToLineOffset(position: number): protocol.Location; 2824 isJavaScript(): boolean; 2825 } 2826 function allRootFilesAreJsOrDts(project: Project): boolean; 2827 function allFilesAreJsOrDts(project: Project): boolean; 2828 enum ProjectKind { 2829 Inferred = 0, 2830 Configured = 1, 2831 External = 2, 2832 AutoImportProvider = 3, 2833 Auxiliary = 4, 2834 } 2835 interface PluginCreateInfo { 2836 project: Project; 2837 languageService: LanguageService; 2838 languageServiceHost: LanguageServiceHost; 2839 serverHost: ServerHost; 2840 session?: Session<unknown>; 2841 config: any; 2842 } 2843 interface PluginModule { 2844 create(createInfo: PluginCreateInfo): LanguageService; 2845 getExternalFiles?(proj: Project, updateLevel: ProgramUpdateLevel): string[]; 2846 onConfigurationChanged?(config: any): void; 2847 } 2848 interface PluginModuleWithName { 2849 name: string; 2850 module: PluginModule; 2851 } 2852 type PluginModuleFactory = (mod: { 2853 typescript: typeof ts; 2854 }) => PluginModule; 2855 abstract class Project implements LanguageServiceHost, ModuleResolutionHost { 2856 readonly projectKind: ProjectKind; 2857 readonly projectService: ProjectService; 2858 private compilerOptions; 2859 compileOnSaveEnabled: boolean; 2860 protected watchOptions: WatchOptions | undefined; 2861 private rootFilesMap; 2862 private program; 2863 private externalFiles; 2864 private missingFilesMap; 2865 private generatedFilesMap; 2866 private hasAddedorRemovedFiles; 2867 private hasAddedOrRemovedSymlinks; 2868 protected languageService: LanguageService; 2869 languageServiceEnabled: boolean; 2870 readonly trace?: (s: string) => void; 2871 readonly realpath?: (path: string) => string; 2872 private builderState; 2873 private updatedFileNames; 2874 private lastReportedFileNames; 2875 private lastReportedVersion; 2876 protected projectErrors: Diagnostic[] | undefined; 2877 private typingsCache; 2878 private typingWatchers; 2879 private readonly cancellationToken; 2880 isNonTsProject(): boolean; 2881 isJsOnlyProject(): boolean; 2882 static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined; 2883 private exportMapCache; 2884 private changedFilesForExportMapCache; 2885 private moduleSpecifierCache; 2886 private symlinks; 2887 readonly jsDocParsingMode: JSDocParsingMode | undefined; 2888 isKnownTypesPackageName(name: string): boolean; 2889 installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>; 2890 getCompilationSettings(): CompilerOptions; 2891 getCompilerOptions(): CompilerOptions; 2892 getNewLine(): string; 2893 getProjectVersion(): string; 2894 getProjectReferences(): readonly ProjectReference[] | undefined; 2895 getScriptFileNames(): string[]; 2896 private getOrCreateScriptInfoAndAttachToProject; 2897 getScriptKind(fileName: string): ScriptKind; 2898 getScriptVersion(filename: string): string; 2899 getScriptSnapshot(filename: string): IScriptSnapshot | undefined; 2900 getCancellationToken(): HostCancellationToken; 2901 getCurrentDirectory(): string; 2902 getDefaultLibFileName(): string; 2903 useCaseSensitiveFileNames(): boolean; 2904 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 2905 readFile(fileName: string): string | undefined; 2906 writeFile(fileName: string, content: string): void; 2907 fileExists(file: string): boolean; 2908 directoryExists(path: string): boolean; 2909 getDirectories(path: string): string[]; 2910 log(s: string): void; 2911 error(s: string): void; 2912 private setInternalCompilerOptionsForEmittingJsFiles; 2913 /** 2914 * Get the errors that dont have any file name associated 2915 */ 2916 getGlobalProjectErrors(): readonly Diagnostic[]; 2917 /** 2918 * Get all the project errors 2919 */ 2920 getAllProjectErrors(): readonly Diagnostic[]; 2921 setProjectErrors(projectErrors: Diagnostic[] | undefined): void; 2922 getLanguageService(ensureSynchronized?: boolean): LanguageService; 2923 getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; 2924 /** 2925 * Returns true if emit was conducted 2926 */ 2927 emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): EmitResult; 2928 enableLanguageService(): void; 2929 disableLanguageService(lastFileExceededProgramSize?: string): void; 2930 getProjectName(): string; 2931 protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition; 2932 getExternalFiles(updateLevel?: ProgramUpdateLevel): SortedReadonlyArray<string>; 2933 getSourceFile(path: Path): SourceFile | undefined; 2934 close(): void; 2935 private detachScriptInfoIfNotRoot; 2936 isClosed(): boolean; 2937 hasRoots(): boolean; 2938 getRootFiles(): NormalizedPath[]; 2939 getRootScriptInfos(): ScriptInfo[]; 2940 getScriptInfos(): ScriptInfo[]; 2941 getExcludedFiles(): readonly NormalizedPath[]; 2942 getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[]; 2943 hasConfigFile(configFilePath: NormalizedPath): boolean; 2944 containsScriptInfo(info: ScriptInfo): boolean; 2945 containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean; 2946 isRoot(info: ScriptInfo): boolean; 2947 addRoot(info: ScriptInfo, fileName?: NormalizedPath): void; 2948 addMissingFileRoot(fileName: NormalizedPath): void; 2949 removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void; 2950 registerFileUpdate(fileName: string): void; 2951 /** 2952 * Updates set of files that contribute to this project 2953 * @returns: true if set of files in the project stays the same and false - otherwise. 2954 */ 2955 updateGraph(): boolean; 2956 private closeWatchingTypingLocations; 2957 private onTypingInstallerWatchInvoke; 2958 protected removeExistingTypings(include: string[]): string[]; 2959 private updateGraphWorker; 2960 private detachScriptInfoFromProject; 2961 private addMissingFileWatcher; 2962 private isWatchedMissingFile; 2963 private createGeneratedFileWatcher; 2964 private isValidGeneratedFileWatcher; 2965 private clearGeneratedFileWatch; 2966 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; 2967 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; 2968 filesToString(writeProjectFileNames: boolean): string; 2969 private filesToStringWorker; 2970 setCompilerOptions(compilerOptions: CompilerOptions): void; 2971 setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void; 2972 getTypeAcquisition(): TypeAcquisition; 2973 protected removeRoot(info: ScriptInfo): void; 2974 protected enableGlobalPlugins(options: CompilerOptions): void; 2975 protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void; 2976 /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */ 2977 refreshDiagnostics(): void; 2978 private isDefaultProjectForOpenFiles; 2979 } 2980 /** 2981 * If a file is opened and no tsconfig (or jsconfig) is found, 2982 * the file and its imports/references are put into an InferredProject. 2983 */ 2984 class InferredProject extends Project { 2985 private _isJsInferredProject; 2986 toggleJsInferredProject(isJsInferredProject: boolean): void; 2987 setCompilerOptions(options?: CompilerOptions): void; 2988 /** this is canonical project root path */ 2989 readonly projectRootPath: string | undefined; 2990 addRoot(info: ScriptInfo): void; 2991 removeRoot(info: ScriptInfo): void; 2992 isProjectWithSingleRoot(): boolean; 2993 close(): void; 2994 getTypeAcquisition(): TypeAcquisition; 2995 } 2996 class AutoImportProviderProject extends Project { 2997 private hostProject; 2998 private static readonly maxDependencies; 2999 private rootFileNames; 3000 updateGraph(): boolean; 3001 hasRoots(): boolean; 3002 getScriptFileNames(): string[]; 3003 getLanguageService(): never; 3004 getHostForAutoImportProvider(): never; 3005 getProjectReferences(): readonly ProjectReference[] | undefined; 3006 } 3007 /** 3008 * If a file is opened, the server will look for a tsconfig (or jsconfig) 3009 * and if successful create a ConfiguredProject for it. 3010 * Otherwise it will create an InferredProject. 3011 */ 3012 class ConfiguredProject extends Project { 3013 readonly canonicalConfigFilePath: NormalizedPath; 3014 private projectReferences; 3015 private compilerHost?; 3016 private releaseParsedConfig; 3017 /** 3018 * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph 3019 * @returns: true if set of files in the project stays the same and false - otherwise. 3020 */ 3021 updateGraph(): boolean; 3022 getConfigFilePath(): NormalizedPath; 3023 getProjectReferences(): readonly ProjectReference[] | undefined; 3024 updateReferences(refs: readonly ProjectReference[] | undefined): void; 3025 /** 3026 * Get the errors that dont have any file name associated 3027 */ 3028 getGlobalProjectErrors(): readonly Diagnostic[]; 3029 /** 3030 * Get all the project errors 3031 */ 3032 getAllProjectErrors(): readonly Diagnostic[]; 3033 setProjectErrors(projectErrors: Diagnostic[]): void; 3034 close(): void; 3035 getEffectiveTypeRoots(): string[]; 3036 } 3037 /** 3038 * Project whose configuration is handled externally, such as in a '.csproj'. 3039 * These are created only if a host explicitly calls `openExternalProject`. 3040 */ 3041 class ExternalProject extends Project { 3042 externalProjectName: string; 3043 compileOnSaveEnabled: boolean; 3044 excludedFiles: readonly NormalizedPath[]; 3045 updateGraph(): boolean; 3046 getExcludedFiles(): readonly NormalizedPath[]; 3047 } 3048 function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; 3049 function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; 3050 function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions, currentDirectory?: string): WatchOptionsAndErrors | undefined; 3051 function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined; 3052 function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; 3053 function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind; 3054 const maxProgramSizeForNonTsFiles: number; 3055 const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; 3056 interface ProjectsUpdatedInBackgroundEvent { 3057 eventName: typeof ProjectsUpdatedInBackgroundEvent; 3058 data: { 3059 openFiles: string[]; 3060 }; 3061 } 3062 const ProjectLoadingStartEvent = "projectLoadingStart"; 3063 interface ProjectLoadingStartEvent { 3064 eventName: typeof ProjectLoadingStartEvent; 3065 data: { 3066 project: Project; 3067 reason: string; 3068 }; 3069 } 3070 const ProjectLoadingFinishEvent = "projectLoadingFinish"; 3071 interface ProjectLoadingFinishEvent { 3072 eventName: typeof ProjectLoadingFinishEvent; 3073 data: { 3074 project: Project; 3075 }; 3076 } 3077 const LargeFileReferencedEvent = "largeFileReferenced"; 3078 interface LargeFileReferencedEvent { 3079 eventName: typeof LargeFileReferencedEvent; 3080 data: { 3081 file: string; 3082 fileSize: number; 3083 maxFileSize: number; 3084 }; 3085 } 3086 const ConfigFileDiagEvent = "configFileDiag"; 3087 interface ConfigFileDiagEvent { 3088 eventName: typeof ConfigFileDiagEvent; 3089 data: { 3090 triggerFile: string; 3091 configFileName: string; 3092 diagnostics: readonly Diagnostic[]; 3093 }; 3094 } 3095 const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; 3096 interface ProjectLanguageServiceStateEvent { 3097 eventName: typeof ProjectLanguageServiceStateEvent; 3098 data: { 3099 project: Project; 3100 languageServiceEnabled: boolean; 3101 }; 3102 } 3103 const ProjectInfoTelemetryEvent = "projectInfo"; 3104 /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */ 3105 interface ProjectInfoTelemetryEvent { 3106 readonly eventName: typeof ProjectInfoTelemetryEvent; 3107 readonly data: ProjectInfoTelemetryEventData; 3108 } 3109 const OpenFileInfoTelemetryEvent = "openFileInfo"; 3110 /** 3111 * Info that we may send about a file that was just opened. 3112 * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info. 3113 * Currently this is only sent for '.js' files. 3114 */ 3115 interface OpenFileInfoTelemetryEvent { 3116 readonly eventName: typeof OpenFileInfoTelemetryEvent; 3117 readonly data: OpenFileInfoTelemetryEventData; 3118 } 3119 const CreateFileWatcherEvent: protocol.CreateFileWatcherEventName; 3120 interface CreateFileWatcherEvent { 3121 readonly eventName: protocol.CreateFileWatcherEventName; 3122 readonly data: protocol.CreateFileWatcherEventBody; 3123 } 3124 const CreateDirectoryWatcherEvent: protocol.CreateDirectoryWatcherEventName; 3125 interface CreateDirectoryWatcherEvent { 3126 readonly eventName: protocol.CreateDirectoryWatcherEventName; 3127 readonly data: protocol.CreateDirectoryWatcherEventBody; 3128 } 3129 const CloseFileWatcherEvent: protocol.CloseFileWatcherEventName; 3130 interface CloseFileWatcherEvent { 3131 readonly eventName: protocol.CloseFileWatcherEventName; 3132 readonly data: protocol.CloseFileWatcherEventBody; 3133 } 3134 interface ProjectInfoTelemetryEventData { 3135 /** Cryptographically secure hash of project file location. */ 3136 readonly projectId: string; 3137 /** Count of file extensions seen in the project. */ 3138 readonly fileStats: FileStats; 3139 /** 3140 * Any compiler options that might contain paths will be taken out. 3141 * Enum compiler options will be converted to strings. 3142 */ 3143 readonly compilerOptions: CompilerOptions; 3144 readonly extends: boolean | undefined; 3145 readonly files: boolean | undefined; 3146 readonly include: boolean | undefined; 3147 readonly exclude: boolean | undefined; 3148 readonly compileOnSave: boolean; 3149 readonly typeAcquisition: ProjectInfoTypeAcquisitionData; 3150 readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other"; 3151 readonly projectType: "external" | "configured"; 3152 readonly languageServiceEnabled: boolean; 3153 /** TypeScript version used by the server. */ 3154 readonly version: string; 3155 } 3156 interface OpenFileInfoTelemetryEventData { 3157 readonly info: OpenFileInfo; 3158 } 3159 interface ProjectInfoTypeAcquisitionData { 3160 readonly enable: boolean | undefined; 3161 readonly include: boolean; 3162 readonly exclude: boolean; 3163 } 3164 interface FileStats { 3165 readonly js: number; 3166 readonly jsSize?: number; 3167 readonly jsx: number; 3168 readonly jsxSize?: number; 3169 readonly ts: number; 3170 readonly tsSize?: number; 3171 readonly tsx: number; 3172 readonly tsxSize?: number; 3173 readonly dts: number; 3174 readonly dtsSize?: number; 3175 readonly deferred: number; 3176 readonly deferredSize?: number; 3177 } 3178 interface OpenFileInfo { 3179 readonly checkJs: boolean; 3180 } 3181 type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent | CreateFileWatcherEvent | CreateDirectoryWatcherEvent | CloseFileWatcherEvent; 3182 type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void; 3183 interface SafeList { 3184 [name: string]: { 3185 match: RegExp; 3186 exclude?: (string | number)[][]; 3187 types?: string[]; 3188 }; 3189 } 3190 interface TypesMapFile { 3191 typesMap: SafeList; 3192 simpleMap: { 3193 [libName: string]: string; 3194 }; 3195 } 3196 interface HostConfiguration { 3197 formatCodeOptions: FormatCodeSettings; 3198 preferences: protocol.UserPreferences; 3199 hostInfo: string; 3200 extraFileExtensions?: FileExtensionInfo[]; 3201 watchOptions?: WatchOptions; 3202 } 3203 interface OpenConfiguredProjectResult { 3204 configFileName?: NormalizedPath; 3205 configFileErrors?: readonly Diagnostic[]; 3206 } 3207 const nullTypingsInstaller: ITypingsInstaller; 3208 interface ProjectServiceOptions { 3209 host: ServerHost; 3210 logger: Logger; 3211 cancellationToken: HostCancellationToken; 3212 useSingleInferredProject: boolean; 3213 useInferredProjectPerProjectRoot: boolean; 3214 typingsInstaller?: ITypingsInstaller; 3215 eventHandler?: ProjectServiceEventHandler; 3216 canUseWatchEvents?: boolean; 3217 suppressDiagnosticEvents?: boolean; 3218 throttleWaitMilliseconds?: number; 3219 globalPlugins?: readonly string[]; 3220 pluginProbeLocations?: readonly string[]; 3221 allowLocalPluginLoads?: boolean; 3222 typesMapLocation?: string; 3223 serverMode?: LanguageServiceMode; 3224 session: Session<unknown> | undefined; 3225 jsDocParsingMode?: JSDocParsingMode; 3226 } 3227 interface WatchOptionsAndErrors { 3228 watchOptions: WatchOptions; 3229 errors: Diagnostic[] | undefined; 3230 } 3231 class ProjectService { 3232 private readonly nodeModulesWatchers; 3233 private readonly filenameToScriptInfoVersion; 3234 private readonly allJsFilesForOpenFileTelemetry; 3235 private readonly externalProjectToConfiguredProjectMap; 3236 /** 3237 * external projects (configuration and list of root files is not controlled by tsserver) 3238 */ 3239 readonly externalProjects: ExternalProject[]; 3240 /** 3241 * projects built from openFileRoots 3242 */ 3243 readonly inferredProjects: InferredProject[]; 3244 /** 3245 * projects specified by a tsconfig.json file 3246 */ 3247 readonly configuredProjects: Map<string, ConfiguredProject>; 3248 /** 3249 * Open files: with value being project root path, and key being Path of the file that is open 3250 */ 3251 readonly openFiles: Map<Path, NormalizedPath | undefined>; 3252 private readonly configFileForOpenFiles; 3253 private rootOfInferredProjects; 3254 private readonly openFilesWithNonRootedDiskPath; 3255 private compilerOptionsForInferredProjects; 3256 private compilerOptionsForInferredProjectsPerProjectRoot; 3257 private watchOptionsForInferredProjects; 3258 private watchOptionsForInferredProjectsPerProjectRoot; 3259 private typeAcquisitionForInferredProjects; 3260 private typeAcquisitionForInferredProjectsPerProjectRoot; 3261 private readonly projectToSizeMap; 3262 private readonly hostConfiguration; 3263 private safelist; 3264 private readonly legacySafelist; 3265 private pendingProjectUpdates; 3266 private pendingOpenFileProjectUpdates?; 3267 readonly currentDirectory: NormalizedPath; 3268 readonly toCanonicalFileName: (f: string) => string; 3269 readonly host: ServerHost; 3270 readonly logger: Logger; 3271 readonly cancellationToken: HostCancellationToken; 3272 readonly useSingleInferredProject: boolean; 3273 readonly useInferredProjectPerProjectRoot: boolean; 3274 readonly typingsInstaller: ITypingsInstaller; 3275 private readonly globalCacheLocationDirectoryPath; 3276 readonly throttleWaitMilliseconds?: number; 3277 private readonly suppressDiagnosticEvents?; 3278 readonly globalPlugins: readonly string[]; 3279 readonly pluginProbeLocations: readonly string[]; 3280 readonly allowLocalPluginLoads: boolean; 3281 readonly typesMapLocation: string | undefined; 3282 readonly serverMode: LanguageServiceMode; 3283 private readonly seenProjects; 3284 private readonly sharedExtendedConfigFileWatchers; 3285 private readonly extendedConfigCache; 3286 private packageJsonFilesMap; 3287 private incompleteCompletionsCache; 3288 private performanceEventHandler?; 3289 private pendingPluginEnablements?; 3290 private currentPluginEnablementPromise?; 3291 readonly jsDocParsingMode: JSDocParsingMode | undefined; 3292 constructor(opts: ProjectServiceOptions); 3293 toPath(fileName: string): Path; 3294 private loadTypesMap; 3295 updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; 3296 private delayUpdateProjectGraph; 3297 private delayUpdateProjectGraphs; 3298 setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void; 3299 findProject(projectName: string): Project | undefined; 3300 getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined; 3301 private tryGetDefaultProjectForEnsuringConfiguredProjectForFile; 3302 private doEnsureDefaultProjectForFile; 3303 getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined; 3304 private ensureProjectStructuresUptoDate; 3305 getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings; 3306 getPreferences(file: NormalizedPath): protocol.UserPreferences; 3307 getHostFormatCodeOptions(): FormatCodeSettings; 3308 getHostPreferences(): protocol.UserPreferences; 3309 private onSourceFileChanged; 3310 private handleSourceMapProjects; 3311 private delayUpdateSourceInfoProjects; 3312 private delayUpdateProjectsOfScriptInfoPath; 3313 private handleDeletedFile; 3314 private watchWildcardDirectory; 3315 private onWildCardDirectoryWatcherInvoke; 3316 private delayUpdateProjectsFromParsedConfigOnConfigFileChange; 3317 private onConfigFileChanged; 3318 private removeProject; 3319 private assignOrphanScriptInfosToInferredProject; 3320 private closeOpenFile; 3321 private deleteScriptInfo; 3322 private configFileExists; 3323 private createConfigFileWatcherForParsedConfig; 3324 private ensureConfigFileWatcherForProject; 3325 private forEachConfigFileLocation; 3326 private getConfigFileNameForFileFromCache; 3327 private setConfigFileNameForFileInCache; 3328 private printProjects; 3329 private getConfiguredProjectByCanonicalConfigFilePath; 3330 private findExternalProjectByProjectName; 3331 private getFilenameForExceededTotalSizeLimitForNonTsFiles; 3332 private createExternalProject; 3333 private addFilesToNonInferredProject; 3334 private loadConfiguredProject; 3335 private updateNonInferredProjectFiles; 3336 private updateRootAndOptionsOfNonInferredProject; 3337 private reloadFileNamesOfParsedConfig; 3338 private setProjectForReload; 3339 private clearSemanticCache; 3340 private getOrCreateInferredProjectForProjectRootPathIfEnabled; 3341 private getOrCreateSingleInferredProjectIfEnabled; 3342 private getOrCreateSingleInferredWithoutProjectRoot; 3343 private createInferredProject; 3344 getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; 3345 private watchClosedScriptInfo; 3346 private createNodeModulesWatcher; 3347 private watchClosedScriptInfoInNodeModules; 3348 private getModifiedTime; 3349 private refreshScriptInfo; 3350 private refreshScriptInfosInDirectory; 3351 private stopWatchingScriptInfo; 3352 private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath; 3353 getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: { 3354 fileExists(path: string): boolean; 3355 }): ScriptInfo | undefined; 3356 private getOrCreateScriptInfoWorker; 3357 /** 3358 * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred 3359 */ 3360 getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; 3361 getScriptInfoForPath(fileName: Path): ScriptInfo | undefined; 3362 private addSourceInfoToSourceMap; 3363 private addMissingSourceMapFile; 3364 setHostConfiguration(args: protocol.ConfigureRequestArguments): void; 3365 private getWatchOptionsFromProjectWatchOptions; 3366 closeLog(): void; 3367 private sendSourceFileChange; 3368 /** 3369 * This function rebuilds the project for every file opened by the client 3370 * This does not reload contents of open files from disk. But we could do that if needed 3371 */ 3372 reloadProjects(): void; 3373 private removeRootOfInferredProjectIfNowPartOfOtherProject; 3374 private ensureProjectForOpenFiles; 3375 /** 3376 * Open file whose contents is managed by the client 3377 * @param filename is absolute pathname 3378 * @param fileContent is a known version of the file content that is more up to date than the one on disk 3379 */ 3380 openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; 3381 private findExternalProjectContainingOpenScriptInfo; 3382 private getOrCreateOpenScriptInfo; 3383 private assignProjectToOpenedScriptInfo; 3384 private tryFindDefaultConfiguredProjectForOpenScriptInfo; 3385 private isMatchedByConfig; 3386 private tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo; 3387 private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo; 3388 private ensureProjectChildren; 3389 private cleanupConfiguredProjects; 3390 private cleanupProjectsAndScriptInfos; 3391 private tryInvokeWildCardDirectories; 3392 openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; 3393 private removeOrphanScriptInfos; 3394 private telemetryOnOpenFile; 3395 /** 3396 * Close file whose contents is managed by the client 3397 * @param filename is absolute pathname 3398 */ 3399 closeClientFile(uncheckedFileName: string): void; 3400 private collectChanges; 3401 closeExternalProject(uncheckedFileName: string): void; 3402 openExternalProjects(projects: protocol.ExternalProject[]): void; 3403 private static readonly filenameEscapeRegexp; 3404 private static escapeFilenameForRegex; 3405 resetSafeList(): void; 3406 applySafeList(proj: protocol.ExternalProject): NormalizedPath[]; 3407 private applySafeListWorker; 3408 openExternalProject(proj: protocol.ExternalProject): void; 3409 hasDeferredExtension(): boolean; 3410 private endEnablePlugin; 3411 private enableRequestedPluginsAsync; 3412 private enableRequestedPluginsWorker; 3413 configurePlugin(args: protocol.ConfigurePluginRequestArguments): void; 3414 private watchPackageJsonFile; 3415 private onPackageJsonChange; 3416 } 3417 function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string; 3418 interface ServerCancellationToken extends HostCancellationToken { 3419 setRequest(requestId: number): void; 3420 resetRequest(requestId: number): void; 3421 } 3422 const nullCancellationToken: ServerCancellationToken; 3423 /** @deprecated use ts.server.protocol.CommandTypes */ 3424 type CommandNames = protocol.CommandTypes; 3425 /** @deprecated use ts.server.protocol.CommandTypes */ 3426 const CommandNames: any; 3427 type Event = <T extends object>(body: T, eventName: string) => void; 3428 interface EventSender { 3429 event: Event; 3430 } 3431 interface SessionOptions { 3432 host: ServerHost; 3433 cancellationToken: ServerCancellationToken; 3434 useSingleInferredProject: boolean; 3435 useInferredProjectPerProjectRoot: boolean; 3436 typingsInstaller?: ITypingsInstaller; 3437 byteLength: (buf: string, encoding?: BufferEncoding) => number; 3438 hrtime: (start?: [ 3439 number, 3440 number, 3441 ]) => [ 3442 number, 3443 number, 3444 ]; 3445 logger: Logger; 3446 /** 3447 * If falsy, all events are suppressed. 3448 */ 3449 canUseEvents: boolean; 3450 canUseWatchEvents?: boolean; 3451 eventHandler?: ProjectServiceEventHandler; 3452 /** Has no effect if eventHandler is also specified. */ 3453 suppressDiagnosticEvents?: boolean; 3454 serverMode?: LanguageServiceMode; 3455 throttleWaitMilliseconds?: number; 3456 noGetErrOnBackgroundUpdate?: boolean; 3457 globalPlugins?: readonly string[]; 3458 pluginProbeLocations?: readonly string[]; 3459 allowLocalPluginLoads?: boolean; 3460 typesMapLocation?: string; 3461 } 3462 class Session<TMessage = string> implements EventSender { 3463 private readonly gcTimer; 3464 protected projectService: ProjectService; 3465 private changeSeq; 3466 private performanceData; 3467 private currentRequestId; 3468 private errorCheck; 3469 protected host: ServerHost; 3470 private readonly cancellationToken; 3471 protected readonly typingsInstaller: ITypingsInstaller; 3472 protected byteLength: (buf: string, encoding?: BufferEncoding) => number; 3473 private hrtime; 3474 protected logger: Logger; 3475 protected canUseEvents: boolean; 3476 private suppressDiagnosticEvents?; 3477 private eventHandler; 3478 private readonly noGetErrOnBackgroundUpdate?; 3479 constructor(opts: SessionOptions); 3480 private sendRequestCompletedEvent; 3481 private addPerformanceData; 3482 private addDiagnosticsPerformanceData; 3483 private performanceEventHandler; 3484 private defaultEventHandler; 3485 private projectsUpdatedInBackgroundEvent; 3486 logError(err: Error, cmd: string): void; 3487 private logErrorWorker; 3488 send(msg: protocol.Message): void; 3489 protected writeMessage(msg: protocol.Message): void; 3490 event<T extends object>(body: T, eventName: string): void; 3491 private semanticCheck; 3492 private syntacticCheck; 3493 private suggestionCheck; 3494 private regionSemanticCheck; 3495 private sendDiagnosticsEvent; 3496 private updateErrorCheck; 3497 private cleanProjects; 3498 private cleanup; 3499 private getEncodedSyntacticClassifications; 3500 private getEncodedSemanticClassifications; 3501 private getProject; 3502 private getConfigFileAndProject; 3503 private getConfigFileDiagnostics; 3504 private convertToDiagnosticsWithLinePositionFromDiagnosticFile; 3505 private getCompilerOptionsDiagnostics; 3506 private convertToDiagnosticsWithLinePosition; 3507 private getDiagnosticsWorker; 3508 private getDefinition; 3509 private mapDefinitionInfoLocations; 3510 private getDefinitionAndBoundSpan; 3511 private findSourceDefinition; 3512 private getEmitOutput; 3513 private mapJSDocTagInfo; 3514 private mapDisplayParts; 3515 private mapSignatureHelpItems; 3516 private mapDefinitionInfo; 3517 private static mapToOriginalLocation; 3518 private toFileSpan; 3519 private toFileSpanWithContext; 3520 private getTypeDefinition; 3521 private mapImplementationLocations; 3522 private getImplementation; 3523 private getSyntacticDiagnosticsSync; 3524 private getSemanticDiagnosticsSync; 3525 private getSuggestionDiagnosticsSync; 3526 private getJsxClosingTag; 3527 private getLinkedEditingRange; 3528 private getDocumentHighlights; 3529 private provideInlayHints; 3530 private mapCode; 3531 private getCopilotRelatedInfo; 3532 private setCompilerOptionsForInferredProjects; 3533 private getProjectInfo; 3534 private getProjectInfoWorker; 3535 private getDefaultConfiguredProjectInfo; 3536 private getRenameInfo; 3537 private getProjects; 3538 private getDefaultProject; 3539 private getRenameLocations; 3540 private mapRenameInfo; 3541 private toSpanGroups; 3542 private getReferences; 3543 private getFileReferences; 3544 private openClientFile; 3545 private getPosition; 3546 private getPositionInFile; 3547 private getFileAndProject; 3548 private getFileAndLanguageServiceForSyntacticOperation; 3549 private getFileAndProjectWorker; 3550 private getOutliningSpans; 3551 private getTodoComments; 3552 private getDocCommentTemplate; 3553 private getSpanOfEnclosingComment; 3554 private getIndentation; 3555 private getBreakpointStatement; 3556 private getNameOrDottedNameSpan; 3557 private isValidBraceCompletion; 3558 private getQuickInfoWorker; 3559 private getFormattingEditsForRange; 3560 private getFormattingEditsForRangeFull; 3561 private getFormattingEditsForDocumentFull; 3562 private getFormattingEditsAfterKeystrokeFull; 3563 private getFormattingEditsAfterKeystroke; 3564 private getCompletions; 3565 private getCompletionEntryDetails; 3566 private getCompileOnSaveAffectedFileList; 3567 private emitFile; 3568 private getSignatureHelpItems; 3569 private toPendingErrorCheck; 3570 private getDiagnostics; 3571 private change; 3572 private reload; 3573 private saveToTmp; 3574 private closeClientFile; 3575 private mapLocationNavigationBarItems; 3576 private getNavigationBarItems; 3577 private toLocationNavigationTree; 3578 private getNavigationTree; 3579 private getNavigateToItems; 3580 private getFullNavigateToItems; 3581 private getSupportedCodeFixes; 3582 private isLocation; 3583 private extractPositionOrRange; 3584 private getRange; 3585 private getApplicableRefactors; 3586 private getEditsForRefactor; 3587 private getMoveToRefactoringFileSuggestions; 3588 private preparePasteEdits; 3589 private getPasteEdits; 3590 private organizeImports; 3591 private getEditsForFileRename; 3592 private getCodeFixes; 3593 private getCombinedCodeFix; 3594 private applyCodeActionCommand; 3595 private getStartAndEndPosition; 3596 private mapCodeAction; 3597 private mapCodeFixAction; 3598 private mapPasteEditsAction; 3599 private mapTextChangesToCodeEdits; 3600 private mapTextChangeToCodeEdit; 3601 private convertTextChangeToCodeEdit; 3602 private getBraceMatching; 3603 private getDiagnosticsForProject; 3604 private configurePlugin; 3605 private getSmartSelectionRange; 3606 private toggleLineComment; 3607 private toggleMultilineComment; 3608 private commentSelection; 3609 private uncommentSelection; 3610 private mapSelectionRange; 3611 private getScriptInfoFromProjectService; 3612 private toProtocolCallHierarchyItem; 3613 private toProtocolCallHierarchyIncomingCall; 3614 private toProtocolCallHierarchyOutgoingCall; 3615 private prepareCallHierarchy; 3616 private provideCallHierarchyIncomingCalls; 3617 private provideCallHierarchyOutgoingCalls; 3618 getCanonicalFileName(fileName: string): string; 3619 exit(): void; 3620 private notRequired; 3621 private requiredResponse; 3622 private handlers; 3623 addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void; 3624 private setCurrentRequest; 3625 private resetCurrentRequest; 3626 executeWithRequestId<T>(requestId: number, f: () => T): T; 3627 executeCommand(request: protocol.Request): HandlerResponse; 3628 onMessage(message: TMessage): void; 3629 protected parseMessage(message: TMessage): protocol.Request; 3630 protected toStringMessage(message: TMessage): string; 3631 private getFormatOptions; 3632 private getPreferences; 3633 private getHostFormatOptions; 3634 private getHostPreferences; 3635 } 3636 interface HandlerResponse { 3637 response?: {}; 3638 responseRequired?: boolean; 3639 } 3640 } 3641 namespace JsTyping { 3642 interface TypingResolutionHost { 3643 directoryExists(path: string): boolean; 3644 fileExists(fileName: string): boolean; 3645 readFile(path: string, encoding?: string): string | undefined; 3646 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[]; 3647 } 3648 } 3649 const versionMajorMinor = "5.9"; 3650 /** The version of the TypeScript compiler release */ 3651 const version: string; 3652 /** 3653 * Type of objects whose values are all of the same type. 3654 * The `in` and `for-in` operators can *not* be safely used, 3655 * since `Object.prototype` may be modified by outside code. 3656 */ 3657 interface MapLike<T> { 3658 [index: string]: T; 3659 } 3660 interface SortedReadonlyArray<T> extends ReadonlyArray<T> { 3661 " __sortedArrayBrand": any; 3662 } 3663 interface SortedArray<T> extends Array<T> { 3664 " __sortedArrayBrand": any; 3665 } 3666 type Path = string & { 3667 __pathBrand: any; 3668 }; 3669 interface TextRange { 3670 pos: number; 3671 end: number; 3672 } 3673 interface ReadonlyTextRange { 3674 readonly pos: number; 3675 readonly end: number; 3676 } 3677 enum SyntaxKind { 3678 Unknown = 0, 3679 EndOfFileToken = 1, 3680 SingleLineCommentTrivia = 2, 3681 MultiLineCommentTrivia = 3, 3682 NewLineTrivia = 4, 3683 WhitespaceTrivia = 5, 3684 ShebangTrivia = 6, 3685 ConflictMarkerTrivia = 7, 3686 NonTextFileMarkerTrivia = 8, 3687 NumericLiteral = 9, 3688 BigIntLiteral = 10, 3689 StringLiteral = 11, 3690 JsxText = 12, 3691 JsxTextAllWhiteSpaces = 13, 3692 RegularExpressionLiteral = 14, 3693 NoSubstitutionTemplateLiteral = 15, 3694 TemplateHead = 16, 3695 TemplateMiddle = 17, 3696 TemplateTail = 18, 3697 OpenBraceToken = 19, 3698 CloseBraceToken = 20, 3699 OpenParenToken = 21, 3700 CloseParenToken = 22, 3701 OpenBracketToken = 23, 3702 CloseBracketToken = 24, 3703 DotToken = 25, 3704 DotDotDotToken = 26, 3705 SemicolonToken = 27, 3706 CommaToken = 28, 3707 QuestionDotToken = 29, 3708 LessThanToken = 30, 3709 LessThanSlashToken = 31, 3710 GreaterThanToken = 32, 3711 LessThanEqualsToken = 33, 3712 GreaterThanEqualsToken = 34, 3713 EqualsEqualsToken = 35, 3714 ExclamationEqualsToken = 36, 3715 EqualsEqualsEqualsToken = 37, 3716 ExclamationEqualsEqualsToken = 38, 3717 EqualsGreaterThanToken = 39, 3718 PlusToken = 40, 3719 MinusToken = 41, 3720 AsteriskToken = 42, 3721 AsteriskAsteriskToken = 43, 3722 SlashToken = 44, 3723 PercentToken = 45, 3724 PlusPlusToken = 46, 3725 MinusMinusToken = 47, 3726 LessThanLessThanToken = 48, 3727 GreaterThanGreaterThanToken = 49, 3728 GreaterThanGreaterThanGreaterThanToken = 50, 3729 AmpersandToken = 51, 3730 BarToken = 52, 3731 CaretToken = 53, 3732 ExclamationToken = 54, 3733 TildeToken = 55, 3734 AmpersandAmpersandToken = 56, 3735 BarBarToken = 57, 3736 QuestionToken = 58, 3737 ColonToken = 59, 3738 AtToken = 60, 3739 QuestionQuestionToken = 61, 3740 /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */ 3741 BacktickToken = 62, 3742 /** Only the JSDoc scanner produces HashToken. The normal scanner produces PrivateIdentifier. */ 3743 HashToken = 63, 3744 EqualsToken = 64, 3745 PlusEqualsToken = 65, 3746 MinusEqualsToken = 66, 3747 AsteriskEqualsToken = 67, 3748 AsteriskAsteriskEqualsToken = 68, 3749 SlashEqualsToken = 69, 3750 PercentEqualsToken = 70, 3751 LessThanLessThanEqualsToken = 71, 3752 GreaterThanGreaterThanEqualsToken = 72, 3753 GreaterThanGreaterThanGreaterThanEqualsToken = 73, 3754 AmpersandEqualsToken = 74, 3755 BarEqualsToken = 75, 3756 BarBarEqualsToken = 76, 3757 AmpersandAmpersandEqualsToken = 77, 3758 QuestionQuestionEqualsToken = 78, 3759 CaretEqualsToken = 79, 3760 Identifier = 80, 3761 PrivateIdentifier = 81, 3762 BreakKeyword = 83, 3763 CaseKeyword = 84, 3764 CatchKeyword = 85, 3765 ClassKeyword = 86, 3766 ConstKeyword = 87, 3767 ContinueKeyword = 88, 3768 DebuggerKeyword = 89, 3769 DefaultKeyword = 90, 3770 DeleteKeyword = 91, 3771 DoKeyword = 92, 3772 ElseKeyword = 93, 3773 EnumKeyword = 94, 3774 ExportKeyword = 95, 3775 ExtendsKeyword = 96, 3776 FalseKeyword = 97, 3777 FinallyKeyword = 98, 3778 ForKeyword = 99, 3779 FunctionKeyword = 100, 3780 IfKeyword = 101, 3781 ImportKeyword = 102, 3782 InKeyword = 103, 3783 InstanceOfKeyword = 104, 3784 NewKeyword = 105, 3785 NullKeyword = 106, 3786 ReturnKeyword = 107, 3787 SuperKeyword = 108, 3788 SwitchKeyword = 109, 3789 ThisKeyword = 110, 3790 ThrowKeyword = 111, 3791 TrueKeyword = 112, 3792 TryKeyword = 113, 3793 TypeOfKeyword = 114, 3794 VarKeyword = 115, 3795 VoidKeyword = 116, 3796 WhileKeyword = 117, 3797 WithKeyword = 118, 3798 ImplementsKeyword = 119, 3799 InterfaceKeyword = 120, 3800 LetKeyword = 121, 3801 PackageKeyword = 122, 3802 PrivateKeyword = 123, 3803 ProtectedKeyword = 124, 3804 PublicKeyword = 125, 3805 StaticKeyword = 126, 3806 YieldKeyword = 127, 3807 AbstractKeyword = 128, 3808 AccessorKeyword = 129, 3809 AsKeyword = 130, 3810 AssertsKeyword = 131, 3811 AssertKeyword = 132, 3812 AnyKeyword = 133, 3813 AsyncKeyword = 134, 3814 AwaitKeyword = 135, 3815 BooleanKeyword = 136, 3816 ConstructorKeyword = 137, 3817 DeclareKeyword = 138, 3818 GetKeyword = 139, 3819 InferKeyword = 140, 3820 IntrinsicKeyword = 141, 3821 IsKeyword = 142, 3822 KeyOfKeyword = 143, 3823 ModuleKeyword = 144, 3824 NamespaceKeyword = 145, 3825 NeverKeyword = 146, 3826 OutKeyword = 147, 3827 ReadonlyKeyword = 148, 3828 RequireKeyword = 149, 3829 NumberKeyword = 150, 3830 ObjectKeyword = 151, 3831 SatisfiesKeyword = 152, 3832 SetKeyword = 153, 3833 StringKeyword = 154, 3834 SymbolKeyword = 155, 3835 TypeKeyword = 156, 3836 UndefinedKeyword = 157, 3837 UniqueKeyword = 158, 3838 UnknownKeyword = 159, 3839 UsingKeyword = 160, 3840 FromKeyword = 161, 3841 GlobalKeyword = 162, 3842 BigIntKeyword = 163, 3843 OverrideKeyword = 164, 3844 OfKeyword = 165, 3845 DeferKeyword = 166, 3846 QualifiedName = 167, 3847 ComputedPropertyName = 168, 3848 TypeParameter = 169, 3849 Parameter = 170, 3850 Decorator = 171, 3851 PropertySignature = 172, 3852 PropertyDeclaration = 173, 3853 MethodSignature = 174, 3854 MethodDeclaration = 175, 3855 ClassStaticBlockDeclaration = 176, 3856 Constructor = 177, 3857 GetAccessor = 178, 3858 SetAccessor = 179, 3859 CallSignature = 180, 3860 ConstructSignature = 181, 3861 IndexSignature = 182, 3862 TypePredicate = 183, 3863 TypeReference = 184, 3864 FunctionType = 185, 3865 ConstructorType = 186, 3866 TypeQuery = 187, 3867 TypeLiteral = 188, 3868 ArrayType = 189, 3869 TupleType = 190, 3870 OptionalType = 191, 3871 RestType = 192, 3872 UnionType = 193, 3873 IntersectionType = 194, 3874 ConditionalType = 195, 3875 InferType = 196, 3876 ParenthesizedType = 197, 3877 ThisType = 198, 3878 TypeOperator = 199, 3879 IndexedAccessType = 200, 3880 MappedType = 201, 3881 LiteralType = 202, 3882 NamedTupleMember = 203, 3883 TemplateLiteralType = 204, 3884 TemplateLiteralTypeSpan = 205, 3885 ImportType = 206, 3886 ObjectBindingPattern = 207, 3887 ArrayBindingPattern = 208, 3888 BindingElement = 209, 3889 ArrayLiteralExpression = 210, 3890 ObjectLiteralExpression = 211, 3891 PropertyAccessExpression = 212, 3892 ElementAccessExpression = 213, 3893 CallExpression = 214, 3894 NewExpression = 215, 3895 TaggedTemplateExpression = 216, 3896 TypeAssertionExpression = 217, 3897 ParenthesizedExpression = 218, 3898 FunctionExpression = 219, 3899 ArrowFunction = 220, 3900 DeleteExpression = 221, 3901 TypeOfExpression = 222, 3902 VoidExpression = 223, 3903 AwaitExpression = 224, 3904 PrefixUnaryExpression = 225, 3905 PostfixUnaryExpression = 226, 3906 BinaryExpression = 227, 3907 ConditionalExpression = 228, 3908 TemplateExpression = 229, 3909 YieldExpression = 230, 3910 SpreadElement = 231, 3911 ClassExpression = 232, 3912 OmittedExpression = 233, 3913 ExpressionWithTypeArguments = 234, 3914 AsExpression = 235, 3915 NonNullExpression = 236, 3916 MetaProperty = 237, 3917 SyntheticExpression = 238, 3918 SatisfiesExpression = 239, 3919 TemplateSpan = 240, 3920 SemicolonClassElement = 241, 3921 Block = 242, 3922 EmptyStatement = 243, 3923 VariableStatement = 244, 3924 ExpressionStatement = 245, 3925 IfStatement = 246, 3926 DoStatement = 247, 3927 WhileStatement = 248, 3928 ForStatement = 249, 3929 ForInStatement = 250, 3930 ForOfStatement = 251, 3931 ContinueStatement = 252, 3932 BreakStatement = 253, 3933 ReturnStatement = 254, 3934 WithStatement = 255, 3935 SwitchStatement = 256, 3936 LabeledStatement = 257, 3937 ThrowStatement = 258, 3938 TryStatement = 259, 3939 DebuggerStatement = 260, 3940 VariableDeclaration = 261, 3941 VariableDeclarationList = 262, 3942 FunctionDeclaration = 263, 3943 ClassDeclaration = 264, 3944 InterfaceDeclaration = 265, 3945 TypeAliasDeclaration = 266, 3946 EnumDeclaration = 267, 3947 ModuleDeclaration = 268, 3948 ModuleBlock = 269, 3949 CaseBlock = 270, 3950 NamespaceExportDeclaration = 271, 3951 ImportEqualsDeclaration = 272, 3952 ImportDeclaration = 273, 3953 ImportClause = 274, 3954 NamespaceImport = 275, 3955 NamedImports = 276, 3956 ImportSpecifier = 277, 3957 ExportAssignment = 278, 3958 ExportDeclaration = 279, 3959 NamedExports = 280, 3960 NamespaceExport = 281, 3961 ExportSpecifier = 282, 3962 MissingDeclaration = 283, 3963 ExternalModuleReference = 284, 3964 JsxElement = 285, 3965 JsxSelfClosingElement = 286, 3966 JsxOpeningElement = 287, 3967 JsxClosingElement = 288, 3968 JsxFragment = 289, 3969 JsxOpeningFragment = 290, 3970 JsxClosingFragment = 291, 3971 JsxAttribute = 292, 3972 JsxAttributes = 293, 3973 JsxSpreadAttribute = 294, 3974 JsxExpression = 295, 3975 JsxNamespacedName = 296, 3976 CaseClause = 297, 3977 DefaultClause = 298, 3978 HeritageClause = 299, 3979 CatchClause = 300, 3980 ImportAttributes = 301, 3981 ImportAttribute = 302, 3982 /** @deprecated */ AssertClause = 301, 3983 /** @deprecated */ AssertEntry = 302, 3984 /** @deprecated */ ImportTypeAssertionContainer = 303, 3985 PropertyAssignment = 304, 3986 ShorthandPropertyAssignment = 305, 3987 SpreadAssignment = 306, 3988 EnumMember = 307, 3989 SourceFile = 308, 3990 Bundle = 309, 3991 JSDocTypeExpression = 310, 3992 JSDocNameReference = 311, 3993 JSDocMemberName = 312, 3994 JSDocAllType = 313, 3995 JSDocUnknownType = 314, 3996 JSDocNullableType = 315, 3997 JSDocNonNullableType = 316, 3998 JSDocOptionalType = 317, 3999 JSDocFunctionType = 318, 4000 JSDocVariadicType = 319, 4001 JSDocNamepathType = 320, 4002 JSDoc = 321, 4003 /** @deprecated Use SyntaxKind.JSDoc */ 4004 JSDocComment = 321, 4005 JSDocText = 322, 4006 JSDocTypeLiteral = 323, 4007 JSDocSignature = 324, 4008 JSDocLink = 325, 4009 JSDocLinkCode = 326, 4010 JSDocLinkPlain = 327, 4011 JSDocTag = 328, 4012 JSDocAugmentsTag = 329, 4013 JSDocImplementsTag = 330, 4014 JSDocAuthorTag = 331, 4015 JSDocDeprecatedTag = 332, 4016 JSDocClassTag = 333, 4017 JSDocPublicTag = 334, 4018 JSDocPrivateTag = 335, 4019 JSDocProtectedTag = 336, 4020 JSDocReadonlyTag = 337, 4021 JSDocOverrideTag = 338, 4022 JSDocCallbackTag = 339, 4023 JSDocOverloadTag = 340, 4024 JSDocEnumTag = 341, 4025 JSDocParameterTag = 342, 4026 JSDocReturnTag = 343, 4027 JSDocThisTag = 344, 4028 JSDocTypeTag = 345, 4029 JSDocTemplateTag = 346, 4030 JSDocTypedefTag = 347, 4031 JSDocSeeTag = 348, 4032 JSDocPropertyTag = 349, 4033 JSDocThrowsTag = 350, 4034 JSDocSatisfiesTag = 351, 4035 JSDocImportTag = 352, 4036 SyntaxList = 353, 4037 NotEmittedStatement = 354, 4038 NotEmittedTypeElement = 355, 4039 PartiallyEmittedExpression = 356, 4040 CommaListExpression = 357, 4041 SyntheticReferenceExpression = 358, 4042 Count = 359, 4043 FirstAssignment = 64, 4044 LastAssignment = 79, 4045 FirstCompoundAssignment = 65, 4046 LastCompoundAssignment = 79, 4047 FirstReservedWord = 83, 4048 LastReservedWord = 118, 4049 FirstKeyword = 83, 4050 LastKeyword = 166, 4051 FirstFutureReservedWord = 119, 4052 LastFutureReservedWord = 127, 4053 FirstTypeNode = 183, 4054 LastTypeNode = 206, 4055 FirstPunctuation = 19, 4056 LastPunctuation = 79, 4057 FirstToken = 0, 4058 LastToken = 166, 4059 FirstTriviaToken = 2, 4060 LastTriviaToken = 7, 4061 FirstLiteralToken = 9, 4062 LastLiteralToken = 15, 4063 FirstTemplateToken = 15, 4064 LastTemplateToken = 18, 4065 FirstBinaryOperator = 30, 4066 LastBinaryOperator = 79, 4067 FirstStatement = 244, 4068 LastStatement = 260, 4069 FirstNode = 167, 4070 FirstJSDocNode = 310, 4071 LastJSDocNode = 352, 4072 FirstJSDocTagNode = 328, 4073 LastJSDocTagNode = 352, 4074 } 4075 type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; 4076 type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; 4077 type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; 4078 type PunctuationSyntaxKind = 4079 | SyntaxKind.OpenBraceToken 4080 | SyntaxKind.CloseBraceToken 4081 | SyntaxKind.OpenParenToken 4082 | SyntaxKind.CloseParenToken 4083 | SyntaxKind.OpenBracketToken 4084 | SyntaxKind.CloseBracketToken 4085 | SyntaxKind.DotToken 4086 | SyntaxKind.DotDotDotToken 4087 | SyntaxKind.SemicolonToken 4088 | SyntaxKind.CommaToken 4089 | SyntaxKind.QuestionDotToken 4090 | SyntaxKind.LessThanToken 4091 | SyntaxKind.LessThanSlashToken 4092 | SyntaxKind.GreaterThanToken 4093 | SyntaxKind.LessThanEqualsToken 4094 | SyntaxKind.GreaterThanEqualsToken 4095 | SyntaxKind.EqualsEqualsToken 4096 | SyntaxKind.ExclamationEqualsToken 4097 | SyntaxKind.EqualsEqualsEqualsToken 4098 | SyntaxKind.ExclamationEqualsEqualsToken 4099 | SyntaxKind.EqualsGreaterThanToken 4100 | SyntaxKind.PlusToken 4101 | SyntaxKind.MinusToken 4102 | SyntaxKind.AsteriskToken 4103 | SyntaxKind.AsteriskAsteriskToken 4104 | SyntaxKind.SlashToken 4105 | SyntaxKind.PercentToken 4106 | SyntaxKind.PlusPlusToken 4107 | SyntaxKind.MinusMinusToken 4108 | SyntaxKind.LessThanLessThanToken 4109 | SyntaxKind.GreaterThanGreaterThanToken 4110 | SyntaxKind.GreaterThanGreaterThanGreaterThanToken 4111 | SyntaxKind.AmpersandToken 4112 | SyntaxKind.BarToken 4113 | SyntaxKind.CaretToken 4114 | SyntaxKind.ExclamationToken 4115 | SyntaxKind.TildeToken 4116 | SyntaxKind.AmpersandAmpersandToken 4117 | SyntaxKind.AmpersandAmpersandEqualsToken 4118 | SyntaxKind.BarBarToken 4119 | SyntaxKind.BarBarEqualsToken 4120 | SyntaxKind.QuestionQuestionToken 4121 | SyntaxKind.QuestionQuestionEqualsToken 4122 | SyntaxKind.QuestionToken 4123 | SyntaxKind.ColonToken 4124 | SyntaxKind.AtToken 4125 | SyntaxKind.BacktickToken 4126 | SyntaxKind.HashToken 4127 | SyntaxKind.EqualsToken 4128 | SyntaxKind.PlusEqualsToken 4129 | SyntaxKind.MinusEqualsToken 4130 | SyntaxKind.AsteriskEqualsToken 4131 | SyntaxKind.AsteriskAsteriskEqualsToken 4132 | SyntaxKind.SlashEqualsToken 4133 | SyntaxKind.PercentEqualsToken 4134 | SyntaxKind.LessThanLessThanEqualsToken 4135 | SyntaxKind.GreaterThanGreaterThanEqualsToken 4136 | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken 4137 | SyntaxKind.AmpersandEqualsToken 4138 | SyntaxKind.BarEqualsToken 4139 | SyntaxKind.CaretEqualsToken; 4140 type KeywordSyntaxKind = 4141 | SyntaxKind.AbstractKeyword 4142 | SyntaxKind.AccessorKeyword 4143 | SyntaxKind.AnyKeyword 4144 | SyntaxKind.AsKeyword 4145 | SyntaxKind.AssertsKeyword 4146 | SyntaxKind.AssertKeyword 4147 | SyntaxKind.AsyncKeyword 4148 | SyntaxKind.AwaitKeyword 4149 | SyntaxKind.BigIntKeyword 4150 | SyntaxKind.BooleanKeyword 4151 | SyntaxKind.BreakKeyword 4152 | SyntaxKind.CaseKeyword 4153 | SyntaxKind.CatchKeyword 4154 | SyntaxKind.ClassKeyword 4155 | SyntaxKind.ConstKeyword 4156 | SyntaxKind.ConstructorKeyword 4157 | SyntaxKind.ContinueKeyword 4158 | SyntaxKind.DebuggerKeyword 4159 | SyntaxKind.DeclareKeyword 4160 | SyntaxKind.DefaultKeyword 4161 | SyntaxKind.DeferKeyword 4162 | SyntaxKind.DeleteKeyword 4163 | SyntaxKind.DoKeyword 4164 | SyntaxKind.ElseKeyword 4165 | SyntaxKind.EnumKeyword 4166 | SyntaxKind.ExportKeyword 4167 | SyntaxKind.ExtendsKeyword 4168 | SyntaxKind.FalseKeyword 4169 | SyntaxKind.FinallyKeyword 4170 | SyntaxKind.ForKeyword 4171 | SyntaxKind.FromKeyword 4172 | SyntaxKind.FunctionKeyword 4173 | SyntaxKind.GetKeyword 4174 | SyntaxKind.GlobalKeyword 4175 | SyntaxKind.IfKeyword 4176 | SyntaxKind.ImplementsKeyword 4177 | SyntaxKind.ImportKeyword 4178 | SyntaxKind.InferKeyword 4179 | SyntaxKind.InKeyword 4180 | SyntaxKind.InstanceOfKeyword 4181 | SyntaxKind.InterfaceKeyword 4182 | SyntaxKind.IntrinsicKeyword 4183 | SyntaxKind.IsKeyword 4184 | SyntaxKind.KeyOfKeyword 4185 | SyntaxKind.LetKeyword 4186 | SyntaxKind.ModuleKeyword 4187 | SyntaxKind.NamespaceKeyword 4188 | SyntaxKind.NeverKeyword 4189 | SyntaxKind.NewKeyword 4190 | SyntaxKind.NullKeyword 4191 | SyntaxKind.NumberKeyword 4192 | SyntaxKind.ObjectKeyword 4193 | SyntaxKind.OfKeyword 4194 | SyntaxKind.PackageKeyword 4195 | SyntaxKind.PrivateKeyword 4196 | SyntaxKind.ProtectedKeyword 4197 | SyntaxKind.PublicKeyword 4198 | SyntaxKind.ReadonlyKeyword 4199 | SyntaxKind.OutKeyword 4200 | SyntaxKind.OverrideKeyword 4201 | SyntaxKind.RequireKeyword 4202 | SyntaxKind.ReturnKeyword 4203 | SyntaxKind.SatisfiesKeyword 4204 | SyntaxKind.SetKeyword 4205 | SyntaxKind.StaticKeyword 4206 | SyntaxKind.StringKeyword 4207 | SyntaxKind.SuperKeyword 4208 | SyntaxKind.SwitchKeyword 4209 | SyntaxKind.SymbolKeyword 4210 | SyntaxKind.ThisKeyword 4211 | SyntaxKind.ThrowKeyword 4212 | SyntaxKind.TrueKeyword 4213 | SyntaxKind.TryKeyword 4214 | SyntaxKind.TypeKeyword 4215 | SyntaxKind.TypeOfKeyword 4216 | SyntaxKind.UndefinedKeyword 4217 | SyntaxKind.UniqueKeyword 4218 | SyntaxKind.UnknownKeyword 4219 | SyntaxKind.UsingKeyword 4220 | SyntaxKind.VarKeyword 4221 | SyntaxKind.VoidKeyword 4222 | SyntaxKind.WhileKeyword 4223 | SyntaxKind.WithKeyword 4224 | SyntaxKind.YieldKeyword; 4225 type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword; 4226 type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; 4227 type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; 4228 type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; 4229 type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind; 4230 enum NodeFlags { 4231 None = 0, 4232 Let = 1, 4233 Const = 2, 4234 Using = 4, 4235 AwaitUsing = 6, 4236 NestedNamespace = 8, 4237 Synthesized = 16, 4238 Namespace = 32, 4239 OptionalChain = 64, 4240 ExportContext = 128, 4241 ContainsThis = 256, 4242 HasImplicitReturn = 512, 4243 HasExplicitReturn = 1024, 4244 GlobalAugmentation = 2048, 4245 HasAsyncFunctions = 4096, 4246 DisallowInContext = 8192, 4247 YieldContext = 16384, 4248 DecoratorContext = 32768, 4249 AwaitContext = 65536, 4250 DisallowConditionalTypesContext = 131072, 4251 ThisNodeHasError = 262144, 4252 JavaScriptFile = 524288, 4253 ThisNodeOrAnySubNodesHasError = 1048576, 4254 HasAggregatedChildData = 2097152, 4255 JSDoc = 16777216, 4256 JsonFile = 134217728, 4257 BlockScoped = 7, 4258 Constant = 6, 4259 ReachabilityCheckFlags = 1536, 4260 ReachabilityAndEmitFlags = 5632, 4261 ContextFlags = 101441536, 4262 TypeExcludesFlags = 81920, 4263 } 4264 enum ModifierFlags { 4265 None = 0, 4266 Public = 1, 4267 Private = 2, 4268 Protected = 4, 4269 Readonly = 8, 4270 Override = 16, 4271 Export = 32, 4272 Abstract = 64, 4273 Ambient = 128, 4274 Static = 256, 4275 Accessor = 512, 4276 Async = 1024, 4277 Default = 2048, 4278 Const = 4096, 4279 In = 8192, 4280 Out = 16384, 4281 Decorator = 32768, 4282 Deprecated = 65536, 4283 HasComputedJSDocModifiers = 268435456, 4284 HasComputedFlags = 536870912, 4285 AccessibilityModifier = 7, 4286 ParameterPropertyModifier = 31, 4287 NonPublicAccessibilityModifier = 6, 4288 TypeScriptModifier = 28895, 4289 ExportDefault = 2080, 4290 All = 131071, 4291 Modifier = 98303, 4292 } 4293 enum JsxFlags { 4294 None = 0, 4295 /** An element from a named property of the JSX.IntrinsicElements interface */ 4296 IntrinsicNamedElement = 1, 4297 /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */ 4298 IntrinsicIndexedElement = 2, 4299 IntrinsicElement = 3, 4300 } 4301 interface Node extends ReadonlyTextRange { 4302 readonly kind: SyntaxKind; 4303 readonly flags: NodeFlags; 4304 readonly parent: Node; 4305 } 4306 interface Node { 4307 getSourceFile(): SourceFile; 4308 getChildCount(sourceFile?: SourceFile): number; 4309 getChildAt(index: number, sourceFile?: SourceFile): Node; 4310 getChildren(sourceFile?: SourceFile): readonly Node[]; 4311 getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number; 4312 getFullStart(): number; 4313 getEnd(): number; 4314 getWidth(sourceFile?: SourceFileLike): number; 4315 getFullWidth(): number; 4316 getLeadingTriviaWidth(sourceFile?: SourceFile): number; 4317 getFullText(sourceFile?: SourceFile): string; 4318 getText(sourceFile?: SourceFile): string; 4319 getFirstToken(sourceFile?: SourceFile): Node | undefined; 4320 getLastToken(sourceFile?: SourceFile): Node | undefined; 4321 forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; 4322 } 4323 interface JSDocContainer extends Node { 4324 _jsdocContainerBrand: any; 4325 } 4326 interface LocalsContainer extends Node { 4327 _localsContainerBrand: any; 4328 } 4329 interface FlowContainer extends Node { 4330 _flowContainerBrand: any; 4331 } 4332 type HasJSDoc = 4333 | AccessorDeclaration 4334 | ArrowFunction 4335 | BinaryExpression 4336 | Block 4337 | BreakStatement 4338 | CallSignatureDeclaration 4339 | CaseClause 4340 | ClassLikeDeclaration 4341 | ClassStaticBlockDeclaration 4342 | ConstructorDeclaration 4343 | ConstructorTypeNode 4344 | ConstructSignatureDeclaration 4345 | ContinueStatement 4346 | DebuggerStatement 4347 | DoStatement 4348 | ElementAccessExpression 4349 | EmptyStatement 4350 | EndOfFileToken 4351 | EnumDeclaration 4352 | EnumMember 4353 | ExportAssignment 4354 | ExportDeclaration 4355 | ExportSpecifier 4356 | ExpressionStatement 4357 | ForInStatement 4358 | ForOfStatement 4359 | ForStatement 4360 | FunctionDeclaration 4361 | FunctionExpression 4362 | FunctionTypeNode 4363 | Identifier 4364 | IfStatement 4365 | ImportDeclaration 4366 | ImportEqualsDeclaration 4367 | IndexSignatureDeclaration 4368 | InterfaceDeclaration 4369 | JSDocFunctionType 4370 | JSDocSignature 4371 | LabeledStatement 4372 | MethodDeclaration 4373 | MethodSignature 4374 | ModuleDeclaration 4375 | NamedTupleMember 4376 | NamespaceExportDeclaration 4377 | ObjectLiteralExpression 4378 | ParameterDeclaration 4379 | ParenthesizedExpression 4380 | PropertyAccessExpression 4381 | PropertyAssignment 4382 | PropertyDeclaration 4383 | PropertySignature 4384 | ReturnStatement 4385 | SemicolonClassElement 4386 | ShorthandPropertyAssignment 4387 | SpreadAssignment 4388 | SwitchStatement 4389 | ThrowStatement 4390 | TryStatement 4391 | TypeAliasDeclaration 4392 | TypeParameterDeclaration 4393 | VariableDeclaration 4394 | VariableStatement 4395 | WhileStatement 4396 | WithStatement; 4397 type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; 4398 type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement; 4399 type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; 4400 type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | EnumMember; 4401 type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration; 4402 type HasModifiers = TypeParameterDeclaration | ParameterDeclaration | ConstructorTypeNode | PropertySignature | PropertyDeclaration | MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | IndexSignatureDeclaration | FunctionExpression | ArrowFunction | ClassExpression | VariableStatement | FunctionDeclaration | ClassDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | ExportAssignment | ExportDeclaration; 4403 interface NodeArray<T extends Node> extends ReadonlyArray<T>, ReadonlyTextRange { 4404 readonly hasTrailingComma: boolean; 4405 } 4406 interface Token<TKind extends SyntaxKind> extends Node { 4407 readonly kind: TKind; 4408 } 4409 type EndOfFileToken = Token<SyntaxKind.EndOfFileToken> & JSDocContainer; 4410 interface PunctuationToken<TKind extends PunctuationSyntaxKind> extends Token<TKind> { 4411 } 4412 type DotToken = PunctuationToken<SyntaxKind.DotToken>; 4413 type DotDotDotToken = PunctuationToken<SyntaxKind.DotDotDotToken>; 4414 type QuestionToken = PunctuationToken<SyntaxKind.QuestionToken>; 4415 type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>; 4416 type ColonToken = PunctuationToken<SyntaxKind.ColonToken>; 4417 type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>; 4418 type AmpersandAmpersandEqualsToken = PunctuationToken<SyntaxKind.AmpersandAmpersandEqualsToken>; 4419 type BarBarEqualsToken = PunctuationToken<SyntaxKind.BarBarEqualsToken>; 4420 type QuestionQuestionEqualsToken = PunctuationToken<SyntaxKind.QuestionQuestionEqualsToken>; 4421 type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>; 4422 type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>; 4423 type PlusToken = PunctuationToken<SyntaxKind.PlusToken>; 4424 type MinusToken = PunctuationToken<SyntaxKind.MinusToken>; 4425 type QuestionDotToken = PunctuationToken<SyntaxKind.QuestionDotToken>; 4426 interface KeywordToken<TKind extends KeywordSyntaxKind> extends Token<TKind> { 4427 } 4428 type AssertsKeyword = KeywordToken<SyntaxKind.AssertsKeyword>; 4429 type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>; 4430 type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>; 4431 type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>; 4432 interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> { 4433 } 4434 type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>; 4435 type AccessorKeyword = ModifierToken<SyntaxKind.AccessorKeyword>; 4436 type AsyncKeyword = ModifierToken<SyntaxKind.AsyncKeyword>; 4437 type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>; 4438 type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>; 4439 type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>; 4440 type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>; 4441 type InKeyword = ModifierToken<SyntaxKind.InKeyword>; 4442 type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>; 4443 type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>; 4444 type PublicKeyword = ModifierToken<SyntaxKind.PublicKeyword>; 4445 type ReadonlyKeyword = ModifierToken<SyntaxKind.ReadonlyKeyword>; 4446 type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>; 4447 type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>; 4448 type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>; 4449 type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword; 4450 type ModifierLike = Modifier | Decorator; 4451 type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword; 4452 type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword; 4453 type ClassMemberModifier = AccessibilityModifier | ReadonlyKeyword | StaticKeyword | AccessorKeyword; 4454 type ModifiersArray = NodeArray<Modifier>; 4455 enum GeneratedIdentifierFlags { 4456 None = 0, 4457 ReservedInNestedScopes = 8, 4458 Optimistic = 16, 4459 FileLevel = 32, 4460 AllowNameSubstitution = 64, 4461 } 4462 interface Identifier extends PrimaryExpression, Declaration, JSDocContainer, FlowContainer { 4463 readonly kind: SyntaxKind.Identifier; 4464 /** 4465 * Prefer to use `id.unescapedText`. (Note: This is available only in services, not internally to the TypeScript compiler.) 4466 * Text of identifier, but if the identifier begins with two underscores, this will begin with three. 4467 */ 4468 readonly escapedText: __String; 4469 } 4470 interface Identifier { 4471 readonly text: string; 4472 } 4473 interface TransientIdentifier extends Identifier { 4474 resolvedSymbol: Symbol; 4475 } 4476 interface QualifiedName extends Node, FlowContainer { 4477 readonly kind: SyntaxKind.QualifiedName; 4478 readonly left: EntityName; 4479 readonly right: Identifier; 4480 } 4481 type EntityName = Identifier | QualifiedName; 4482 type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | BigIntLiteral; 4483 type MemberName = Identifier | PrivateIdentifier; 4484 type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression; 4485 interface Declaration extends Node { 4486 _declarationBrand: any; 4487 } 4488 interface NamedDeclaration extends Declaration { 4489 readonly name?: DeclarationName; 4490 } 4491 interface DeclarationStatement extends NamedDeclaration, Statement { 4492 readonly name?: Identifier | StringLiteral | NumericLiteral; 4493 } 4494 interface ComputedPropertyName extends Node { 4495 readonly kind: SyntaxKind.ComputedPropertyName; 4496 readonly parent: Declaration; 4497 readonly expression: Expression; 4498 } 4499 interface PrivateIdentifier extends PrimaryExpression { 4500 readonly kind: SyntaxKind.PrivateIdentifier; 4501 readonly escapedText: __String; 4502 } 4503 interface PrivateIdentifier { 4504 readonly text: string; 4505 } 4506 interface Decorator extends Node { 4507 readonly kind: SyntaxKind.Decorator; 4508 readonly parent: NamedDeclaration; 4509 readonly expression: LeftHandSideExpression; 4510 } 4511 interface TypeParameterDeclaration extends NamedDeclaration, JSDocContainer { 4512 readonly kind: SyntaxKind.TypeParameter; 4513 readonly parent: DeclarationWithTypeParameterChildren | InferTypeNode; 4514 readonly modifiers?: NodeArray<Modifier>; 4515 readonly name: Identifier; 4516 /** Note: Consider calling `getEffectiveConstraintOfTypeParameter` */ 4517 readonly constraint?: TypeNode; 4518 readonly default?: TypeNode; 4519 expression?: Expression; 4520 } 4521 interface SignatureDeclarationBase extends NamedDeclaration, JSDocContainer { 4522 readonly kind: SignatureDeclaration["kind"]; 4523 readonly name?: PropertyName; 4524 readonly typeParameters?: NodeArray<TypeParameterDeclaration> | undefined; 4525 readonly parameters: NodeArray<ParameterDeclaration>; 4526 readonly type?: TypeNode | undefined; 4527 } 4528 type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction; 4529 interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement, LocalsContainer { 4530 readonly kind: SyntaxKind.CallSignature; 4531 } 4532 interface ConstructSignatureDeclaration extends SignatureDeclarationBase, TypeElement, LocalsContainer { 4533 readonly kind: SyntaxKind.ConstructSignature; 4534 } 4535 type BindingName = Identifier | BindingPattern; 4536 interface VariableDeclaration extends NamedDeclaration, JSDocContainer { 4537 readonly kind: SyntaxKind.VariableDeclaration; 4538 readonly parent: VariableDeclarationList | CatchClause; 4539 readonly name: BindingName; 4540 readonly exclamationToken?: ExclamationToken; 4541 readonly type?: TypeNode; 4542 readonly initializer?: Expression; 4543 } 4544 interface VariableDeclarationList extends Node { 4545 readonly kind: SyntaxKind.VariableDeclarationList; 4546 readonly parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement; 4547 readonly declarations: NodeArray<VariableDeclaration>; 4548 } 4549 interface ParameterDeclaration extends NamedDeclaration, JSDocContainer { 4550 readonly kind: SyntaxKind.Parameter; 4551 readonly parent: SignatureDeclaration; 4552 readonly modifiers?: NodeArray<ModifierLike>; 4553 readonly dotDotDotToken?: DotDotDotToken; 4554 readonly name: BindingName; 4555 readonly questionToken?: QuestionToken; 4556 readonly type?: TypeNode; 4557 readonly initializer?: Expression; 4558 } 4559 interface BindingElement extends NamedDeclaration, FlowContainer { 4560 readonly kind: SyntaxKind.BindingElement; 4561 readonly parent: BindingPattern; 4562 readonly propertyName?: PropertyName; 4563 readonly dotDotDotToken?: DotDotDotToken; 4564 readonly name: BindingName; 4565 readonly initializer?: Expression; 4566 } 4567 interface PropertySignature extends TypeElement, JSDocContainer { 4568 readonly kind: SyntaxKind.PropertySignature; 4569 readonly parent: TypeLiteralNode | InterfaceDeclaration; 4570 readonly modifiers?: NodeArray<Modifier>; 4571 readonly name: PropertyName; 4572 readonly questionToken?: QuestionToken; 4573 readonly type?: TypeNode; 4574 } 4575 interface PropertyDeclaration extends ClassElement, JSDocContainer { 4576 readonly kind: SyntaxKind.PropertyDeclaration; 4577 readonly parent: ClassLikeDeclaration; 4578 readonly modifiers?: NodeArray<ModifierLike>; 4579 readonly name: PropertyName; 4580 readonly questionToken?: QuestionToken; 4581 readonly exclamationToken?: ExclamationToken; 4582 readonly type?: TypeNode; 4583 readonly initializer?: Expression; 4584 } 4585 interface AutoAccessorPropertyDeclaration extends PropertyDeclaration { 4586 _autoAccessorBrand: any; 4587 } 4588 interface ObjectLiteralElement extends NamedDeclaration { 4589 _objectLiteralBrand: any; 4590 readonly name?: PropertyName; 4591 } 4592 /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ 4593 type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; 4594 interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer { 4595 readonly kind: SyntaxKind.PropertyAssignment; 4596 readonly parent: ObjectLiteralExpression; 4597 readonly name: PropertyName; 4598 readonly initializer: Expression; 4599 } 4600 interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer { 4601 readonly kind: SyntaxKind.ShorthandPropertyAssignment; 4602 readonly parent: ObjectLiteralExpression; 4603 readonly name: Identifier; 4604 readonly equalsToken?: EqualsToken; 4605 readonly objectAssignmentInitializer?: Expression; 4606 } 4607 interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer { 4608 readonly kind: SyntaxKind.SpreadAssignment; 4609 readonly parent: ObjectLiteralExpression; 4610 readonly expression: Expression; 4611 } 4612 type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; 4613 interface ObjectBindingPattern extends Node { 4614 readonly kind: SyntaxKind.ObjectBindingPattern; 4615 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement; 4616 readonly elements: NodeArray<BindingElement>; 4617 } 4618 interface ArrayBindingPattern extends Node { 4619 readonly kind: SyntaxKind.ArrayBindingPattern; 4620 readonly parent: VariableDeclaration | ParameterDeclaration | BindingElement; 4621 readonly elements: NodeArray<ArrayBindingElement>; 4622 } 4623 type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; 4624 type ArrayBindingElement = BindingElement | OmittedExpression; 4625 /** 4626 * Several node kinds share function-like features such as a signature, 4627 * a name, and a body. These nodes should extend FunctionLikeDeclarationBase. 4628 * Examples: 4629 * - FunctionDeclaration 4630 * - MethodDeclaration 4631 * - AccessorDeclaration 4632 */ 4633 interface FunctionLikeDeclarationBase extends SignatureDeclarationBase { 4634 _functionLikeDeclarationBrand: any; 4635 readonly asteriskToken?: AsteriskToken | undefined; 4636 readonly questionToken?: QuestionToken | undefined; 4637 readonly exclamationToken?: ExclamationToken | undefined; 4638 readonly body?: Block | Expression | undefined; 4639 } 4640 type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction; 4641 /** @deprecated Use SignatureDeclaration */ 4642 type FunctionLike = SignatureDeclaration; 4643 interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement, LocalsContainer { 4644 readonly kind: SyntaxKind.FunctionDeclaration; 4645 readonly modifiers?: NodeArray<ModifierLike>; 4646 readonly name?: Identifier; 4647 readonly body?: FunctionBody; 4648 } 4649 interface MethodSignature extends SignatureDeclarationBase, TypeElement, LocalsContainer { 4650 readonly kind: SyntaxKind.MethodSignature; 4651 readonly parent: TypeLiteralNode | InterfaceDeclaration; 4652 readonly modifiers?: NodeArray<Modifier>; 4653 readonly name: PropertyName; 4654 } 4655 interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer { 4656 readonly kind: SyntaxKind.MethodDeclaration; 4657 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression; 4658 readonly modifiers?: NodeArray<ModifierLike> | undefined; 4659 readonly name: PropertyName; 4660 readonly body?: FunctionBody | undefined; 4661 } 4662 interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer, LocalsContainer { 4663 readonly kind: SyntaxKind.Constructor; 4664 readonly parent: ClassLikeDeclaration; 4665 readonly modifiers?: NodeArray<ModifierLike> | undefined; 4666 readonly body?: FunctionBody | undefined; 4667 } 4668 /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ 4669 interface SemicolonClassElement extends ClassElement, JSDocContainer { 4670 readonly kind: SyntaxKind.SemicolonClassElement; 4671 readonly parent: ClassLikeDeclaration; 4672 } 4673 interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer { 4674 readonly kind: SyntaxKind.GetAccessor; 4675 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration; 4676 readonly modifiers?: NodeArray<ModifierLike>; 4677 readonly name: PropertyName; 4678 readonly body?: FunctionBody; 4679 } 4680 interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, TypeElement, ObjectLiteralElement, JSDocContainer, LocalsContainer, FlowContainer { 4681 readonly kind: SyntaxKind.SetAccessor; 4682 readonly parent: ClassLikeDeclaration | ObjectLiteralExpression | TypeLiteralNode | InterfaceDeclaration; 4683 readonly modifiers?: NodeArray<ModifierLike>; 4684 readonly name: PropertyName; 4685 readonly body?: FunctionBody; 4686 } 4687 type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; 4688 interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement, LocalsContainer { 4689 readonly kind: SyntaxKind.IndexSignature; 4690 readonly parent: ObjectTypeDeclaration; 4691 readonly modifiers?: NodeArray<ModifierLike>; 4692 readonly type: TypeNode; 4693 } 4694 interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer, LocalsContainer { 4695 readonly kind: SyntaxKind.ClassStaticBlockDeclaration; 4696 readonly parent: ClassDeclaration | ClassExpression; 4697 readonly body: Block; 4698 } 4699 interface TypeNode extends Node { 4700 _typeNodeBrand: any; 4701 } 4702 interface KeywordTypeNode<TKind extends KeywordTypeSyntaxKind = KeywordTypeSyntaxKind> extends KeywordToken<TKind>, TypeNode { 4703 readonly kind: TKind; 4704 } 4705 /** @deprecated */ 4706 interface ImportTypeAssertionContainer extends Node { 4707 readonly kind: SyntaxKind.ImportTypeAssertionContainer; 4708 readonly parent: ImportTypeNode; 4709 /** @deprecated */ readonly assertClause: AssertClause; 4710 readonly multiLine?: boolean; 4711 } 4712 interface ImportTypeNode extends NodeWithTypeArguments { 4713 readonly kind: SyntaxKind.ImportType; 4714 readonly isTypeOf: boolean; 4715 readonly argument: TypeNode; 4716 /** @deprecated */ readonly assertions?: ImportTypeAssertionContainer; 4717 readonly attributes?: ImportAttributes; 4718 readonly qualifier?: EntityName; 4719 } 4720 interface ThisTypeNode extends TypeNode { 4721 readonly kind: SyntaxKind.ThisType; 4722 } 4723 type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode; 4724 interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase { 4725 readonly kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType; 4726 readonly type: TypeNode; 4727 } 4728 interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { 4729 readonly kind: SyntaxKind.FunctionType; 4730 } 4731 interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { 4732 readonly kind: SyntaxKind.ConstructorType; 4733 readonly modifiers?: NodeArray<Modifier>; 4734 } 4735 interface NodeWithTypeArguments extends TypeNode { 4736 readonly typeArguments?: NodeArray<TypeNode>; 4737 } 4738 type TypeReferenceType = TypeReferenceNode | ExpressionWithTypeArguments; 4739 interface TypeReferenceNode extends NodeWithTypeArguments { 4740 readonly kind: SyntaxKind.TypeReference; 4741 readonly typeName: EntityName; 4742 } 4743 interface TypePredicateNode extends TypeNode { 4744 readonly kind: SyntaxKind.TypePredicate; 4745 readonly parent: SignatureDeclaration | JSDocTypeExpression; 4746 readonly assertsModifier?: AssertsKeyword; 4747 readonly parameterName: Identifier | ThisTypeNode; 4748 readonly type?: TypeNode; 4749 } 4750 interface TypeQueryNode extends NodeWithTypeArguments { 4751 readonly kind: SyntaxKind.TypeQuery; 4752 readonly exprName: EntityName; 4753 } 4754 interface TypeLiteralNode extends TypeNode, Declaration { 4755 readonly kind: SyntaxKind.TypeLiteral; 4756 readonly members: NodeArray<TypeElement>; 4757 } 4758 interface ArrayTypeNode extends TypeNode { 4759 readonly kind: SyntaxKind.ArrayType; 4760 readonly elementType: TypeNode; 4761 } 4762 interface TupleTypeNode extends TypeNode { 4763 readonly kind: SyntaxKind.TupleType; 4764 readonly elements: NodeArray<TypeNode | NamedTupleMember>; 4765 } 4766 interface NamedTupleMember extends TypeNode, Declaration, JSDocContainer { 4767 readonly kind: SyntaxKind.NamedTupleMember; 4768 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>; 4769 readonly name: Identifier; 4770 readonly questionToken?: Token<SyntaxKind.QuestionToken>; 4771 readonly type: TypeNode; 4772 } 4773 interface OptionalTypeNode extends TypeNode { 4774 readonly kind: SyntaxKind.OptionalType; 4775 readonly type: TypeNode; 4776 } 4777 interface RestTypeNode extends TypeNode { 4778 readonly kind: SyntaxKind.RestType; 4779 readonly type: TypeNode; 4780 } 4781 type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode; 4782 interface UnionTypeNode extends TypeNode { 4783 readonly kind: SyntaxKind.UnionType; 4784 readonly types: NodeArray<TypeNode>; 4785 } 4786 interface IntersectionTypeNode extends TypeNode { 4787 readonly kind: SyntaxKind.IntersectionType; 4788 readonly types: NodeArray<TypeNode>; 4789 } 4790 interface ConditionalTypeNode extends TypeNode, LocalsContainer { 4791 readonly kind: SyntaxKind.ConditionalType; 4792 readonly checkType: TypeNode; 4793 readonly extendsType: TypeNode; 4794 readonly trueType: TypeNode; 4795 readonly falseType: TypeNode; 4796 } 4797 interface InferTypeNode extends TypeNode { 4798 readonly kind: SyntaxKind.InferType; 4799 readonly typeParameter: TypeParameterDeclaration; 4800 } 4801 interface ParenthesizedTypeNode extends TypeNode { 4802 readonly kind: SyntaxKind.ParenthesizedType; 4803 readonly type: TypeNode; 4804 } 4805 interface TypeOperatorNode extends TypeNode { 4806 readonly kind: SyntaxKind.TypeOperator; 4807 readonly operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword; 4808 readonly type: TypeNode; 4809 } 4810 interface IndexedAccessTypeNode extends TypeNode { 4811 readonly kind: SyntaxKind.IndexedAccessType; 4812 readonly objectType: TypeNode; 4813 readonly indexType: TypeNode; 4814 } 4815 interface MappedTypeNode extends TypeNode, Declaration, LocalsContainer { 4816 readonly kind: SyntaxKind.MappedType; 4817 readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken; 4818 readonly typeParameter: TypeParameterDeclaration; 4819 readonly nameType?: TypeNode; 4820 readonly questionToken?: QuestionToken | PlusToken | MinusToken; 4821 readonly type?: TypeNode; 4822 /** Used only to produce grammar errors */ 4823 readonly members?: NodeArray<TypeElement>; 4824 } 4825 interface LiteralTypeNode extends TypeNode { 4826 readonly kind: SyntaxKind.LiteralType; 4827 readonly literal: NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; 4828 } 4829 interface StringLiteral extends LiteralExpression, Declaration { 4830 readonly kind: SyntaxKind.StringLiteral; 4831 } 4832 type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; 4833 type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName | BigIntLiteral; 4834 interface TemplateLiteralTypeNode extends TypeNode { 4835 kind: SyntaxKind.TemplateLiteralType; 4836 readonly head: TemplateHead; 4837 readonly templateSpans: NodeArray<TemplateLiteralTypeSpan>; 4838 } 4839 interface TemplateLiteralTypeSpan extends TypeNode { 4840 readonly kind: SyntaxKind.TemplateLiteralTypeSpan; 4841 readonly parent: TemplateLiteralTypeNode; 4842 readonly type: TypeNode; 4843 readonly literal: TemplateMiddle | TemplateTail; 4844 } 4845 interface Expression extends Node { 4846 _expressionBrand: any; 4847 } 4848 interface OmittedExpression extends Expression { 4849 readonly kind: SyntaxKind.OmittedExpression; 4850 } 4851 interface PartiallyEmittedExpression extends LeftHandSideExpression { 4852 readonly kind: SyntaxKind.PartiallyEmittedExpression; 4853 readonly expression: Expression; 4854 } 4855 interface UnaryExpression extends Expression { 4856 _unaryExpressionBrand: any; 4857 } 4858 /** Deprecated, please use UpdateExpression */ 4859 type IncrementExpression = UpdateExpression; 4860 interface UpdateExpression extends UnaryExpression { 4861 _updateExpressionBrand: any; 4862 } 4863 type PrefixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.TildeToken | SyntaxKind.ExclamationToken; 4864 interface PrefixUnaryExpression extends UpdateExpression { 4865 readonly kind: SyntaxKind.PrefixUnaryExpression; 4866 readonly operator: PrefixUnaryOperator; 4867 readonly operand: UnaryExpression; 4868 } 4869 type PostfixUnaryOperator = SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken; 4870 interface PostfixUnaryExpression extends UpdateExpression { 4871 readonly kind: SyntaxKind.PostfixUnaryExpression; 4872 readonly operand: LeftHandSideExpression; 4873 readonly operator: PostfixUnaryOperator; 4874 } 4875 interface LeftHandSideExpression extends UpdateExpression { 4876 _leftHandSideExpressionBrand: any; 4877 } 4878 interface MemberExpression extends LeftHandSideExpression { 4879 _memberExpressionBrand: any; 4880 } 4881 interface PrimaryExpression extends MemberExpression { 4882 _primaryExpressionBrand: any; 4883 } 4884 interface NullLiteral extends PrimaryExpression { 4885 readonly kind: SyntaxKind.NullKeyword; 4886 } 4887 interface TrueLiteral extends PrimaryExpression { 4888 readonly kind: SyntaxKind.TrueKeyword; 4889 } 4890 interface FalseLiteral extends PrimaryExpression { 4891 readonly kind: SyntaxKind.FalseKeyword; 4892 } 4893 type BooleanLiteral = TrueLiteral | FalseLiteral; 4894 interface ThisExpression extends PrimaryExpression, FlowContainer { 4895 readonly kind: SyntaxKind.ThisKeyword; 4896 } 4897 interface SuperExpression extends PrimaryExpression, FlowContainer { 4898 readonly kind: SyntaxKind.SuperKeyword; 4899 } 4900 interface ImportExpression extends PrimaryExpression { 4901 readonly kind: SyntaxKind.ImportKeyword; 4902 } 4903 interface DeleteExpression extends UnaryExpression { 4904 readonly kind: SyntaxKind.DeleteExpression; 4905 readonly expression: UnaryExpression; 4906 } 4907 interface TypeOfExpression extends UnaryExpression { 4908 readonly kind: SyntaxKind.TypeOfExpression; 4909 readonly expression: UnaryExpression; 4910 } 4911 interface VoidExpression extends UnaryExpression { 4912 readonly kind: SyntaxKind.VoidExpression; 4913 readonly expression: UnaryExpression; 4914 } 4915 interface AwaitExpression extends UnaryExpression { 4916 readonly kind: SyntaxKind.AwaitExpression; 4917 readonly expression: UnaryExpression; 4918 } 4919 interface YieldExpression extends Expression { 4920 readonly kind: SyntaxKind.YieldExpression; 4921 readonly asteriskToken?: AsteriskToken; 4922 readonly expression?: Expression; 4923 } 4924 interface SyntheticExpression extends Expression { 4925 readonly kind: SyntaxKind.SyntheticExpression; 4926 readonly isSpread: boolean; 4927 readonly type: Type; 4928 readonly tupleNameSource?: ParameterDeclaration | NamedTupleMember; 4929 } 4930 type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken; 4931 type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken; 4932 type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator; 4933 type AdditiveOperator = SyntaxKind.PlusToken | SyntaxKind.MinusToken; 4934 type AdditiveOperatorOrHigher = MultiplicativeOperatorOrHigher | AdditiveOperator; 4935 type ShiftOperator = SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken; 4936 type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator; 4937 type RelationalOperator = SyntaxKind.LessThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.InstanceOfKeyword | SyntaxKind.InKeyword; 4938 type RelationalOperatorOrHigher = ShiftOperatorOrHigher | RelationalOperator; 4939 type EqualityOperator = SyntaxKind.EqualsEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.ExclamationEqualsToken; 4940 type EqualityOperatorOrHigher = RelationalOperatorOrHigher | EqualityOperator; 4941 type BitwiseOperator = SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken; 4942 type BitwiseOperatorOrHigher = EqualityOperatorOrHigher | BitwiseOperator; 4943 type LogicalOperator = SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken; 4944 type LogicalOperatorOrHigher = BitwiseOperatorOrHigher | LogicalOperator; 4945 type CompoundAssignmentOperator = SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.QuestionQuestionEqualsToken; 4946 type AssignmentOperator = SyntaxKind.EqualsToken | CompoundAssignmentOperator; 4947 type AssignmentOperatorOrHigher = SyntaxKind.QuestionQuestionToken | LogicalOperatorOrHigher | AssignmentOperator; 4948 type BinaryOperator = AssignmentOperatorOrHigher | SyntaxKind.CommaToken; 4949 type LogicalOrCoalescingAssignmentOperator = SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionEqualsToken; 4950 type BinaryOperatorToken = Token<BinaryOperator>; 4951 interface BinaryExpression extends Expression, Declaration, JSDocContainer { 4952 readonly kind: SyntaxKind.BinaryExpression; 4953 readonly left: Expression; 4954 readonly operatorToken: BinaryOperatorToken; 4955 readonly right: Expression; 4956 } 4957 type AssignmentOperatorToken = Token<AssignmentOperator>; 4958 interface AssignmentExpression<TOperator extends AssignmentOperatorToken> extends BinaryExpression { 4959 readonly left: LeftHandSideExpression; 4960 readonly operatorToken: TOperator; 4961 } 4962 interface ObjectDestructuringAssignment extends AssignmentExpression<EqualsToken> { 4963 readonly left: ObjectLiteralExpression; 4964 } 4965 interface ArrayDestructuringAssignment extends AssignmentExpression<EqualsToken> { 4966 readonly left: ArrayLiteralExpression; 4967 } 4968 type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment; 4969 type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | ObjectBindingOrAssignmentElement | ArrayBindingOrAssignmentElement; 4970 type ObjectBindingOrAssignmentElement = BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment; 4971 type ArrayBindingOrAssignmentElement = BindingElement | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression<EqualsToken> | Identifier | PropertyAccessExpression | ElementAccessExpression; 4972 type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment; 4973 type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; 4974 type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression; 4975 type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression; 4976 type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression; 4977 type BindingOrAssignmentPattern = ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern; 4978 interface ConditionalExpression extends Expression { 4979 readonly kind: SyntaxKind.ConditionalExpression; 4980 readonly condition: Expression; 4981 readonly questionToken: QuestionToken; 4982 readonly whenTrue: Expression; 4983 readonly colonToken: ColonToken; 4984 readonly whenFalse: Expression; 4985 } 4986 type FunctionBody = Block; 4987 type ConciseBody = FunctionBody | Expression; 4988 interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclarationBase, JSDocContainer, LocalsContainer, FlowContainer { 4989 readonly kind: SyntaxKind.FunctionExpression; 4990 readonly modifiers?: NodeArray<Modifier>; 4991 readonly name?: Identifier; 4992 readonly body: FunctionBody; 4993 } 4994 interface ArrowFunction extends Expression, FunctionLikeDeclarationBase, JSDocContainer, LocalsContainer, FlowContainer { 4995 readonly kind: SyntaxKind.ArrowFunction; 4996 readonly modifiers?: NodeArray<Modifier>; 4997 readonly equalsGreaterThanToken: EqualsGreaterThanToken; 4998 readonly body: ConciseBody; 4999 readonly name: never; 5000 } 5001 interface LiteralLikeNode extends Node { 5002 text: string; 5003 isUnterminated?: boolean; 5004 hasExtendedUnicodeEscape?: boolean; 5005 } 5006 interface TemplateLiteralLikeNode extends LiteralLikeNode { 5007 rawText?: string; 5008 } 5009 interface LiteralExpression extends LiteralLikeNode, PrimaryExpression { 5010 _literalExpressionBrand: any; 5011 } 5012 interface RegularExpressionLiteral extends LiteralExpression { 5013 readonly kind: SyntaxKind.RegularExpressionLiteral; 5014 } 5015 interface NoSubstitutionTemplateLiteral extends LiteralExpression, TemplateLiteralLikeNode, Declaration { 5016 readonly kind: SyntaxKind.NoSubstitutionTemplateLiteral; 5017 } 5018 enum TokenFlags { 5019 None = 0, 5020 Scientific = 16, 5021 Octal = 32, 5022 HexSpecifier = 64, 5023 BinarySpecifier = 128, 5024 OctalSpecifier = 256, 5025 } 5026 interface NumericLiteral extends LiteralExpression, Declaration { 5027 readonly kind: SyntaxKind.NumericLiteral; 5028 } 5029 interface BigIntLiteral extends LiteralExpression { 5030 readonly kind: SyntaxKind.BigIntLiteral; 5031 } 5032 type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral; 5033 interface TemplateHead extends TemplateLiteralLikeNode { 5034 readonly kind: SyntaxKind.TemplateHead; 5035 readonly parent: TemplateExpression | TemplateLiteralTypeNode; 5036 } 5037 interface TemplateMiddle extends TemplateLiteralLikeNode { 5038 readonly kind: SyntaxKind.TemplateMiddle; 5039 readonly parent: TemplateSpan | TemplateLiteralTypeSpan; 5040 } 5041 interface TemplateTail extends TemplateLiteralLikeNode { 5042 readonly kind: SyntaxKind.TemplateTail; 5043 readonly parent: TemplateSpan | TemplateLiteralTypeSpan; 5044 } 5045 type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail; 5046 type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken; 5047 interface TemplateExpression extends PrimaryExpression { 5048 readonly kind: SyntaxKind.TemplateExpression; 5049 readonly head: TemplateHead; 5050 readonly templateSpans: NodeArray<TemplateSpan>; 5051 } 5052 type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; 5053 interface TemplateSpan extends Node { 5054 readonly kind: SyntaxKind.TemplateSpan; 5055 readonly parent: TemplateExpression; 5056 readonly expression: Expression; 5057 readonly literal: TemplateMiddle | TemplateTail; 5058 } 5059 interface ParenthesizedExpression extends PrimaryExpression, JSDocContainer { 5060 readonly kind: SyntaxKind.ParenthesizedExpression; 5061 readonly expression: Expression; 5062 } 5063 interface ArrayLiteralExpression extends PrimaryExpression { 5064 readonly kind: SyntaxKind.ArrayLiteralExpression; 5065 readonly elements: NodeArray<Expression>; 5066 } 5067 interface SpreadElement extends Expression { 5068 readonly kind: SyntaxKind.SpreadElement; 5069 readonly parent: ArrayLiteralExpression | CallExpression | NewExpression; 5070 readonly expression: Expression; 5071 } 5072 /** 5073 * This interface is a base interface for ObjectLiteralExpression and JSXAttributes to extend from. JSXAttributes is similar to 5074 * ObjectLiteralExpression in that it contains array of properties; however, JSXAttributes' properties can only be 5075 * JSXAttribute or JSXSpreadAttribute. ObjectLiteralExpression, on the other hand, can only have properties of type 5076 * ObjectLiteralElement (e.g. PropertyAssignment, ShorthandPropertyAssignment etc.) 5077 */ 5078 interface ObjectLiteralExpressionBase<T extends ObjectLiteralElement> extends PrimaryExpression, Declaration { 5079 readonly properties: NodeArray<T>; 5080 } 5081 interface ObjectLiteralExpression extends ObjectLiteralExpressionBase<ObjectLiteralElementLike>, JSDocContainer { 5082 readonly kind: SyntaxKind.ObjectLiteralExpression; 5083 } 5084 type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; 5085 type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; 5086 type AccessExpression = PropertyAccessExpression | ElementAccessExpression; 5087 interface PropertyAccessExpression extends MemberExpression, NamedDeclaration, JSDocContainer, FlowContainer { 5088 readonly kind: SyntaxKind.PropertyAccessExpression; 5089 readonly expression: LeftHandSideExpression; 5090 readonly questionDotToken?: QuestionDotToken; 5091 readonly name: MemberName; 5092 } 5093 interface PropertyAccessChain extends PropertyAccessExpression { 5094 _optionalChainBrand: any; 5095 readonly name: MemberName; 5096 } 5097 interface SuperPropertyAccessExpression extends PropertyAccessExpression { 5098 readonly expression: SuperExpression; 5099 } 5100 /** Brand for a PropertyAccessExpression which, like a QualifiedName, consists of a sequence of identifiers separated by dots. */ 5101 interface PropertyAccessEntityNameExpression extends PropertyAccessExpression { 5102 _propertyAccessExpressionLikeQualifiedNameBrand?: any; 5103 readonly expression: EntityNameExpression; 5104 readonly name: Identifier; 5105 } 5106 interface ElementAccessExpression extends MemberExpression, Declaration, JSDocContainer, FlowContainer { 5107 readonly kind: SyntaxKind.ElementAccessExpression; 5108 readonly expression: LeftHandSideExpression; 5109 readonly questionDotToken?: QuestionDotToken; 5110 readonly argumentExpression: Expression; 5111 } 5112 interface ElementAccessChain extends ElementAccessExpression { 5113 _optionalChainBrand: any; 5114 } 5115 interface SuperElementAccessExpression extends ElementAccessExpression { 5116 readonly expression: SuperExpression; 5117 } 5118 type SuperProperty = SuperPropertyAccessExpression | SuperElementAccessExpression; 5119 interface CallExpression extends LeftHandSideExpression, Declaration { 5120 readonly kind: SyntaxKind.CallExpression; 5121 readonly expression: LeftHandSideExpression; 5122 readonly questionDotToken?: QuestionDotToken; 5123 readonly typeArguments?: NodeArray<TypeNode>; 5124 readonly arguments: NodeArray<Expression>; 5125 } 5126 interface CallChain extends CallExpression { 5127 _optionalChainBrand: any; 5128 } 5129 type OptionalChain = PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; 5130 interface SuperCall extends CallExpression { 5131 readonly expression: SuperExpression; 5132 } 5133 interface ImportCall extends CallExpression { 5134 readonly expression: ImportExpression | ImportDeferProperty; 5135 } 5136 interface ExpressionWithTypeArguments extends MemberExpression, NodeWithTypeArguments { 5137 readonly kind: SyntaxKind.ExpressionWithTypeArguments; 5138 readonly expression: LeftHandSideExpression; 5139 } 5140 interface NewExpression extends PrimaryExpression, Declaration { 5141 readonly kind: SyntaxKind.NewExpression; 5142 readonly expression: LeftHandSideExpression; 5143 readonly typeArguments?: NodeArray<TypeNode>; 5144 readonly arguments?: NodeArray<Expression>; 5145 } 5146 interface TaggedTemplateExpression extends MemberExpression { 5147 readonly kind: SyntaxKind.TaggedTemplateExpression; 5148 readonly tag: LeftHandSideExpression; 5149 readonly typeArguments?: NodeArray<TypeNode>; 5150 readonly template: TemplateLiteral; 5151 } 5152 interface InstanceofExpression extends BinaryExpression { 5153 readonly operatorToken: Token<SyntaxKind.InstanceOfKeyword>; 5154 } 5155 type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxCallLike | InstanceofExpression; 5156 interface AsExpression extends Expression { 5157 readonly kind: SyntaxKind.AsExpression; 5158 readonly expression: Expression; 5159 readonly type: TypeNode; 5160 } 5161 interface TypeAssertion extends UnaryExpression { 5162 readonly kind: SyntaxKind.TypeAssertionExpression; 5163 readonly type: TypeNode; 5164 readonly expression: UnaryExpression; 5165 } 5166 interface SatisfiesExpression extends Expression { 5167 readonly kind: SyntaxKind.SatisfiesExpression; 5168 readonly expression: Expression; 5169 readonly type: TypeNode; 5170 } 5171 type AssertionExpression = TypeAssertion | AsExpression; 5172 interface NonNullExpression extends LeftHandSideExpression { 5173 readonly kind: SyntaxKind.NonNullExpression; 5174 readonly expression: Expression; 5175 } 5176 interface NonNullChain extends NonNullExpression { 5177 _optionalChainBrand: any; 5178 } 5179 interface MetaProperty extends PrimaryExpression, FlowContainer { 5180 readonly kind: SyntaxKind.MetaProperty; 5181 readonly keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword; 5182 readonly name: Identifier; 5183 } 5184 interface ImportDeferProperty extends MetaProperty { 5185 readonly keywordToken: SyntaxKind.ImportKeyword; 5186 readonly name: Identifier & { 5187 readonly escapedText: __String & "defer"; 5188 }; 5189 } 5190 interface JsxElement extends PrimaryExpression { 5191 readonly kind: SyntaxKind.JsxElement; 5192 readonly openingElement: JsxOpeningElement; 5193 readonly children: NodeArray<JsxChild>; 5194 readonly closingElement: JsxClosingElement; 5195 } 5196 type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement; 5197 type JsxCallLike = JsxOpeningLikeElement | JsxOpeningFragment; 5198 type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; 5199 type JsxAttributeName = Identifier | JsxNamespacedName; 5200 type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName; 5201 interface JsxTagNamePropertyAccess extends PropertyAccessExpression { 5202 readonly expression: Identifier | ThisExpression | JsxTagNamePropertyAccess; 5203 } 5204 interface JsxAttributes extends PrimaryExpression, Declaration { 5205 readonly properties: NodeArray<JsxAttributeLike>; 5206 readonly kind: SyntaxKind.JsxAttributes; 5207 readonly parent: JsxOpeningLikeElement; 5208 } 5209 interface JsxNamespacedName extends Node { 5210 readonly kind: SyntaxKind.JsxNamespacedName; 5211 readonly name: Identifier; 5212 readonly namespace: Identifier; 5213 } 5214 interface JsxOpeningElement extends Expression { 5215 readonly kind: SyntaxKind.JsxOpeningElement; 5216 readonly parent: JsxElement; 5217 readonly tagName: JsxTagNameExpression; 5218 readonly typeArguments?: NodeArray<TypeNode>; 5219 readonly attributes: JsxAttributes; 5220 } 5221 interface JsxSelfClosingElement extends PrimaryExpression { 5222 readonly kind: SyntaxKind.JsxSelfClosingElement; 5223 readonly tagName: JsxTagNameExpression; 5224 readonly typeArguments?: NodeArray<TypeNode>; 5225 readonly attributes: JsxAttributes; 5226 } 5227 interface JsxFragment extends PrimaryExpression { 5228 readonly kind: SyntaxKind.JsxFragment; 5229 readonly openingFragment: JsxOpeningFragment; 5230 readonly children: NodeArray<JsxChild>; 5231 readonly closingFragment: JsxClosingFragment; 5232 } 5233 interface JsxOpeningFragment extends Expression { 5234 readonly kind: SyntaxKind.JsxOpeningFragment; 5235 readonly parent: JsxFragment; 5236 } 5237 interface JsxClosingFragment extends Expression { 5238 readonly kind: SyntaxKind.JsxClosingFragment; 5239 readonly parent: JsxFragment; 5240 } 5241 interface JsxAttribute extends Declaration { 5242 readonly kind: SyntaxKind.JsxAttribute; 5243 readonly parent: JsxAttributes; 5244 readonly name: JsxAttributeName; 5245 readonly initializer?: JsxAttributeValue; 5246 } 5247 type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; 5248 interface JsxSpreadAttribute extends ObjectLiteralElement { 5249 readonly kind: SyntaxKind.JsxSpreadAttribute; 5250 readonly parent: JsxAttributes; 5251 readonly expression: Expression; 5252 } 5253 interface JsxClosingElement extends Node { 5254 readonly kind: SyntaxKind.JsxClosingElement; 5255 readonly parent: JsxElement; 5256 readonly tagName: JsxTagNameExpression; 5257 } 5258 interface JsxExpression extends Expression { 5259 readonly kind: SyntaxKind.JsxExpression; 5260 readonly parent: JsxElement | JsxFragment | JsxAttributeLike; 5261 readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>; 5262 readonly expression?: Expression; 5263 } 5264 interface JsxText extends LiteralLikeNode { 5265 readonly kind: SyntaxKind.JsxText; 5266 readonly parent: JsxElement | JsxFragment; 5267 readonly containsOnlyTriviaWhiteSpaces: boolean; 5268 } 5269 type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; 5270 interface Statement extends Node, JSDocContainer { 5271 _statementBrand: any; 5272 } 5273 interface NotEmittedStatement extends Statement { 5274 readonly kind: SyntaxKind.NotEmittedStatement; 5275 } 5276 interface NotEmittedTypeElement extends TypeElement { 5277 readonly kind: SyntaxKind.NotEmittedTypeElement; 5278 } 5279 /** 5280 * A list of comma-separated expressions. This node is only created by transformations. 5281 */ 5282 interface CommaListExpression extends Expression { 5283 readonly kind: SyntaxKind.CommaListExpression; 5284 readonly elements: NodeArray<Expression>; 5285 } 5286 interface EmptyStatement extends Statement { 5287 readonly kind: SyntaxKind.EmptyStatement; 5288 } 5289 interface DebuggerStatement extends Statement, FlowContainer { 5290 readonly kind: SyntaxKind.DebuggerStatement; 5291 } 5292 interface MissingDeclaration extends DeclarationStatement, PrimaryExpression { 5293 readonly kind: SyntaxKind.MissingDeclaration; 5294 readonly name?: Identifier; 5295 } 5296 type BlockLike = SourceFile | Block | ModuleBlock | CaseOrDefaultClause; 5297 interface Block extends Statement, LocalsContainer { 5298 readonly kind: SyntaxKind.Block; 5299 readonly statements: NodeArray<Statement>; 5300 } 5301 interface VariableStatement extends Statement, FlowContainer { 5302 readonly kind: SyntaxKind.VariableStatement; 5303 readonly modifiers?: NodeArray<ModifierLike>; 5304 readonly declarationList: VariableDeclarationList; 5305 } 5306 interface ExpressionStatement extends Statement, FlowContainer { 5307 readonly kind: SyntaxKind.ExpressionStatement; 5308 readonly expression: Expression; 5309 } 5310 interface IfStatement extends Statement, FlowContainer { 5311 readonly kind: SyntaxKind.IfStatement; 5312 readonly expression: Expression; 5313 readonly thenStatement: Statement; 5314 readonly elseStatement?: Statement; 5315 } 5316 interface IterationStatement extends Statement { 5317 readonly statement: Statement; 5318 } 5319 interface DoStatement extends IterationStatement, FlowContainer { 5320 readonly kind: SyntaxKind.DoStatement; 5321 readonly expression: Expression; 5322 } 5323 interface WhileStatement extends IterationStatement, FlowContainer { 5324 readonly kind: SyntaxKind.WhileStatement; 5325 readonly expression: Expression; 5326 } 5327 type ForInitializer = VariableDeclarationList | Expression; 5328 interface ForStatement extends IterationStatement, LocalsContainer, FlowContainer { 5329 readonly kind: SyntaxKind.ForStatement; 5330 readonly initializer?: ForInitializer; 5331 readonly condition?: Expression; 5332 readonly incrementor?: Expression; 5333 } 5334 type ForInOrOfStatement = ForInStatement | ForOfStatement; 5335 interface ForInStatement extends IterationStatement, LocalsContainer, FlowContainer { 5336 readonly kind: SyntaxKind.ForInStatement; 5337 readonly initializer: ForInitializer; 5338 readonly expression: Expression; 5339 } 5340 interface ForOfStatement extends IterationStatement, LocalsContainer, FlowContainer { 5341 readonly kind: SyntaxKind.ForOfStatement; 5342 readonly awaitModifier?: AwaitKeyword; 5343 readonly initializer: ForInitializer; 5344 readonly expression: Expression; 5345 } 5346 interface BreakStatement extends Statement, FlowContainer { 5347 readonly kind: SyntaxKind.BreakStatement; 5348 readonly label?: Identifier; 5349 } 5350 interface ContinueStatement extends Statement, FlowContainer { 5351 readonly kind: SyntaxKind.ContinueStatement; 5352 readonly label?: Identifier; 5353 } 5354 type BreakOrContinueStatement = BreakStatement | ContinueStatement; 5355 interface ReturnStatement extends Statement, FlowContainer { 5356 readonly kind: SyntaxKind.ReturnStatement; 5357 readonly expression?: Expression; 5358 } 5359 interface WithStatement extends Statement, FlowContainer { 5360 readonly kind: SyntaxKind.WithStatement; 5361 readonly expression: Expression; 5362 readonly statement: Statement; 5363 } 5364 interface SwitchStatement extends Statement, FlowContainer { 5365 readonly kind: SyntaxKind.SwitchStatement; 5366 readonly expression: Expression; 5367 readonly caseBlock: CaseBlock; 5368 possiblyExhaustive?: boolean; 5369 } 5370 interface CaseBlock extends Node, LocalsContainer { 5371 readonly kind: SyntaxKind.CaseBlock; 5372 readonly parent: SwitchStatement; 5373 readonly clauses: NodeArray<CaseOrDefaultClause>; 5374 } 5375 interface CaseClause extends Node, JSDocContainer { 5376 readonly kind: SyntaxKind.CaseClause; 5377 readonly parent: CaseBlock; 5378 readonly expression: Expression; 5379 readonly statements: NodeArray<Statement>; 5380 } 5381 interface DefaultClause extends Node { 5382 readonly kind: SyntaxKind.DefaultClause; 5383 readonly parent: CaseBlock; 5384 readonly statements: NodeArray<Statement>; 5385 } 5386 type CaseOrDefaultClause = CaseClause | DefaultClause; 5387 interface LabeledStatement extends Statement, FlowContainer { 5388 readonly kind: SyntaxKind.LabeledStatement; 5389 readonly label: Identifier; 5390 readonly statement: Statement; 5391 } 5392 interface ThrowStatement extends Statement, FlowContainer { 5393 readonly kind: SyntaxKind.ThrowStatement; 5394 readonly expression: Expression; 5395 } 5396 interface TryStatement extends Statement, FlowContainer { 5397 readonly kind: SyntaxKind.TryStatement; 5398 readonly tryBlock: Block; 5399 readonly catchClause?: CatchClause; 5400 readonly finallyBlock?: Block; 5401 } 5402 interface CatchClause extends Node, LocalsContainer { 5403 readonly kind: SyntaxKind.CatchClause; 5404 readonly parent: TryStatement; 5405 readonly variableDeclaration?: VariableDeclaration; 5406 readonly block: Block; 5407 } 5408 type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; 5409 type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature; 5410 type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; 5411 interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer { 5412 readonly kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression; 5413 readonly name?: Identifier; 5414 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 5415 readonly heritageClauses?: NodeArray<HeritageClause>; 5416 readonly members: NodeArray<ClassElement>; 5417 } 5418 interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { 5419 readonly kind: SyntaxKind.ClassDeclaration; 5420 readonly modifiers?: NodeArray<ModifierLike>; 5421 /** May be undefined in `export default class { ... }`. */ 5422 readonly name?: Identifier; 5423 } 5424 interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { 5425 readonly kind: SyntaxKind.ClassExpression; 5426 readonly modifiers?: NodeArray<ModifierLike>; 5427 } 5428 type ClassLikeDeclaration = ClassDeclaration | ClassExpression; 5429 interface ClassElement extends NamedDeclaration { 5430 _classElementBrand: any; 5431 readonly name?: PropertyName; 5432 } 5433 interface TypeElement extends NamedDeclaration { 5434 _typeElementBrand: any; 5435 readonly name?: PropertyName; 5436 readonly questionToken?: QuestionToken | undefined; 5437 } 5438 interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer { 5439 readonly kind: SyntaxKind.InterfaceDeclaration; 5440 readonly modifiers?: NodeArray<ModifierLike>; 5441 readonly name: Identifier; 5442 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 5443 readonly heritageClauses?: NodeArray<HeritageClause>; 5444 readonly members: NodeArray<TypeElement>; 5445 } 5446 interface HeritageClause extends Node { 5447 readonly kind: SyntaxKind.HeritageClause; 5448 readonly parent: InterfaceDeclaration | ClassLikeDeclaration; 5449 readonly token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; 5450 readonly types: NodeArray<ExpressionWithTypeArguments>; 5451 } 5452 interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { 5453 readonly kind: SyntaxKind.TypeAliasDeclaration; 5454 readonly modifiers?: NodeArray<ModifierLike>; 5455 readonly name: Identifier; 5456 readonly typeParameters?: NodeArray<TypeParameterDeclaration>; 5457 readonly type: TypeNode; 5458 } 5459 interface EnumMember extends NamedDeclaration, JSDocContainer { 5460 readonly kind: SyntaxKind.EnumMember; 5461 readonly parent: EnumDeclaration; 5462 readonly name: PropertyName; 5463 readonly initializer?: Expression; 5464 } 5465 interface EnumDeclaration extends DeclarationStatement, JSDocContainer { 5466 readonly kind: SyntaxKind.EnumDeclaration; 5467 readonly modifiers?: NodeArray<ModifierLike>; 5468 readonly name: Identifier; 5469 readonly members: NodeArray<EnumMember>; 5470 } 5471 type ModuleName = Identifier | StringLiteral; 5472 type ModuleBody = NamespaceBody | JSDocNamespaceBody; 5473 interface ModuleDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer { 5474 readonly kind: SyntaxKind.ModuleDeclaration; 5475 readonly parent: ModuleBody | SourceFile; 5476 readonly modifiers?: NodeArray<ModifierLike>; 5477 readonly name: ModuleName; 5478 readonly body?: ModuleBody | JSDocNamespaceDeclaration; 5479 } 5480 type NamespaceBody = ModuleBlock | NamespaceDeclaration; 5481 interface NamespaceDeclaration extends ModuleDeclaration { 5482 readonly name: Identifier; 5483 readonly body: NamespaceBody; 5484 } 5485 type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; 5486 interface JSDocNamespaceDeclaration extends ModuleDeclaration { 5487 readonly name: Identifier; 5488 readonly body?: JSDocNamespaceBody; 5489 } 5490 interface ModuleBlock extends Node, Statement { 5491 readonly kind: SyntaxKind.ModuleBlock; 5492 readonly parent: ModuleDeclaration; 5493 readonly statements: NodeArray<Statement>; 5494 } 5495 type ModuleReference = EntityName | ExternalModuleReference; 5496 /** 5497 * One of: 5498 * - import x = require("mod"); 5499 * - import x = M.x; 5500 */ 5501 interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer { 5502 readonly kind: SyntaxKind.ImportEqualsDeclaration; 5503 readonly parent: SourceFile | ModuleBlock; 5504 readonly modifiers?: NodeArray<ModifierLike>; 5505 readonly name: Identifier; 5506 readonly isTypeOnly: boolean; 5507 readonly moduleReference: ModuleReference; 5508 } 5509 interface ExternalModuleReference extends Node { 5510 readonly kind: SyntaxKind.ExternalModuleReference; 5511 readonly parent: ImportEqualsDeclaration; 5512 readonly expression: Expression; 5513 } 5514 interface ImportDeclaration extends Statement { 5515 readonly kind: SyntaxKind.ImportDeclaration; 5516 readonly parent: SourceFile | ModuleBlock; 5517 readonly modifiers?: NodeArray<ModifierLike>; 5518 readonly importClause?: ImportClause; 5519 /** If this is not a StringLiteral it will be a grammar error. */ 5520 readonly moduleSpecifier: Expression; 5521 /** @deprecated */ readonly assertClause?: AssertClause; 5522 readonly attributes?: ImportAttributes; 5523 } 5524 type NamedImportBindings = NamespaceImport | NamedImports; 5525 type NamedExportBindings = NamespaceExport | NamedExports; 5526 interface ImportClause extends NamedDeclaration { 5527 readonly kind: SyntaxKind.ImportClause; 5528 readonly parent: ImportDeclaration | JSDocImportTag; 5529 /** @deprecated Use `phaseModifier` instead */ 5530 readonly isTypeOnly: boolean; 5531 readonly phaseModifier: undefined | ImportPhaseModifierSyntaxKind; 5532 readonly name?: Identifier; 5533 readonly namedBindings?: NamedImportBindings; 5534 } 5535 type ImportPhaseModifierSyntaxKind = SyntaxKind.TypeKeyword | SyntaxKind.DeferKeyword; 5536 /** @deprecated */ 5537 type AssertionKey = ImportAttributeName; 5538 /** @deprecated */ 5539 interface AssertEntry extends ImportAttribute { 5540 } 5541 /** @deprecated */ 5542 interface AssertClause extends ImportAttributes { 5543 } 5544 type ImportAttributeName = Identifier | StringLiteral; 5545 interface ImportAttribute extends Node { 5546 readonly kind: SyntaxKind.ImportAttribute; 5547 readonly parent: ImportAttributes; 5548 readonly name: ImportAttributeName; 5549 readonly value: Expression; 5550 } 5551 interface ImportAttributes extends Node { 5552 readonly token: SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword; 5553 readonly kind: SyntaxKind.ImportAttributes; 5554 readonly parent: ImportDeclaration | ExportDeclaration; 5555 readonly elements: NodeArray<ImportAttribute>; 5556 readonly multiLine?: boolean; 5557 } 5558 interface NamespaceImport extends NamedDeclaration { 5559 readonly kind: SyntaxKind.NamespaceImport; 5560 readonly parent: ImportClause; 5561 readonly name: Identifier; 5562 } 5563 interface NamespaceExport extends NamedDeclaration { 5564 readonly kind: SyntaxKind.NamespaceExport; 5565 readonly parent: ExportDeclaration; 5566 readonly name: ModuleExportName; 5567 } 5568 interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer { 5569 readonly kind: SyntaxKind.NamespaceExportDeclaration; 5570 readonly name: Identifier; 5571 } 5572 interface ExportDeclaration extends DeclarationStatement, JSDocContainer { 5573 readonly kind: SyntaxKind.ExportDeclaration; 5574 readonly parent: SourceFile | ModuleBlock; 5575 readonly modifiers?: NodeArray<ModifierLike>; 5576 readonly isTypeOnly: boolean; 5577 /** Will not be assigned in the case of `export * from "foo";` */ 5578 readonly exportClause?: NamedExportBindings; 5579 /** If this is not a StringLiteral it will be a grammar error. */ 5580 readonly moduleSpecifier?: Expression; 5581 /** @deprecated */ readonly assertClause?: AssertClause; 5582 readonly attributes?: ImportAttributes; 5583 } 5584 interface NamedImports extends Node { 5585 readonly kind: SyntaxKind.NamedImports; 5586 readonly parent: ImportClause; 5587 readonly elements: NodeArray<ImportSpecifier>; 5588 } 5589 interface NamedExports extends Node { 5590 readonly kind: SyntaxKind.NamedExports; 5591 readonly parent: ExportDeclaration; 5592 readonly elements: NodeArray<ExportSpecifier>; 5593 } 5594 type NamedImportsOrExports = NamedImports | NamedExports; 5595 interface ImportSpecifier extends NamedDeclaration { 5596 readonly kind: SyntaxKind.ImportSpecifier; 5597 readonly parent: NamedImports; 5598 readonly propertyName?: ModuleExportName; 5599 readonly name: Identifier; 5600 readonly isTypeOnly: boolean; 5601 } 5602 interface ExportSpecifier extends NamedDeclaration, JSDocContainer { 5603 readonly kind: SyntaxKind.ExportSpecifier; 5604 readonly parent: NamedExports; 5605 readonly isTypeOnly: boolean; 5606 readonly propertyName?: ModuleExportName; 5607 readonly name: ModuleExportName; 5608 } 5609 type ModuleExportName = Identifier | StringLiteral; 5610 type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; 5611 type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier | ExportDeclaration | NamespaceExport; 5612 type TypeOnlyImportDeclaration = 5613 | ImportClause & { 5614 readonly isTypeOnly: true; 5615 readonly name: Identifier; 5616 } 5617 | ImportEqualsDeclaration & { 5618 readonly isTypeOnly: true; 5619 } 5620 | NamespaceImport & { 5621 readonly parent: ImportClause & { 5622 readonly isTypeOnly: true; 5623 }; 5624 } 5625 | ImportSpecifier 5626 & ({ 5627 readonly isTypeOnly: true; 5628 } | { 5629 readonly parent: NamedImports & { 5630 readonly parent: ImportClause & { 5631 readonly isTypeOnly: true; 5632 }; 5633 }; 5634 }); 5635 type TypeOnlyExportDeclaration = 5636 | ExportSpecifier 5637 & ({ 5638 readonly isTypeOnly: true; 5639 } | { 5640 readonly parent: NamedExports & { 5641 readonly parent: ExportDeclaration & { 5642 readonly isTypeOnly: true; 5643 }; 5644 }; 5645 }) 5646 | ExportDeclaration & { 5647 readonly isTypeOnly: true; 5648 readonly moduleSpecifier: Expression; 5649 } 5650 | NamespaceExport & { 5651 readonly parent: ExportDeclaration & { 5652 readonly isTypeOnly: true; 5653 readonly moduleSpecifier: Expression; 5654 }; 5655 }; 5656 type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration; 5657 /** 5658 * This is either an `export =` or an `export default` declaration. 5659 * Unless `isExportEquals` is set, this node was parsed as an `export default`. 5660 */ 5661 interface ExportAssignment extends DeclarationStatement, JSDocContainer { 5662 readonly kind: SyntaxKind.ExportAssignment; 5663 readonly parent: SourceFile; 5664 readonly modifiers?: NodeArray<ModifierLike>; 5665 readonly isExportEquals?: boolean; 5666 readonly expression: Expression; 5667 } 5668 interface FileReference extends TextRange { 5669 fileName: string; 5670 resolutionMode?: ResolutionMode; 5671 preserve?: boolean; 5672 } 5673 interface CheckJsDirective extends TextRange { 5674 enabled: boolean; 5675 } 5676 type CommentKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; 5677 interface CommentRange extends TextRange { 5678 hasTrailingNewLine?: boolean; 5679 kind: CommentKind; 5680 } 5681 interface SynthesizedComment extends CommentRange { 5682 text: string; 5683 pos: -1; 5684 end: -1; 5685 hasLeadingNewline?: boolean; 5686 } 5687 interface JSDocTypeExpression extends TypeNode { 5688 readonly kind: SyntaxKind.JSDocTypeExpression; 5689 readonly type: TypeNode; 5690 } 5691 interface JSDocNameReference extends Node { 5692 readonly kind: SyntaxKind.JSDocNameReference; 5693 readonly name: EntityName | JSDocMemberName; 5694 } 5695 /** Class#method reference in JSDoc */ 5696 interface JSDocMemberName extends Node { 5697 readonly kind: SyntaxKind.JSDocMemberName; 5698 readonly left: EntityName | JSDocMemberName; 5699 readonly right: Identifier; 5700 } 5701 interface JSDocType extends TypeNode { 5702 _jsDocTypeBrand: any; 5703 } 5704 interface JSDocAllType extends JSDocType { 5705 readonly kind: SyntaxKind.JSDocAllType; 5706 } 5707 interface JSDocUnknownType extends JSDocType { 5708 readonly kind: SyntaxKind.JSDocUnknownType; 5709 } 5710 interface JSDocNonNullableType extends JSDocType { 5711 readonly kind: SyntaxKind.JSDocNonNullableType; 5712 readonly type: TypeNode; 5713 readonly postfix: boolean; 5714 } 5715 interface JSDocNullableType extends JSDocType { 5716 readonly kind: SyntaxKind.JSDocNullableType; 5717 readonly type: TypeNode; 5718 readonly postfix: boolean; 5719 } 5720 interface JSDocOptionalType extends JSDocType { 5721 readonly kind: SyntaxKind.JSDocOptionalType; 5722 readonly type: TypeNode; 5723 } 5724 interface JSDocFunctionType extends JSDocType, SignatureDeclarationBase, LocalsContainer { 5725 readonly kind: SyntaxKind.JSDocFunctionType; 5726 } 5727 interface JSDocVariadicType extends JSDocType { 5728 readonly kind: SyntaxKind.JSDocVariadicType; 5729 readonly type: TypeNode; 5730 } 5731 interface JSDocNamepathType extends JSDocType { 5732 readonly kind: SyntaxKind.JSDocNamepathType; 5733 readonly type: TypeNode; 5734 } 5735 type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType; 5736 interface JSDoc extends Node { 5737 readonly kind: SyntaxKind.JSDoc; 5738 readonly parent: HasJSDoc; 5739 readonly tags?: NodeArray<JSDocTag>; 5740 readonly comment?: string | NodeArray<JSDocComment>; 5741 } 5742 interface JSDocTag extends Node { 5743 readonly parent: JSDoc | JSDocTypeLiteral; 5744 readonly tagName: Identifier; 5745 readonly comment?: string | NodeArray<JSDocComment>; 5746 } 5747 interface JSDocLink extends Node { 5748 readonly kind: SyntaxKind.JSDocLink; 5749 readonly name?: EntityName | JSDocMemberName; 5750 text: string; 5751 } 5752 interface JSDocLinkCode extends Node { 5753 readonly kind: SyntaxKind.JSDocLinkCode; 5754 readonly name?: EntityName | JSDocMemberName; 5755 text: string; 5756 } 5757 interface JSDocLinkPlain extends Node { 5758 readonly kind: SyntaxKind.JSDocLinkPlain; 5759 readonly name?: EntityName | JSDocMemberName; 5760 text: string; 5761 } 5762 type JSDocComment = JSDocText | JSDocLink | JSDocLinkCode | JSDocLinkPlain; 5763 interface JSDocText extends Node { 5764 readonly kind: SyntaxKind.JSDocText; 5765 text: string; 5766 } 5767 interface JSDocUnknownTag extends JSDocTag { 5768 readonly kind: SyntaxKind.JSDocTag; 5769 } 5770 /** 5771 * Note that `@extends` is a synonym of `@augments`. 5772 * Both tags are represented by this interface. 5773 */ 5774 interface JSDocAugmentsTag extends JSDocTag { 5775 readonly kind: SyntaxKind.JSDocAugmentsTag; 5776 readonly class: ExpressionWithTypeArguments & { 5777 readonly expression: Identifier | PropertyAccessEntityNameExpression; 5778 }; 5779 } 5780 interface JSDocImplementsTag extends JSDocTag { 5781 readonly kind: SyntaxKind.JSDocImplementsTag; 5782 readonly class: ExpressionWithTypeArguments & { 5783 readonly expression: Identifier | PropertyAccessEntityNameExpression; 5784 }; 5785 } 5786 interface JSDocAuthorTag extends JSDocTag { 5787 readonly kind: SyntaxKind.JSDocAuthorTag; 5788 } 5789 interface JSDocDeprecatedTag extends JSDocTag { 5790 kind: SyntaxKind.JSDocDeprecatedTag; 5791 } 5792 interface JSDocClassTag extends JSDocTag { 5793 readonly kind: SyntaxKind.JSDocClassTag; 5794 } 5795 interface JSDocPublicTag extends JSDocTag { 5796 readonly kind: SyntaxKind.JSDocPublicTag; 5797 } 5798 interface JSDocPrivateTag extends JSDocTag { 5799 readonly kind: SyntaxKind.JSDocPrivateTag; 5800 } 5801 interface JSDocProtectedTag extends JSDocTag { 5802 readonly kind: SyntaxKind.JSDocProtectedTag; 5803 } 5804 interface JSDocReadonlyTag extends JSDocTag { 5805 readonly kind: SyntaxKind.JSDocReadonlyTag; 5806 } 5807 interface JSDocOverrideTag extends JSDocTag { 5808 readonly kind: SyntaxKind.JSDocOverrideTag; 5809 } 5810 interface JSDocEnumTag extends JSDocTag, Declaration, LocalsContainer { 5811 readonly kind: SyntaxKind.JSDocEnumTag; 5812 readonly parent: JSDoc; 5813 readonly typeExpression: JSDocTypeExpression; 5814 } 5815 interface JSDocThisTag extends JSDocTag { 5816 readonly kind: SyntaxKind.JSDocThisTag; 5817 readonly typeExpression: JSDocTypeExpression; 5818 } 5819 interface JSDocTemplateTag extends JSDocTag { 5820 readonly kind: SyntaxKind.JSDocTemplateTag; 5821 readonly constraint: JSDocTypeExpression | undefined; 5822 readonly typeParameters: NodeArray<TypeParameterDeclaration>; 5823 } 5824 interface JSDocSeeTag extends JSDocTag { 5825 readonly kind: SyntaxKind.JSDocSeeTag; 5826 readonly name?: JSDocNameReference; 5827 } 5828 interface JSDocReturnTag extends JSDocTag { 5829 readonly kind: SyntaxKind.JSDocReturnTag; 5830 readonly typeExpression?: JSDocTypeExpression; 5831 } 5832 interface JSDocTypeTag extends JSDocTag { 5833 readonly kind: SyntaxKind.JSDocTypeTag; 5834 readonly typeExpression: JSDocTypeExpression; 5835 } 5836 interface JSDocTypedefTag extends JSDocTag, NamedDeclaration, LocalsContainer { 5837 readonly kind: SyntaxKind.JSDocTypedefTag; 5838 readonly parent: JSDoc; 5839 readonly fullName?: JSDocNamespaceDeclaration | Identifier; 5840 readonly name?: Identifier; 5841 readonly typeExpression?: JSDocTypeExpression | JSDocTypeLiteral; 5842 } 5843 interface JSDocCallbackTag extends JSDocTag, NamedDeclaration, LocalsContainer { 5844 readonly kind: SyntaxKind.JSDocCallbackTag; 5845 readonly parent: JSDoc; 5846 readonly fullName?: JSDocNamespaceDeclaration | Identifier; 5847 readonly name?: Identifier; 5848 readonly typeExpression: JSDocSignature; 5849 } 5850 interface JSDocOverloadTag extends JSDocTag { 5851 readonly kind: SyntaxKind.JSDocOverloadTag; 5852 readonly parent: JSDoc; 5853 readonly typeExpression: JSDocSignature; 5854 } 5855 interface JSDocThrowsTag extends JSDocTag { 5856 readonly kind: SyntaxKind.JSDocThrowsTag; 5857 readonly typeExpression?: JSDocTypeExpression; 5858 } 5859 interface JSDocSignature extends JSDocType, Declaration, JSDocContainer, LocalsContainer { 5860 readonly kind: SyntaxKind.JSDocSignature; 5861 readonly typeParameters?: readonly JSDocTemplateTag[]; 5862 readonly parameters: readonly JSDocParameterTag[]; 5863 readonly type: JSDocReturnTag | undefined; 5864 } 5865 interface JSDocPropertyLikeTag extends JSDocTag, Declaration { 5866 readonly parent: JSDoc; 5867 readonly name: EntityName; 5868 readonly typeExpression?: JSDocTypeExpression; 5869 /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */ 5870 readonly isNameFirst: boolean; 5871 readonly isBracketed: boolean; 5872 } 5873 interface JSDocPropertyTag extends JSDocPropertyLikeTag { 5874 readonly kind: SyntaxKind.JSDocPropertyTag; 5875 } 5876 interface JSDocParameterTag extends JSDocPropertyLikeTag { 5877 readonly kind: SyntaxKind.JSDocParameterTag; 5878 } 5879 interface JSDocTypeLiteral extends JSDocType, Declaration { 5880 readonly kind: SyntaxKind.JSDocTypeLiteral; 5881 readonly jsDocPropertyTags?: readonly JSDocPropertyLikeTag[]; 5882 /** If true, then this type literal represents an *array* of its type. */ 5883 readonly isArrayType: boolean; 5884 } 5885 interface JSDocSatisfiesTag extends JSDocTag { 5886 readonly kind: SyntaxKind.JSDocSatisfiesTag; 5887 readonly typeExpression: JSDocTypeExpression; 5888 } 5889 interface JSDocImportTag extends JSDocTag { 5890 readonly kind: SyntaxKind.JSDocImportTag; 5891 readonly parent: JSDoc; 5892 readonly importClause?: ImportClause; 5893 readonly moduleSpecifier: Expression; 5894 readonly attributes?: ImportAttributes; 5895 } 5896 type FlowType = Type | IncompleteType; 5897 interface IncompleteType { 5898 flags: TypeFlags | 0; 5899 type: Type; 5900 } 5901 interface AmdDependency { 5902 path: string; 5903 name?: string; 5904 } 5905 /** 5906 * Subset of properties from SourceFile that are used in multiple utility functions 5907 */ 5908 interface SourceFileLike { 5909 readonly text: string; 5910 } 5911 interface SourceFileLike { 5912 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 5913 } 5914 type ResolutionMode = ModuleKind.ESNext | ModuleKind.CommonJS | undefined; 5915 interface SourceFile extends Declaration, LocalsContainer { 5916 readonly kind: SyntaxKind.SourceFile; 5917 readonly statements: NodeArray<Statement>; 5918 readonly endOfFileToken: Token<SyntaxKind.EndOfFileToken>; 5919 fileName: string; 5920 text: string; 5921 amdDependencies: readonly AmdDependency[]; 5922 moduleName?: string; 5923 referencedFiles: readonly FileReference[]; 5924 typeReferenceDirectives: readonly FileReference[]; 5925 libReferenceDirectives: readonly FileReference[]; 5926 languageVariant: LanguageVariant; 5927 isDeclarationFile: boolean; 5928 /** 5929 * lib.d.ts should have a reference comment like 5930 * 5931 * /// <reference no-default-lib="true"/> 5932 * 5933 * If any other file has this comment, it signals not to include lib.d.ts 5934 * because this containing file is intended to act as a default library. 5935 */ 5936 hasNoDefaultLib: boolean; 5937 languageVersion: ScriptTarget; 5938 /** 5939 * When `module` is `Node16` or `NodeNext`, this field controls whether the 5940 * source file in question is an ESNext-output-format file, or a CommonJS-output-format 5941 * module. This is derived by the module resolver as it looks up the file, since 5942 * it is derived from either the file extension of the module, or the containing 5943 * `package.json` context, and affects both checking and emit. 5944 * 5945 * It is _public_ so that (pre)transformers can set this field, 5946 * since it switches the builtin `node` module transform. Generally speaking, if unset, 5947 * the field is treated as though it is `ModuleKind.CommonJS`. 5948 * 5949 * Note that this field is only set by the module resolution process when 5950 * `moduleResolution` is `Node16` or `NodeNext`, which is implied by the `module` setting 5951 * of `Node16` or `NodeNext`, respectively, but may be overriden (eg, by a `moduleResolution` 5952 * of `node`). If so, this field will be unset and source files will be considered to be 5953 * CommonJS-output-format by the node module transformer and type checker, regardless of extension or context. 5954 */ 5955 impliedNodeFormat?: ResolutionMode; 5956 } 5957 interface SourceFile { 5958 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 5959 getLineEndOfPosition(pos: number): number; 5960 getLineStarts(): readonly number[]; 5961 getPositionOfLineAndCharacter(line: number, character: number): number; 5962 update(newText: string, textChangeRange: TextChangeRange): SourceFile; 5963 } 5964 interface Bundle extends Node { 5965 readonly kind: SyntaxKind.Bundle; 5966 readonly sourceFiles: readonly SourceFile[]; 5967 } 5968 interface JsonSourceFile extends SourceFile { 5969 readonly statements: NodeArray<JsonObjectExpressionStatement>; 5970 } 5971 interface TsConfigSourceFile extends JsonSourceFile { 5972 extendedSourceFiles?: string[]; 5973 } 5974 interface JsonMinusNumericLiteral extends PrefixUnaryExpression { 5975 readonly kind: SyntaxKind.PrefixUnaryExpression; 5976 readonly operator: SyntaxKind.MinusToken; 5977 readonly operand: NumericLiteral; 5978 } 5979 type JsonObjectExpression = ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral; 5980 interface JsonObjectExpressionStatement extends ExpressionStatement { 5981 readonly expression: JsonObjectExpression; 5982 } 5983 interface ScriptReferenceHost { 5984 getCompilerOptions(): CompilerOptions; 5985 getSourceFile(fileName: string): SourceFile | undefined; 5986 getSourceFileByPath(path: Path): SourceFile | undefined; 5987 getCurrentDirectory(): string; 5988 } 5989 interface ParseConfigHost extends ModuleResolutionHost { 5990 useCaseSensitiveFileNames: boolean; 5991 readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[]; 5992 /** 5993 * Gets a value indicating whether the specified path exists and is a file. 5994 * @param path The path to test. 5995 */ 5996 fileExists(path: string): boolean; 5997 readFile(path: string): string | undefined; 5998 trace?(s: string): void; 5999 } 6000 /** 6001 * Branded string for keeping track of when we've turned an ambiguous path 6002 * specified like "./blah" to an absolute path to an actual 6003 * tsconfig file, e.g. "/root/blah/tsconfig.json" 6004 */ 6005 type ResolvedConfigFileName = string & { 6006 _isResolvedConfigFileName: never; 6007 }; 6008 interface WriteFileCallbackData { 6009 } 6010 type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void; 6011 class OperationCanceledException { 6012 } 6013 interface CancellationToken { 6014 isCancellationRequested(): boolean; 6015 /** @throws OperationCanceledException if isCancellationRequested is true */ 6016 throwIfCancellationRequested(): void; 6017 } 6018 interface Program extends ScriptReferenceHost { 6019 getCurrentDirectory(): string; 6020 /** 6021 * Get a list of root file names that were passed to a 'createProgram' 6022 */ 6023 getRootFileNames(): readonly string[]; 6024 /** 6025 * Get a list of files in the program 6026 */ 6027 getSourceFiles(): readonly SourceFile[]; 6028 /** 6029 * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then 6030 * the JavaScript and declaration files will be produced for all the files in this program. 6031 * If targetSourceFile is specified, then only the JavaScript and declaration for that 6032 * specific file will be generated. 6033 * 6034 * If writeFile is not specified then the writeFile callback from the compiler host will be 6035 * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter 6036 * will be invoked when writing the JavaScript and declaration files. 6037 */ 6038 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; 6039 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 6040 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 6041 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 6042 /** The first time this is called, it will return global diagnostics (no location). */ 6043 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 6044 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 6045 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 6046 /** 6047 * Gets a type checker that can be used to semantically analyze source files in the program. 6048 */ 6049 getTypeChecker(): TypeChecker; 6050 getNodeCount(): number; 6051 getIdentifierCount(): number; 6052 getSymbolCount(): number; 6053 getTypeCount(): number; 6054 getInstantiationCount(): number; 6055 getRelationCacheSizes(): { 6056 assignable: number; 6057 identity: number; 6058 subtype: number; 6059 strictSubtype: number; 6060 }; 6061 isSourceFileFromExternalLibrary(file: SourceFile): boolean; 6062 isSourceFileDefaultLibrary(file: SourceFile): boolean; 6063 /** 6064 * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution 6065 * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes, 6066 * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of 6067 * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript. 6068 * Some examples: 6069 * 6070 * ```ts 6071 * // tsc foo.mts --module nodenext 6072 * import {} from "mod"; 6073 * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension 6074 * 6075 * // tsc foo.cts --module nodenext 6076 * import {} from "mod"; 6077 * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension 6078 * 6079 * // tsc foo.ts --module preserve --moduleResolution bundler 6080 * import {} from "mod"; 6081 * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler` 6082 * // supports conditional imports/exports 6083 * 6084 * // tsc foo.ts --module preserve --moduleResolution node10 6085 * import {} from "mod"; 6086 * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10` 6087 * // does not support conditional imports/exports 6088 * 6089 * // tsc foo.ts --module commonjs --moduleResolution node10 6090 * import type {} from "mod" with { "resolution-mode": "import" }; 6091 * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute 6092 * ``` 6093 */ 6094 getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode; 6095 /** 6096 * Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result 6097 * when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided 6098 * via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution 6099 * settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the 6100 * usage would emit to JavaScript. Some examples: 6101 * 6102 * ```ts 6103 * // tsc foo.mts --module nodenext 6104 * import {} from "mod"; 6105 * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension 6106 * 6107 * // tsc foo.cts --module nodenext 6108 * import {} from "mod"; 6109 * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension 6110 * 6111 * // tsc foo.ts --module preserve --moduleResolution bundler 6112 * import {} from "mod"; 6113 * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler` 6114 * // supports conditional imports/exports 6115 * 6116 * // tsc foo.ts --module preserve --moduleResolution node10 6117 * import {} from "mod"; 6118 * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10` 6119 * // does not support conditional imports/exports 6120 * 6121 * // tsc foo.ts --module commonjs --moduleResolution node10 6122 * import type {} from "mod" with { "resolution-mode": "import" }; 6123 * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute 6124 * ``` 6125 */ 6126 getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode; 6127 getProjectReferences(): readonly ProjectReference[] | undefined; 6128 getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined; 6129 } 6130 interface ResolvedProjectReference { 6131 commandLine: ParsedCommandLine; 6132 sourceFile: SourceFile; 6133 references?: readonly (ResolvedProjectReference | undefined)[]; 6134 } 6135 type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer; 6136 interface CustomTransformer { 6137 transformSourceFile(node: SourceFile): SourceFile; 6138 transformBundle(node: Bundle): Bundle; 6139 } 6140 interface CustomTransformers { 6141 /** Custom transformers to evaluate before built-in .js transformations. */ 6142 before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; 6143 /** Custom transformers to evaluate after built-in .js transformations. */ 6144 after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; 6145 /** Custom transformers to evaluate after built-in .d.ts transformations. */ 6146 afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[]; 6147 } 6148 interface SourceMapSpan { 6149 /** Line number in the .js file. */ 6150 emittedLine: number; 6151 /** Column number in the .js file. */ 6152 emittedColumn: number; 6153 /** Line number in the .ts file. */ 6154 sourceLine: number; 6155 /** Column number in the .ts file. */ 6156 sourceColumn: number; 6157 /** Optional name (index into names array) associated with this span. */ 6158 nameIndex?: number; 6159 /** .ts file (index into sources array) associated with this span */ 6160 sourceIndex: number; 6161 } 6162 /** Return code used by getEmitOutput function to indicate status of the function */ 6163 enum ExitStatus { 6164 Success = 0, 6165 DiagnosticsPresent_OutputsSkipped = 1, 6166 DiagnosticsPresent_OutputsGenerated = 2, 6167 InvalidProject_OutputsSkipped = 3, 6168 ProjectReferenceCycle_OutputsSkipped = 4, 6169 } 6170 interface EmitResult { 6171 emitSkipped: boolean; 6172 /** Contains declaration emit diagnostics */ 6173 diagnostics: readonly Diagnostic[]; 6174 emittedFiles?: string[]; 6175 } 6176 interface TypeChecker { 6177 getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; 6178 getTypeOfSymbol(symbol: Symbol): Type; 6179 getDeclaredTypeOfSymbol(symbol: Symbol): Type; 6180 getPropertiesOfType(type: Type): Symbol[]; 6181 getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; 6182 getPrivateIdentifierPropertyOfType(leftType: Type, name: string, location: Node): Symbol | undefined; 6183 getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined; 6184 getIndexInfosOfType(type: Type): readonly IndexInfo[]; 6185 getIndexInfosOfIndexSymbol: (indexSymbol: Symbol, siblingSymbols?: Symbol[] | undefined) => IndexInfo[]; 6186 getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[]; 6187 getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined; 6188 getBaseTypes(type: InterfaceType): BaseType[]; 6189 getBaseTypeOfLiteralType(type: Type): Type; 6190 getWidenedType(type: Type): Type; 6191 /** 6192 * Gets the "awaited type" of a type. 6193 * 6194 * If an expression has a Promise-like type, the "awaited type" of the expression is 6195 * derived from the type of the first argument of the fulfillment callback for that 6196 * Promise's `then` method. If the "awaited type" is itself a Promise-like, it is 6197 * recursively unwrapped in the same manner until a non-promise type is found. 6198 * 6199 * If an expression does not have a Promise-like type, its "awaited type" is the type 6200 * of the expression. 6201 * 6202 * If the resulting "awaited type" is a generic object type, then it is wrapped in 6203 * an `Awaited<T>`. 6204 * 6205 * In the event the "awaited type" circularly references itself, or is a non-Promise 6206 * object-type with a callable `then()` method, an "awaited type" cannot be determined 6207 * and the value `undefined` will be returned. 6208 * 6209 * This is used to reflect the runtime behavior of the `await` keyword. 6210 */ 6211 getAwaitedType(type: Type): Type | undefined; 6212 getReturnTypeOfSignature(signature: Signature): Type; 6213 getNullableType(type: Type, flags: TypeFlags): Type; 6214 getNonNullableType(type: Type): Type; 6215 getTypeArguments(type: TypeReference): readonly Type[]; 6216 /** Note that the resulting nodes cannot be checked. */ 6217 typeToTypeNode(type: Type, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeNode | undefined; 6218 /** Note that the resulting nodes cannot be checked. */ 6219 signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): 6220 | SignatureDeclaration & { 6221 typeArguments?: NodeArray<TypeNode>; 6222 } 6223 | undefined; 6224 /** Note that the resulting nodes cannot be checked. */ 6225 indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): IndexSignatureDeclaration | undefined; 6226 /** Note that the resulting nodes cannot be checked. */ 6227 symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): EntityName | undefined; 6228 /** Note that the resulting nodes cannot be checked. */ 6229 symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): Expression | undefined; 6230 /** Note that the resulting nodes cannot be checked. */ 6231 symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): NodeArray<TypeParameterDeclaration> | undefined; 6232 /** Note that the resulting nodes cannot be checked. */ 6233 symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): ParameterDeclaration | undefined; 6234 /** Note that the resulting nodes cannot be checked. */ 6235 typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration: Node | undefined, flags: NodeBuilderFlags | undefined): TypeParameterDeclaration | undefined; 6236 getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; 6237 getSymbolAtLocation(node: Node): Symbol | undefined; 6238 getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; 6239 /** 6240 * The function returns the value (local variable) symbol of an identifier in the short-hand property assignment. 6241 * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value. 6242 */ 6243 getShorthandAssignmentValueSymbol(location: Node | undefined): Symbol | undefined; 6244 getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined; 6245 /** 6246 * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. 6247 * Otherwise returns its input. 6248 * For example, at `export type T = number;`: 6249 * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. 6250 * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. 6251 * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. 6252 */ 6253 getExportSymbolOfSymbol(symbol: Symbol): Symbol; 6254 getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; 6255 getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type; 6256 getTypeAtLocation(node: Node): Type; 6257 getTypeFromTypeNode(node: TypeNode): Type; 6258 signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; 6259 typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; 6260 symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; 6261 typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; 6262 getFullyQualifiedName(symbol: Symbol): string; 6263 getAugmentedPropertiesOfType(type: Type): Symbol[]; 6264 getRootSymbols(symbol: Symbol): readonly Symbol[]; 6265 getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined; 6266 getContextualType(node: Expression): Type | undefined; 6267 /** 6268 * returns unknownSignature in the case of an error. 6269 * returns undefined if the node is not valid. 6270 * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`. 6271 */ 6272 getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined; 6273 getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined; 6274 isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined; 6275 isUndefinedSymbol(symbol: Symbol): boolean; 6276 isArgumentsSymbol(symbol: Symbol): boolean; 6277 isUnknownSymbol(symbol: Symbol): boolean; 6278 getMergedSymbol(symbol: Symbol): Symbol; 6279 getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined; 6280 isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean; 6281 /** Follow all aliases to get the original symbol. */ 6282 getAliasedSymbol(symbol: Symbol): Symbol; 6283 /** Follow a *single* alias to get the immediately aliased symbol. */ 6284 getImmediateAliasedSymbol(symbol: Symbol): Symbol | undefined; 6285 getExportsOfModule(moduleSymbol: Symbol): Symbol[]; 6286 getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; 6287 isOptionalParameter(node: ParameterDeclaration): boolean; 6288 getAmbientModules(): Symbol[]; 6289 tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; 6290 getApparentType(type: Type): Type; 6291 getBaseConstraintOfType(type: Type): Type | undefined; 6292 getDefaultFromTypeParameter(type: Type): Type | undefined; 6293 /** 6294 * Gets the intrinsic `any` type. There are multiple types that act as `any` used internally in the compiler, 6295 * so the type returned by this function should not be used in equality checks to determine if another type 6296 * is `any`. Instead, use `type.flags & TypeFlags.Any`. 6297 */ 6298 getAnyType(): Type; 6299 getStringType(): Type; 6300 getStringLiteralType(value: string): StringLiteralType; 6301 getNumberType(): Type; 6302 getNumberLiteralType(value: number): NumberLiteralType; 6303 getBigIntType(): Type; 6304 getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType; 6305 getBooleanType(): Type; 6306 getUnknownType(): Type; 6307 getFalseType(): Type; 6308 getTrueType(): Type; 6309 getVoidType(): Type; 6310 /** 6311 * Gets the intrinsic `undefined` type. There are multiple types that act as `undefined` used internally in the compiler 6312 * depending on compiler options, so the type returned by this function should not be used in equality checks to determine 6313 * if another type is `undefined`. Instead, use `type.flags & TypeFlags.Undefined`. 6314 */ 6315 getUndefinedType(): Type; 6316 /** 6317 * Gets the intrinsic `null` type. There are multiple types that act as `null` used internally in the compiler, 6318 * so the type returned by this function should not be used in equality checks to determine if another type 6319 * is `null`. Instead, use `type.flags & TypeFlags.Null`. 6320 */ 6321 getNullType(): Type; 6322 getESSymbolType(): Type; 6323 /** 6324 * Gets the intrinsic `never` type. There are multiple types that act as `never` used internally in the compiler, 6325 * so the type returned by this function should not be used in equality checks to determine if another type 6326 * is `never`. Instead, use `type.flags & TypeFlags.Never`. 6327 */ 6328 getNeverType(): Type; 6329 /** 6330 * Gets the intrinsic `object` type. 6331 */ 6332 getNonPrimitiveType(): Type; 6333 /** 6334 * Returns true if the "source" type is assignable to the "target" type. 6335 * 6336 * ```ts 6337 * declare const abcLiteral: ts.Type; // Type of "abc" 6338 * declare const stringType: ts.Type; // Type of string 6339 * 6340 * isTypeAssignableTo(abcLiteral, abcLiteral); // true; "abc" is assignable to "abc" 6341 * isTypeAssignableTo(abcLiteral, stringType); // true; "abc" is assignable to string 6342 * isTypeAssignableTo(stringType, abcLiteral); // false; string is not assignable to "abc" 6343 * isTypeAssignableTo(stringType, stringType); // true; string is assignable to string 6344 * ``` 6345 */ 6346 isTypeAssignableTo(source: Type, target: Type): boolean; 6347 /** 6348 * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts. 6349 * This function will _not_ return true if passed a type which 6350 * extends `Array` (for example, the TypeScript AST's `NodeArray` type). 6351 */ 6352 isArrayType(type: Type): boolean; 6353 /** 6354 * True if this type is a tuple type. This function will _not_ return true if 6355 * passed a type which extends from a tuple. 6356 */ 6357 isTupleType(type: Type): boolean; 6358 /** 6359 * True if this type is assignable to `ReadonlyArray<any>`. 6360 */ 6361 isArrayLikeType(type: Type): boolean; 6362 resolveName(name: string, location: Node | undefined, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined; 6363 getTypePredicateOfSignature(signature: Signature): TypePredicate | undefined; 6364 /** 6365 * Depending on the operation performed, it may be appropriate to throw away the checker 6366 * if the cancellation token is triggered. Typically, if it is used for error checking 6367 * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep. 6368 */ 6369 runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T; 6370 getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; 6371 } 6372 enum NodeBuilderFlags { 6373 None = 0, 6374 NoTruncation = 1, 6375 WriteArrayAsGenericType = 2, 6376 GenerateNamesForShadowedTypeParams = 4, 6377 UseStructuralFallback = 8, 6378 ForbidIndexedAccessSymbolReferences = 16, 6379 WriteTypeArgumentsOfSignature = 32, 6380 UseFullyQualifiedType = 64, 6381 UseOnlyExternalAliasing = 128, 6382 SuppressAnyReturnType = 256, 6383 WriteTypeParametersInQualifiedName = 512, 6384 MultilineObjectLiterals = 1024, 6385 WriteClassExpressionAsTypeLiteral = 2048, 6386 UseTypeOfFunction = 4096, 6387 OmitParameterModifiers = 8192, 6388 UseAliasDefinedOutsideCurrentScope = 16384, 6389 UseSingleQuotesForStringLiteralType = 268435456, 6390 NoTypeReduction = 536870912, 6391 OmitThisParameter = 33554432, 6392 AllowThisInObjectLiteral = 32768, 6393 AllowQualifiedNameInPlaceOfIdentifier = 65536, 6394 AllowAnonymousIdentifier = 131072, 6395 AllowEmptyUnionOrIntersection = 262144, 6396 AllowEmptyTuple = 524288, 6397 AllowUniqueESSymbolType = 1048576, 6398 AllowEmptyIndexInfoType = 2097152, 6399 AllowNodeModulesRelativePaths = 67108864, 6400 IgnoreErrors = 70221824, 6401 InObjectTypeLiteral = 4194304, 6402 InTypeAlias = 8388608, 6403 InInitialEntityName = 16777216, 6404 } 6405 enum TypeFormatFlags { 6406 None = 0, 6407 NoTruncation = 1, 6408 WriteArrayAsGenericType = 2, 6409 GenerateNamesForShadowedTypeParams = 4, 6410 UseStructuralFallback = 8, 6411 WriteTypeArgumentsOfSignature = 32, 6412 UseFullyQualifiedType = 64, 6413 SuppressAnyReturnType = 256, 6414 MultilineObjectLiterals = 1024, 6415 WriteClassExpressionAsTypeLiteral = 2048, 6416 UseTypeOfFunction = 4096, 6417 OmitParameterModifiers = 8192, 6418 UseAliasDefinedOutsideCurrentScope = 16384, 6419 UseSingleQuotesForStringLiteralType = 268435456, 6420 NoTypeReduction = 536870912, 6421 OmitThisParameter = 33554432, 6422 AllowUniqueESSymbolType = 1048576, 6423 AddUndefined = 131072, 6424 WriteArrowStyleSignature = 262144, 6425 InArrayType = 524288, 6426 InElementType = 2097152, 6427 InFirstTypeArgument = 4194304, 6428 InTypeAlias = 8388608, 6429 NodeBuilderFlagsMask = 848330095, 6430 } 6431 enum SymbolFormatFlags { 6432 None = 0, 6433 WriteTypeParametersOrArguments = 1, 6434 UseOnlyExternalAliasing = 2, 6435 AllowAnyNodeKind = 4, 6436 UseAliasDefinedOutsideCurrentScope = 8, 6437 } 6438 enum TypePredicateKind { 6439 This = 0, 6440 Identifier = 1, 6441 AssertsThis = 2, 6442 AssertsIdentifier = 3, 6443 } 6444 interface TypePredicateBase { 6445 kind: TypePredicateKind; 6446 type: Type | undefined; 6447 } 6448 interface ThisTypePredicate extends TypePredicateBase { 6449 kind: TypePredicateKind.This; 6450 parameterName: undefined; 6451 parameterIndex: undefined; 6452 type: Type; 6453 } 6454 interface IdentifierTypePredicate extends TypePredicateBase { 6455 kind: TypePredicateKind.Identifier; 6456 parameterName: string; 6457 parameterIndex: number; 6458 type: Type; 6459 } 6460 interface AssertsThisTypePredicate extends TypePredicateBase { 6461 kind: TypePredicateKind.AssertsThis; 6462 parameterName: undefined; 6463 parameterIndex: undefined; 6464 type: Type | undefined; 6465 } 6466 interface AssertsIdentifierTypePredicate extends TypePredicateBase { 6467 kind: TypePredicateKind.AssertsIdentifier; 6468 parameterName: string; 6469 parameterIndex: number; 6470 type: Type | undefined; 6471 } 6472 type TypePredicate = ThisTypePredicate | IdentifierTypePredicate | AssertsThisTypePredicate | AssertsIdentifierTypePredicate; 6473 enum SymbolFlags { 6474 None = 0, 6475 FunctionScopedVariable = 1, 6476 BlockScopedVariable = 2, 6477 Property = 4, 6478 EnumMember = 8, 6479 Function = 16, 6480 Class = 32, 6481 Interface = 64, 6482 ConstEnum = 128, 6483 RegularEnum = 256, 6484 ValueModule = 512, 6485 NamespaceModule = 1024, 6486 TypeLiteral = 2048, 6487 ObjectLiteral = 4096, 6488 Method = 8192, 6489 Constructor = 16384, 6490 GetAccessor = 32768, 6491 SetAccessor = 65536, 6492 Signature = 131072, 6493 TypeParameter = 262144, 6494 TypeAlias = 524288, 6495 ExportValue = 1048576, 6496 Alias = 2097152, 6497 Prototype = 4194304, 6498 ExportStar = 8388608, 6499 Optional = 16777216, 6500 Transient = 33554432, 6501 Assignment = 67108864, 6502 ModuleExports = 134217728, 6503 All = -1, 6504 Enum = 384, 6505 Variable = 3, 6506 Value = 111551, 6507 Type = 788968, 6508 Namespace = 1920, 6509 Module = 1536, 6510 Accessor = 98304, 6511 FunctionScopedVariableExcludes = 111550, 6512 BlockScopedVariableExcludes = 111551, 6513 ParameterExcludes = 111551, 6514 PropertyExcludes = 0, 6515 EnumMemberExcludes = 900095, 6516 FunctionExcludes = 110991, 6517 ClassExcludes = 899503, 6518 InterfaceExcludes = 788872, 6519 RegularEnumExcludes = 899327, 6520 ConstEnumExcludes = 899967, 6521 ValueModuleExcludes = 110735, 6522 NamespaceModuleExcludes = 0, 6523 MethodExcludes = 103359, 6524 GetAccessorExcludes = 46015, 6525 SetAccessorExcludes = 78783, 6526 AccessorExcludes = 13247, 6527 TypeParameterExcludes = 526824, 6528 TypeAliasExcludes = 788968, 6529 AliasExcludes = 2097152, 6530 ModuleMember = 2623475, 6531 ExportHasLocal = 944, 6532 BlockScoped = 418, 6533 PropertyOrAccessor = 98308, 6534 ClassMember = 106500, 6535 } 6536 interface Symbol { 6537 flags: SymbolFlags; 6538 escapedName: __String; 6539 declarations?: Declaration[]; 6540 valueDeclaration?: Declaration; 6541 members?: SymbolTable; 6542 exports?: SymbolTable; 6543 globalExports?: SymbolTable; 6544 } 6545 interface Symbol { 6546 readonly name: string; 6547 getFlags(): SymbolFlags; 6548 getEscapedName(): __String; 6549 getName(): string; 6550 getDeclarations(): Declaration[] | undefined; 6551 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[]; 6552 getJsDocTags(checker?: TypeChecker): JSDocTagInfo[]; 6553 } 6554 enum InternalSymbolName { 6555 Call = "__call", 6556 Constructor = "__constructor", 6557 New = "__new", 6558 Index = "__index", 6559 ExportStar = "__export", 6560 Global = "__global", 6561 Missing = "__missing", 6562 Type = "__type", 6563 Object = "__object", 6564 JSXAttributes = "__jsxAttributes", 6565 Class = "__class", 6566 Function = "__function", 6567 Computed = "__computed", 6568 Resolving = "__resolving__", 6569 ExportEquals = "export=", 6570 Default = "default", 6571 This = "this", 6572 InstantiationExpression = "__instantiationExpression", 6573 ImportAttributes = "__importAttributes", 6574 } 6575 /** 6576 * This represents a string whose leading underscore have been escaped by adding extra leading underscores. 6577 * The shape of this brand is rather unique compared to others we've used. 6578 * Instead of just an intersection of a string and an object, it is that union-ed 6579 * with an intersection of void and an object. This makes it wholly incompatible 6580 * with a normal string (which is good, it cannot be misused on assignment or on usage), 6581 * while still being comparable with a normal string via === (also good) and castable from a string. 6582 */ 6583 type __String = 6584 | (string & { 6585 __escapedIdentifier: void; 6586 }) 6587 | (void & { 6588 __escapedIdentifier: void; 6589 }) 6590 | InternalSymbolName; 6591 /** @deprecated Use ReadonlyMap<__String, T> instead. */ 6592 type ReadonlyUnderscoreEscapedMap<T> = ReadonlyMap<__String, T>; 6593 /** @deprecated Use Map<__String, T> instead. */ 6594 type UnderscoreEscapedMap<T> = Map<__String, T>; 6595 /** SymbolTable based on ES6 Map interface. */ 6596 type SymbolTable = Map<__String, Symbol>; 6597 enum TypeFlags { 6598 Any = 1, 6599 Unknown = 2, 6600 String = 4, 6601 Number = 8, 6602 Boolean = 16, 6603 Enum = 32, 6604 BigInt = 64, 6605 StringLiteral = 128, 6606 NumberLiteral = 256, 6607 BooleanLiteral = 512, 6608 EnumLiteral = 1024, 6609 BigIntLiteral = 2048, 6610 ESSymbol = 4096, 6611 UniqueESSymbol = 8192, 6612 Void = 16384, 6613 Undefined = 32768, 6614 Null = 65536, 6615 Never = 131072, 6616 TypeParameter = 262144, 6617 Object = 524288, 6618 Union = 1048576, 6619 Intersection = 2097152, 6620 Index = 4194304, 6621 IndexedAccess = 8388608, 6622 Conditional = 16777216, 6623 Substitution = 33554432, 6624 NonPrimitive = 67108864, 6625 TemplateLiteral = 134217728, 6626 StringMapping = 268435456, 6627 Literal = 2944, 6628 Unit = 109472, 6629 Freshable = 2976, 6630 StringOrNumberLiteral = 384, 6631 PossiblyFalsy = 117724, 6632 StringLike = 402653316, 6633 NumberLike = 296, 6634 BigIntLike = 2112, 6635 BooleanLike = 528, 6636 EnumLike = 1056, 6637 ESSymbolLike = 12288, 6638 VoidLike = 49152, 6639 UnionOrIntersection = 3145728, 6640 StructuredType = 3670016, 6641 TypeVariable = 8650752, 6642 InstantiableNonPrimitive = 58982400, 6643 InstantiablePrimitive = 406847488, 6644 Instantiable = 465829888, 6645 StructuredOrInstantiable = 469499904, 6646 Narrowable = 536624127, 6647 } 6648 type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; 6649 interface Type { 6650 flags: TypeFlags; 6651 symbol: Symbol; 6652 pattern?: DestructuringPattern; 6653 aliasSymbol?: Symbol; 6654 aliasTypeArguments?: readonly Type[]; 6655 } 6656 interface Type { 6657 getFlags(): TypeFlags; 6658 getSymbol(): Symbol | undefined; 6659 getProperties(): Symbol[]; 6660 getProperty(propertyName: string): Symbol | undefined; 6661 getApparentProperties(): Symbol[]; 6662 getCallSignatures(): readonly Signature[]; 6663 getConstructSignatures(): readonly Signature[]; 6664 getStringIndexType(): Type | undefined; 6665 getNumberIndexType(): Type | undefined; 6666 getBaseTypes(): BaseType[] | undefined; 6667 getNonNullableType(): Type; 6668 getConstraint(): Type | undefined; 6669 getDefault(): Type | undefined; 6670 isUnion(): this is UnionType; 6671 isIntersection(): this is IntersectionType; 6672 isUnionOrIntersection(): this is UnionOrIntersectionType; 6673 isLiteral(): this is LiteralType; 6674 isStringLiteral(): this is StringLiteralType; 6675 isNumberLiteral(): this is NumberLiteralType; 6676 isTypeParameter(): this is TypeParameter; 6677 isClassOrInterface(): this is InterfaceType; 6678 isClass(): this is InterfaceType; 6679 isIndexType(): this is IndexType; 6680 } 6681 interface FreshableType extends Type { 6682 freshType: FreshableType; 6683 regularType: FreshableType; 6684 } 6685 interface LiteralType extends FreshableType { 6686 value: string | number | PseudoBigInt; 6687 } 6688 interface UniqueESSymbolType extends Type { 6689 symbol: Symbol; 6690 escapedName: __String; 6691 } 6692 interface StringLiteralType extends LiteralType { 6693 value: string; 6694 } 6695 interface NumberLiteralType extends LiteralType { 6696 value: number; 6697 } 6698 interface BigIntLiteralType extends LiteralType { 6699 value: PseudoBigInt; 6700 } 6701 interface EnumType extends FreshableType { 6702 } 6703 enum ObjectFlags { 6704 None = 0, 6705 Class = 1, 6706 Interface = 2, 6707 Reference = 4, 6708 Tuple = 8, 6709 Anonymous = 16, 6710 Mapped = 32, 6711 Instantiated = 64, 6712 ObjectLiteral = 128, 6713 EvolvingArray = 256, 6714 ObjectLiteralPatternWithComputedProperties = 512, 6715 ReverseMapped = 1024, 6716 JsxAttributes = 2048, 6717 JSLiteral = 4096, 6718 FreshLiteral = 8192, 6719 ArrayLiteral = 16384, 6720 SingleSignatureType = 134217728, 6721 ClassOrInterface = 3, 6722 ContainsSpread = 2097152, 6723 ObjectRestType = 4194304, 6724 InstantiationExpressionType = 8388608, 6725 } 6726 interface ObjectType extends Type { 6727 objectFlags: ObjectFlags; 6728 } 6729 /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */ 6730 interface InterfaceType extends ObjectType { 6731 typeParameters: TypeParameter[] | undefined; 6732 outerTypeParameters: TypeParameter[] | undefined; 6733 localTypeParameters: TypeParameter[] | undefined; 6734 thisType: TypeParameter | undefined; 6735 } 6736 type BaseType = ObjectType | IntersectionType | TypeVariable; 6737 interface InterfaceTypeWithDeclaredMembers extends InterfaceType { 6738 declaredProperties: Symbol[]; 6739 declaredCallSignatures: Signature[]; 6740 declaredConstructSignatures: Signature[]; 6741 declaredIndexInfos: IndexInfo[]; 6742 } 6743 /** 6744 * Type references (ObjectFlags.Reference). When a class or interface has type parameters or 6745 * a "this" type, references to the class or interface are made using type references. The 6746 * typeArguments property specifies the types to substitute for the type parameters of the 6747 * class or interface and optionally includes an extra element that specifies the type to 6748 * substitute for "this" in the resulting instantiation. When no extra argument is present, 6749 * the type reference itself is substituted for "this". The typeArguments property is undefined 6750 * if the class or interface has no type parameters and the reference isn't specifying an 6751 * explicit "this" argument. 6752 */ 6753 interface TypeReference extends ObjectType { 6754 target: GenericType; 6755 node?: TypeReferenceNode | ArrayTypeNode | TupleTypeNode; 6756 } 6757 interface TypeReference { 6758 typeArguments?: readonly Type[]; 6759 } 6760 interface DeferredTypeReference extends TypeReference { 6761 } 6762 interface GenericType extends InterfaceType, TypeReference { 6763 } 6764 enum ElementFlags { 6765 Required = 1, 6766 Optional = 2, 6767 Rest = 4, 6768 Variadic = 8, 6769 Fixed = 3, 6770 Variable = 12, 6771 NonRequired = 14, 6772 NonRest = 11, 6773 } 6774 interface TupleType extends GenericType { 6775 elementFlags: readonly ElementFlags[]; 6776 /** Number of required or variadic elements */ 6777 minLength: number; 6778 /** Number of initial required or optional elements */ 6779 fixedLength: number; 6780 /** 6781 * True if tuple has any rest or variadic elements 6782 * 6783 * @deprecated Use `.combinedFlags & ElementFlags.Variable` instead 6784 */ 6785 hasRestElement: boolean; 6786 combinedFlags: ElementFlags; 6787 readonly: boolean; 6788 labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration | undefined)[]; 6789 } 6790 interface TupleTypeReference extends TypeReference { 6791 target: TupleType; 6792 } 6793 interface UnionOrIntersectionType extends Type { 6794 types: Type[]; 6795 } 6796 interface UnionType extends UnionOrIntersectionType { 6797 } 6798 interface IntersectionType extends UnionOrIntersectionType { 6799 } 6800 type StructuredType = ObjectType | UnionType | IntersectionType; 6801 interface EvolvingArrayType extends ObjectType { 6802 elementType: Type; 6803 finalArrayType?: Type; 6804 } 6805 interface InstantiableType extends Type { 6806 } 6807 interface TypeParameter extends InstantiableType { 6808 } 6809 interface IndexedAccessType extends InstantiableType { 6810 objectType: Type; 6811 indexType: Type; 6812 constraint?: Type; 6813 simplifiedForReading?: Type; 6814 simplifiedForWriting?: Type; 6815 } 6816 type TypeVariable = TypeParameter | IndexedAccessType; 6817 interface IndexType extends InstantiableType { 6818 type: InstantiableType | UnionOrIntersectionType; 6819 } 6820 interface ConditionalRoot { 6821 node: ConditionalTypeNode; 6822 checkType: Type; 6823 extendsType: Type; 6824 isDistributive: boolean; 6825 inferTypeParameters?: TypeParameter[]; 6826 outerTypeParameters?: TypeParameter[]; 6827 instantiations?: Map<string, Type>; 6828 aliasSymbol?: Symbol; 6829 aliasTypeArguments?: Type[]; 6830 } 6831 interface ConditionalType extends InstantiableType { 6832 root: ConditionalRoot; 6833 checkType: Type; 6834 extendsType: Type; 6835 resolvedTrueType?: Type; 6836 resolvedFalseType?: Type; 6837 } 6838 interface TemplateLiteralType extends InstantiableType { 6839 texts: readonly string[]; 6840 types: readonly Type[]; 6841 } 6842 interface StringMappingType extends InstantiableType { 6843 symbol: Symbol; 6844 type: Type; 6845 } 6846 interface SubstitutionType extends InstantiableType { 6847 objectFlags: ObjectFlags; 6848 baseType: Type; 6849 constraint: Type; 6850 } 6851 enum SignatureKind { 6852 Call = 0, 6853 Construct = 1, 6854 } 6855 interface Signature { 6856 declaration?: SignatureDeclaration | JSDocSignature; 6857 typeParameters?: readonly TypeParameter[]; 6858 parameters: readonly Symbol[]; 6859 thisParameter?: Symbol; 6860 } 6861 interface Signature { 6862 getDeclaration(): SignatureDeclaration; 6863 getTypeParameters(): TypeParameter[] | undefined; 6864 getParameters(): Symbol[]; 6865 getTypeParameterAtPosition(pos: number): Type; 6866 getReturnType(): Type; 6867 getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[]; 6868 getJsDocTags(): JSDocTagInfo[]; 6869 } 6870 enum IndexKind { 6871 String = 0, 6872 Number = 1, 6873 } 6874 type ElementWithComputedPropertyName = (ClassElement | ObjectLiteralElement) & { 6875 name: ComputedPropertyName; 6876 }; 6877 interface IndexInfo { 6878 keyType: Type; 6879 type: Type; 6880 isReadonly: boolean; 6881 declaration?: IndexSignatureDeclaration; 6882 components?: ElementWithComputedPropertyName[]; 6883 } 6884 enum InferencePriority { 6885 None = 0, 6886 NakedTypeVariable = 1, 6887 SpeculativeTuple = 2, 6888 SubstituteSource = 4, 6889 HomomorphicMappedType = 8, 6890 PartialHomomorphicMappedType = 16, 6891 MappedTypeConstraint = 32, 6892 ContravariantConditional = 64, 6893 ReturnType = 128, 6894 LiteralKeyof = 256, 6895 NoConstraints = 512, 6896 AlwaysStrict = 1024, 6897 MaxValue = 2048, 6898 PriorityImpliesCombination = 416, 6899 Circularity = -1, 6900 } 6901 interface FileExtensionInfo { 6902 extension: string; 6903 isMixedContent: boolean; 6904 scriptKind?: ScriptKind; 6905 } 6906 interface DiagnosticMessage { 6907 key: string; 6908 category: DiagnosticCategory; 6909 code: number; 6910 message: string; 6911 reportsUnnecessary?: {}; 6912 reportsDeprecated?: {}; 6913 } 6914 /** 6915 * A linked list of formatted diagnostic messages to be used as part of a multiline message. 6916 * It is built from the bottom up, leaving the head to be the "main" diagnostic. 6917 * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, 6918 * the difference is that messages are all preformatted in DMC. 6919 */ 6920 interface DiagnosticMessageChain { 6921 messageText: string; 6922 category: DiagnosticCategory; 6923 code: number; 6924 next?: DiagnosticMessageChain[]; 6925 } 6926 interface Diagnostic extends DiagnosticRelatedInformation { 6927 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ 6928 reportsUnnecessary?: {}; 6929 reportsDeprecated?: {}; 6930 source?: string; 6931 relatedInformation?: DiagnosticRelatedInformation[]; 6932 } 6933 interface DiagnosticRelatedInformation { 6934 category: DiagnosticCategory; 6935 code: number; 6936 file: SourceFile | undefined; 6937 start: number | undefined; 6938 length: number | undefined; 6939 messageText: string | DiagnosticMessageChain; 6940 } 6941 interface DiagnosticWithLocation extends Diagnostic { 6942 file: SourceFile; 6943 start: number; 6944 length: number; 6945 } 6946 enum DiagnosticCategory { 6947 Warning = 0, 6948 Error = 1, 6949 Suggestion = 2, 6950 Message = 3, 6951 } 6952 enum ModuleResolutionKind { 6953 Classic = 1, 6954 /** 6955 * @deprecated 6956 * `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets. 6957 * Use the new name or consider switching to a modern module resolution target. 6958 */ 6959 NodeJs = 2, 6960 Node10 = 2, 6961 Node16 = 3, 6962 NodeNext = 99, 6963 Bundler = 100, 6964 } 6965 enum ModuleDetectionKind { 6966 /** 6967 * Files with imports, exports and/or import.meta are considered modules 6968 */ 6969 Legacy = 1, 6970 /** 6971 * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+ 6972 */ 6973 Auto = 2, 6974 /** 6975 * Consider all non-declaration files modules, regardless of present syntax 6976 */ 6977 Force = 3, 6978 } 6979 interface PluginImport { 6980 name: string; 6981 } 6982 interface ProjectReference { 6983 /** A normalized path on disk */ 6984 path: string; 6985 /** The path as the user originally wrote it */ 6986 originalPath?: string; 6987 /** @deprecated */ 6988 prepend?: boolean; 6989 /** True if it is intended that this reference form a circularity */ 6990 circular?: boolean; 6991 } 6992 enum WatchFileKind { 6993 FixedPollingInterval = 0, 6994 PriorityPollingInterval = 1, 6995 DynamicPriorityPolling = 2, 6996 FixedChunkSizePolling = 3, 6997 UseFsEvents = 4, 6998 UseFsEventsOnParentDirectory = 5, 6999 } 7000 enum WatchDirectoryKind { 7001 UseFsEvents = 0, 7002 FixedPollingInterval = 1, 7003 DynamicPriorityPolling = 2, 7004 FixedChunkSizePolling = 3, 7005 } 7006 enum PollingWatchKind { 7007 FixedInterval = 0, 7008 PriorityInterval = 1, 7009 DynamicPriority = 2, 7010 FixedChunkSize = 3, 7011 } 7012 type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined; 7013 interface CompilerOptions { 7014 allowImportingTsExtensions?: boolean; 7015 allowJs?: boolean; 7016 allowArbitraryExtensions?: boolean; 7017 allowSyntheticDefaultImports?: boolean; 7018 allowUmdGlobalAccess?: boolean; 7019 allowUnreachableCode?: boolean; 7020 allowUnusedLabels?: boolean; 7021 alwaysStrict?: boolean; 7022 baseUrl?: string; 7023 /** @deprecated */ 7024 charset?: string; 7025 checkJs?: boolean; 7026 customConditions?: string[]; 7027 declaration?: boolean; 7028 declarationMap?: boolean; 7029 emitDeclarationOnly?: boolean; 7030 declarationDir?: string; 7031 disableSizeLimit?: boolean; 7032 disableSourceOfProjectReferenceRedirect?: boolean; 7033 disableSolutionSearching?: boolean; 7034 disableReferencedProjectLoad?: boolean; 7035 downlevelIteration?: boolean; 7036 emitBOM?: boolean; 7037 emitDecoratorMetadata?: boolean; 7038 exactOptionalPropertyTypes?: boolean; 7039 experimentalDecorators?: boolean; 7040 forceConsistentCasingInFileNames?: boolean; 7041 ignoreDeprecations?: string; 7042 importHelpers?: boolean; 7043 /** @deprecated */ 7044 importsNotUsedAsValues?: ImportsNotUsedAsValues; 7045 inlineSourceMap?: boolean; 7046 inlineSources?: boolean; 7047 isolatedModules?: boolean; 7048 isolatedDeclarations?: boolean; 7049 jsx?: JsxEmit; 7050 /** @deprecated */ 7051 keyofStringsOnly?: boolean; 7052 lib?: string[]; 7053 libReplacement?: boolean; 7054 locale?: string; 7055 mapRoot?: string; 7056 maxNodeModuleJsDepth?: number; 7057 module?: ModuleKind; 7058 moduleResolution?: ModuleResolutionKind; 7059 moduleSuffixes?: string[]; 7060 moduleDetection?: ModuleDetectionKind; 7061 newLine?: NewLineKind; 7062 noEmit?: boolean; 7063 noCheck?: boolean; 7064 noEmitHelpers?: boolean; 7065 noEmitOnError?: boolean; 7066 noErrorTruncation?: boolean; 7067 noFallthroughCasesInSwitch?: boolean; 7068 noImplicitAny?: boolean; 7069 noImplicitReturns?: boolean; 7070 noImplicitThis?: boolean; 7071 /** @deprecated */ 7072 noStrictGenericChecks?: boolean; 7073 noUnusedLocals?: boolean; 7074 noUnusedParameters?: boolean; 7075 /** @deprecated */ 7076 noImplicitUseStrict?: boolean; 7077 noPropertyAccessFromIndexSignature?: boolean; 7078 assumeChangesOnlyAffectDirectDependencies?: boolean; 7079 noLib?: boolean; 7080 noResolve?: boolean; 7081 noUncheckedIndexedAccess?: boolean; 7082 /** @deprecated */ 7083 out?: string; 7084 outDir?: string; 7085 outFile?: string; 7086 paths?: MapLike<string[]>; 7087 preserveConstEnums?: boolean; 7088 noImplicitOverride?: boolean; 7089 preserveSymlinks?: boolean; 7090 /** @deprecated */ 7091 preserveValueImports?: boolean; 7092 project?: string; 7093 reactNamespace?: string; 7094 jsxFactory?: string; 7095 jsxFragmentFactory?: string; 7096 jsxImportSource?: string; 7097 composite?: boolean; 7098 incremental?: boolean; 7099 tsBuildInfoFile?: string; 7100 removeComments?: boolean; 7101 resolvePackageJsonExports?: boolean; 7102 resolvePackageJsonImports?: boolean; 7103 rewriteRelativeImportExtensions?: boolean; 7104 rootDir?: string; 7105 rootDirs?: string[]; 7106 skipLibCheck?: boolean; 7107 skipDefaultLibCheck?: boolean; 7108 sourceMap?: boolean; 7109 sourceRoot?: string; 7110 strict?: boolean; 7111 strictFunctionTypes?: boolean; 7112 strictBindCallApply?: boolean; 7113 strictNullChecks?: boolean; 7114 strictPropertyInitialization?: boolean; 7115 strictBuiltinIteratorReturn?: boolean; 7116 stripInternal?: boolean; 7117 /** @deprecated */ 7118 suppressExcessPropertyErrors?: boolean; 7119 /** @deprecated */ 7120 suppressImplicitAnyIndexErrors?: boolean; 7121 target?: ScriptTarget; 7122 traceResolution?: boolean; 7123 useUnknownInCatchVariables?: boolean; 7124 noUncheckedSideEffectImports?: boolean; 7125 resolveJsonModule?: boolean; 7126 types?: string[]; 7127 /** Paths used to compute primary types search locations */ 7128 typeRoots?: string[]; 7129 verbatimModuleSyntax?: boolean; 7130 erasableSyntaxOnly?: boolean; 7131 esModuleInterop?: boolean; 7132 useDefineForClassFields?: boolean; 7133 [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; 7134 } 7135 interface WatchOptions { 7136 watchFile?: WatchFileKind; 7137 watchDirectory?: WatchDirectoryKind; 7138 fallbackPolling?: PollingWatchKind; 7139 synchronousWatchDirectory?: boolean; 7140 excludeDirectories?: string[]; 7141 excludeFiles?: string[]; 7142 [option: string]: CompilerOptionsValue | undefined; 7143 } 7144 interface TypeAcquisition { 7145 enable?: boolean; 7146 include?: string[]; 7147 exclude?: string[]; 7148 disableFilenameBasedTypeAcquisition?: boolean; 7149 [option: string]: CompilerOptionsValue | undefined; 7150 } 7151 enum ModuleKind { 7152 None = 0, 7153 CommonJS = 1, 7154 AMD = 2, 7155 UMD = 3, 7156 System = 4, 7157 ES2015 = 5, 7158 ES2020 = 6, 7159 ES2022 = 7, 7160 ESNext = 99, 7161 Node16 = 100, 7162 Node18 = 101, 7163 Node20 = 102, 7164 NodeNext = 199, 7165 Preserve = 200, 7166 } 7167 enum JsxEmit { 7168 None = 0, 7169 Preserve = 1, 7170 React = 2, 7171 ReactNative = 3, 7172 ReactJSX = 4, 7173 ReactJSXDev = 5, 7174 } 7175 /** @deprecated */ 7176 enum ImportsNotUsedAsValues { 7177 Remove = 0, 7178 Preserve = 1, 7179 Error = 2, 7180 } 7181 enum NewLineKind { 7182 CarriageReturnLineFeed = 0, 7183 LineFeed = 1, 7184 } 7185 interface LineAndCharacter { 7186 /** 0-based. */ 7187 line: number; 7188 character: number; 7189 } 7190 enum ScriptKind { 7191 Unknown = 0, 7192 JS = 1, 7193 JSX = 2, 7194 TS = 3, 7195 TSX = 4, 7196 External = 5, 7197 JSON = 6, 7198 /** 7199 * Used on extensions that doesn't define the ScriptKind but the content defines it. 7200 * Deferred extensions are going to be included in all project contexts. 7201 */ 7202 Deferred = 7, 7203 } 7204 enum ScriptTarget { 7205 /** @deprecated */ 7206 ES3 = 0, 7207 ES5 = 1, 7208 ES2015 = 2, 7209 ES2016 = 3, 7210 ES2017 = 4, 7211 ES2018 = 5, 7212 ES2019 = 6, 7213 ES2020 = 7, 7214 ES2021 = 8, 7215 ES2022 = 9, 7216 ES2023 = 10, 7217 ES2024 = 11, 7218 ESNext = 99, 7219 JSON = 100, 7220 Latest = 99, 7221 } 7222 enum LanguageVariant { 7223 Standard = 0, 7224 JSX = 1, 7225 } 7226 /** Either a parsed command line or a parsed tsconfig.json */ 7227 interface ParsedCommandLine { 7228 options: CompilerOptions; 7229 typeAcquisition?: TypeAcquisition; 7230 fileNames: string[]; 7231 projectReferences?: readonly ProjectReference[]; 7232 watchOptions?: WatchOptions; 7233 raw?: any; 7234 errors: Diagnostic[]; 7235 wildcardDirectories?: MapLike<WatchDirectoryFlags>; 7236 compileOnSave?: boolean; 7237 } 7238 enum WatchDirectoryFlags { 7239 None = 0, 7240 Recursive = 1, 7241 } 7242 interface CreateProgramOptions { 7243 rootNames: readonly string[]; 7244 options: CompilerOptions; 7245 projectReferences?: readonly ProjectReference[]; 7246 host?: CompilerHost; 7247 oldProgram?: Program; 7248 configFileParsingDiagnostics?: readonly Diagnostic[]; 7249 } 7250 interface ModuleResolutionHost { 7251 fileExists(fileName: string): boolean; 7252 readFile(fileName: string): string | undefined; 7253 trace?(s: string): void; 7254 directoryExists?(directoryName: string): boolean; 7255 /** 7256 * Resolve a symbolic link. 7257 * @see https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options 7258 */ 7259 realpath?(path: string): string; 7260 getCurrentDirectory?(): string; 7261 getDirectories?(path: string): string[]; 7262 useCaseSensitiveFileNames?: boolean | (() => boolean) | undefined; 7263 } 7264 /** 7265 * Used by services to specify the minimum host area required to set up source files under any compilation settings 7266 */ 7267 interface MinimalResolutionCacheHost extends ModuleResolutionHost { 7268 getCompilationSettings(): CompilerOptions; 7269 getCompilerHost?(): CompilerHost | undefined; 7270 } 7271 /** 7272 * Represents the result of module resolution. 7273 * Module resolution will pick up tsx/jsx/js files even if '--jsx' and '--allowJs' are turned off. 7274 * The Program will then filter results based on these flags. 7275 * 7276 * Prefer to return a `ResolvedModuleFull` so that the file type does not have to be inferred. 7277 */ 7278 interface ResolvedModule { 7279 /** Path of the file the module was resolved to. */ 7280 resolvedFileName: string; 7281 /** True if `resolvedFileName` comes from `node_modules`. */ 7282 isExternalLibraryImport?: boolean; 7283 /** 7284 * True if the original module reference used a .ts extension to refer directly to a .ts file, 7285 * which should produce an error during checking if emit is enabled. 7286 */ 7287 resolvedUsingTsExtension?: boolean; 7288 } 7289 /** 7290 * ResolvedModule with an explicitly provided `extension` property. 7291 * Prefer this over `ResolvedModule`. 7292 * If changing this, remember to change `moduleResolutionIsEqualTo`. 7293 */ 7294 interface ResolvedModuleFull extends ResolvedModule { 7295 /** 7296 * Extension of resolvedFileName. This must match what's at the end of resolvedFileName. 7297 * This is optional for backwards-compatibility, but will be added if not provided. 7298 */ 7299 extension: string; 7300 packageId?: PackageId; 7301 } 7302 /** 7303 * Unique identifier with a package name and version. 7304 * If changing this, remember to change `packageIdIsEqual`. 7305 */ 7306 interface PackageId { 7307 /** 7308 * Name of the package. 7309 * Should not include `@types`. 7310 * If accessing a non-index file, this should include its name e.g. "foo/bar". 7311 */ 7312 name: string; 7313 /** 7314 * Name of a submodule within this package. 7315 * May be "". 7316 */ 7317 subModuleName: string; 7318 /** Version of the package, e.g. "1.2.3" */ 7319 version: string; 7320 } 7321 enum Extension { 7322 Ts = ".ts", 7323 Tsx = ".tsx", 7324 Dts = ".d.ts", 7325 Js = ".js", 7326 Jsx = ".jsx", 7327 Json = ".json", 7328 TsBuildInfo = ".tsbuildinfo", 7329 Mjs = ".mjs", 7330 Mts = ".mts", 7331 Dmts = ".d.mts", 7332 Cjs = ".cjs", 7333 Cts = ".cts", 7334 Dcts = ".d.cts", 7335 } 7336 interface ResolvedModuleWithFailedLookupLocations { 7337 readonly resolvedModule: ResolvedModuleFull | undefined; 7338 } 7339 interface ResolvedTypeReferenceDirective { 7340 primary: boolean; 7341 resolvedFileName: string | undefined; 7342 packageId?: PackageId; 7343 /** True if `resolvedFileName` comes from `node_modules`. */ 7344 isExternalLibraryImport?: boolean; 7345 } 7346 interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { 7347 readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; 7348 } 7349 interface CompilerHost extends ModuleResolutionHost { 7350 getSourceFile(fileName: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; 7351 getSourceFileByPath?(fileName: string, path: Path, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; 7352 getCancellationToken?(): CancellationToken; 7353 getDefaultLibFileName(options: CompilerOptions): string; 7354 getDefaultLibLocation?(): string; 7355 writeFile: WriteFileCallback; 7356 getCurrentDirectory(): string; 7357 getCanonicalFileName(fileName: string): string; 7358 useCaseSensitiveFileNames(): boolean; 7359 getNewLine(): string; 7360 readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[]; 7361 /** @deprecated supply resolveModuleNameLiterals instead for resolution that can handle newer resolution modes like nodenext */ 7362 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[]; 7363 /** 7364 * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it 7365 */ 7366 getModuleResolutionCache?(): ModuleResolutionCache | undefined; 7367 /** 7368 * @deprecated supply resolveTypeReferenceDirectiveReferences instead for resolution that can handle newer resolution modes like nodenext 7369 * 7370 * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files 7371 */ 7372 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode): (ResolvedTypeReferenceDirective | undefined)[]; 7373 resolveModuleNameLiterals?(moduleLiterals: readonly StringLiteralLike[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile, reusedNames: readonly StringLiteralLike[] | undefined): readonly ResolvedModuleWithFailedLookupLocations[]; 7374 resolveTypeReferenceDirectiveReferences?<T extends FileReference | string>(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile | undefined, reusedNames: readonly T[] | undefined): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; 7375 getEnvironmentVariable?(name: string): string | undefined; 7376 /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */ 7377 hasInvalidatedResolutions?(filePath: Path): boolean; 7378 createHash?(data: string): string; 7379 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 7380 jsDocParsingMode?: JSDocParsingMode; 7381 } 7382 interface SourceMapRange extends TextRange { 7383 source?: SourceMapSource; 7384 } 7385 interface SourceMapSource { 7386 fileName: string; 7387 text: string; 7388 skipTrivia?: (pos: number) => number; 7389 } 7390 interface SourceMapSource { 7391 getLineAndCharacterOfPosition(pos: number): LineAndCharacter; 7392 } 7393 enum EmitFlags { 7394 None = 0, 7395 SingleLine = 1, 7396 MultiLine = 2, 7397 AdviseOnEmitNode = 4, 7398 NoSubstitution = 8, 7399 CapturesThis = 16, 7400 NoLeadingSourceMap = 32, 7401 NoTrailingSourceMap = 64, 7402 NoSourceMap = 96, 7403 NoNestedSourceMaps = 128, 7404 NoTokenLeadingSourceMaps = 256, 7405 NoTokenTrailingSourceMaps = 512, 7406 NoTokenSourceMaps = 768, 7407 NoLeadingComments = 1024, 7408 NoTrailingComments = 2048, 7409 NoComments = 3072, 7410 NoNestedComments = 4096, 7411 HelperName = 8192, 7412 ExportName = 16384, 7413 LocalName = 32768, 7414 InternalName = 65536, 7415 Indented = 131072, 7416 NoIndentation = 262144, 7417 AsyncFunctionBody = 524288, 7418 ReuseTempVariableScope = 1048576, 7419 CustomPrologue = 2097152, 7420 NoHoisting = 4194304, 7421 Iterator = 8388608, 7422 NoAsciiEscaping = 16777216, 7423 } 7424 interface EmitHelperBase { 7425 readonly name: string; 7426 readonly scoped: boolean; 7427 readonly text: string | ((node: EmitHelperUniqueNameCallback) => string); 7428 readonly priority?: number; 7429 readonly dependencies?: EmitHelper[]; 7430 } 7431 interface ScopedEmitHelper extends EmitHelperBase { 7432 readonly scoped: true; 7433 } 7434 interface UnscopedEmitHelper extends EmitHelperBase { 7435 readonly scoped: false; 7436 readonly text: string; 7437 } 7438 type EmitHelper = ScopedEmitHelper | UnscopedEmitHelper; 7439 type EmitHelperUniqueNameCallback = (name: string) => string; 7440 enum EmitHint { 7441 SourceFile = 0, 7442 Expression = 1, 7443 IdentifierName = 2, 7444 MappedTypeParameter = 3, 7445 Unspecified = 4, 7446 EmbeddedStatement = 5, 7447 JsxAttributeValue = 6, 7448 ImportTypeNodeAttributes = 7, 7449 } 7450 enum OuterExpressionKinds { 7451 Parentheses = 1, 7452 TypeAssertions = 2, 7453 NonNullAssertions = 4, 7454 PartiallyEmittedExpressions = 8, 7455 ExpressionsWithTypeArguments = 16, 7456 Satisfies = 32, 7457 Assertions = 38, 7458 All = 63, 7459 ExcludeJSDocTypeAssertion = -2147483648, 7460 } 7461 type ImmediatelyInvokedFunctionExpression = CallExpression & { 7462 readonly expression: FunctionExpression; 7463 }; 7464 type ImmediatelyInvokedArrowFunction = CallExpression & { 7465 readonly expression: ParenthesizedExpression & { 7466 readonly expression: ArrowFunction; 7467 }; 7468 }; 7469 interface NodeFactory { 7470 createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>; 7471 createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral; 7472 createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral; 7473 createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral; 7474 createStringLiteralFromNode(sourceNode: PropertyNameLiteral | PrivateIdentifier, isSingleQuote?: boolean): StringLiteral; 7475 createRegularExpressionLiteral(text: string): RegularExpressionLiteral; 7476 createIdentifier(text: string): Identifier; 7477 /** 7478 * Create a unique temporary variable. 7479 * @param recordTempVariable An optional callback used to record the temporary variable name. This 7480 * should usually be a reference to `hoistVariableDeclaration` from a `TransformationContext`, but 7481 * can be `undefined` if you plan to record the temporary variable manually. 7482 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes 7483 * during emit so that the variable can be referenced in a nested function body. This is an alternative to 7484 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself. 7485 */ 7486 createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, reservedInNestedScopes?: boolean): Identifier; 7487 /** 7488 * Create a unique temporary variable for use in a loop. 7489 * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes 7490 * during emit so that the variable can be referenced in a nested function body. This is an alternative to 7491 * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself. 7492 */ 7493 createLoopVariable(reservedInNestedScopes?: boolean): Identifier; 7494 /** Create a unique name based on the supplied text. */ 7495 createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier; 7496 /** Create a unique name generated for a node. */ 7497 getGeneratedNameForNode(node: Node | undefined, flags?: GeneratedIdentifierFlags): Identifier; 7498 createPrivateIdentifier(text: string): PrivateIdentifier; 7499 createUniquePrivateName(text?: string): PrivateIdentifier; 7500 getGeneratedPrivateNameForNode(node: Node): PrivateIdentifier; 7501 createToken(token: SyntaxKind.SuperKeyword): SuperExpression; 7502 createToken(token: SyntaxKind.ThisKeyword): ThisExpression; 7503 createToken(token: SyntaxKind.NullKeyword): NullLiteral; 7504 createToken(token: SyntaxKind.TrueKeyword): TrueLiteral; 7505 createToken(token: SyntaxKind.FalseKeyword): FalseLiteral; 7506 createToken(token: SyntaxKind.EndOfFileToken): EndOfFileToken; 7507 createToken(token: SyntaxKind.Unknown): Token<SyntaxKind.Unknown>; 7508 createToken<TKind extends PunctuationSyntaxKind>(token: TKind): PunctuationToken<TKind>; 7509 createToken<TKind extends KeywordTypeSyntaxKind>(token: TKind): KeywordTypeNode<TKind>; 7510 createToken<TKind extends ModifierSyntaxKind>(token: TKind): ModifierToken<TKind>; 7511 createToken<TKind extends KeywordSyntaxKind>(token: TKind): KeywordToken<TKind>; 7512 createSuper(): SuperExpression; 7513 createThis(): ThisExpression; 7514 createNull(): NullLiteral; 7515 createTrue(): TrueLiteral; 7516 createFalse(): FalseLiteral; 7517 createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>; 7518 createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined; 7519 createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName; 7520 updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName; 7521 createComputedPropertyName(expression: Expression): ComputedPropertyName; 7522 updateComputedPropertyName(node: ComputedPropertyName, expression: Expression): ComputedPropertyName; 7523 createTypeParameterDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode): TypeParameterDeclaration; 7524 updateTypeParameterDeclaration(node: TypeParameterDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, constraint: TypeNode | undefined, defaultType: TypeNode | undefined): TypeParameterDeclaration; 7525 createParameterDeclaration(modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression): ParameterDeclaration; 7526 updateParameterDeclaration(node: ParameterDeclaration, modifiers: readonly ModifierLike[] | undefined, dotDotDotToken: DotDotDotToken | undefined, name: string | BindingName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): ParameterDeclaration; 7527 createDecorator(expression: Expression): Decorator; 7528 updateDecorator(node: Decorator, expression: Expression): Decorator; 7529 createPropertySignature(modifiers: readonly Modifier[] | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature; 7530 updatePropertySignature(node: PropertySignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined): PropertySignature; 7531 createPropertyDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; 7532 updatePropertyDeclaration(node: PropertyDeclaration, modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; 7533 createMethodSignature(modifiers: readonly Modifier[] | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): MethodSignature; 7534 updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature; 7535 createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; 7536 updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; 7537 createConstructorDeclaration(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; 7538 updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration; 7539 createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; 7540 updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration; 7541 createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; 7542 updateSetAccessorDeclaration(node: SetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration; 7543 createCallSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): CallSignatureDeclaration; 7544 updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration; 7545 createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration; 7546 updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration; 7547 createIndexSignature(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; 7548 updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; 7549 createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; 7550 updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; 7551 createClassStaticBlockDeclaration(body: Block): ClassStaticBlockDeclaration; 7552 updateClassStaticBlockDeclaration(node: ClassStaticBlockDeclaration, body: Block): ClassStaticBlockDeclaration; 7553 createKeywordTypeNode<TKind extends KeywordTypeSyntaxKind>(kind: TKind): KeywordTypeNode<TKind>; 7554 createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; 7555 updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; 7556 createTypeReferenceNode(typeName: string | EntityName, typeArguments?: readonly TypeNode[]): TypeReferenceNode; 7557 updateTypeReferenceNode(node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray<TypeNode> | undefined): TypeReferenceNode; 7558 createFunctionTypeNode(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): FunctionTypeNode; 7559 updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): FunctionTypeNode; 7560 createConstructorTypeNode(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): ConstructorTypeNode; 7561 updateConstructorTypeNode(node: ConstructorTypeNode, modifiers: readonly Modifier[] | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode): ConstructorTypeNode; 7562 createTypeQueryNode(exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode; 7563 updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName, typeArguments?: readonly TypeNode[]): TypeQueryNode; 7564 createTypeLiteralNode(members: readonly TypeElement[] | undefined): TypeLiteralNode; 7565 updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray<TypeElement>): TypeLiteralNode; 7566 createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; 7567 updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; 7568 createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; 7569 updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; 7570 createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember; 7571 updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember; 7572 createOptionalTypeNode(type: TypeNode): OptionalTypeNode; 7573 updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode; 7574 createRestTypeNode(type: TypeNode): RestTypeNode; 7575 updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode; 7576 createUnionTypeNode(types: readonly TypeNode[]): UnionTypeNode; 7577 updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode; 7578 createIntersectionTypeNode(types: readonly TypeNode[]): IntersectionTypeNode; 7579 updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray<TypeNode>): IntersectionTypeNode; 7580 createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; 7581 updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; 7582 createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; 7583 updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; 7584 createImportTypeNode(argument: TypeNode, attributes?: ImportAttributes, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; 7585 updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, attributes: ImportAttributes | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; 7586 createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; 7587 updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; 7588 createThisTypeNode(): ThisTypeNode; 7589 createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; 7590 updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; 7591 createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; 7592 updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; 7593 createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode; 7594 updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined, members: NodeArray<TypeElement> | undefined): MappedTypeNode; 7595 createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; 7596 updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; 7597 createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; 7598 updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; 7599 createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern; 7600 updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern; 7601 createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern; 7602 updateArrayBindingPattern(node: ArrayBindingPattern, elements: readonly ArrayBindingElement[]): ArrayBindingPattern; 7603 createBindingElement(dotDotDotToken: DotDotDotToken | undefined, propertyName: string | PropertyName | undefined, name: string | BindingName, initializer?: Expression): BindingElement; 7604 updateBindingElement(node: BindingElement, dotDotDotToken: DotDotDotToken | undefined, propertyName: PropertyName | undefined, name: BindingName, initializer: Expression | undefined): BindingElement; 7605 createArrayLiteralExpression(elements?: readonly Expression[], multiLine?: boolean): ArrayLiteralExpression; 7606 updateArrayLiteralExpression(node: ArrayLiteralExpression, elements: readonly Expression[]): ArrayLiteralExpression; 7607 createObjectLiteralExpression(properties?: readonly ObjectLiteralElementLike[], multiLine?: boolean): ObjectLiteralExpression; 7608 updateObjectLiteralExpression(node: ObjectLiteralExpression, properties: readonly ObjectLiteralElementLike[]): ObjectLiteralExpression; 7609 createPropertyAccessExpression(expression: Expression, name: string | MemberName): PropertyAccessExpression; 7610 updatePropertyAccessExpression(node: PropertyAccessExpression, expression: Expression, name: MemberName): PropertyAccessExpression; 7611 createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | MemberName): PropertyAccessChain; 7612 updatePropertyAccessChain(node: PropertyAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, name: MemberName): PropertyAccessChain; 7613 createElementAccessExpression(expression: Expression, index: number | Expression): ElementAccessExpression; 7614 updateElementAccessExpression(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; 7615 createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression): ElementAccessChain; 7616 updateElementAccessChain(node: ElementAccessChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, argumentExpression: Expression): ElementAccessChain; 7617 createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallExpression; 7618 updateCallExpression(node: CallExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallExpression; 7619 createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): CallChain; 7620 updateCallChain(node: CallChain, expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[]): CallChain; 7621 createNewExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression; 7622 updateNewExpression(node: NewExpression, expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined): NewExpression; 7623 createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 7624 updateTaggedTemplateExpression(node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 7625 createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; 7626 updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; 7627 createParenthesizedExpression(expression: Expression): ParenthesizedExpression; 7628 updateParenthesizedExpression(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression; 7629 createFunctionExpression(modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[] | undefined, type: TypeNode | undefined, body: Block): FunctionExpression; 7630 updateFunctionExpression(node: FunctionExpression, modifiers: readonly Modifier[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block): FunctionExpression; 7631 createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; 7632 updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; 7633 createDeleteExpression(expression: Expression): DeleteExpression; 7634 updateDeleteExpression(node: DeleteExpression, expression: Expression): DeleteExpression; 7635 createTypeOfExpression(expression: Expression): TypeOfExpression; 7636 updateTypeOfExpression(node: TypeOfExpression, expression: Expression): TypeOfExpression; 7637 createVoidExpression(expression: Expression): VoidExpression; 7638 updateVoidExpression(node: VoidExpression, expression: Expression): VoidExpression; 7639 createAwaitExpression(expression: Expression): AwaitExpression; 7640 updateAwaitExpression(node: AwaitExpression, expression: Expression): AwaitExpression; 7641 createPrefixUnaryExpression(operator: PrefixUnaryOperator, operand: Expression): PrefixUnaryExpression; 7642 updatePrefixUnaryExpression(node: PrefixUnaryExpression, operand: Expression): PrefixUnaryExpression; 7643 createPostfixUnaryExpression(operand: Expression, operator: PostfixUnaryOperator): PostfixUnaryExpression; 7644 updatePostfixUnaryExpression(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; 7645 createBinaryExpression(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; 7646 updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; 7647 createConditionalExpression(condition: Expression, questionToken: QuestionToken | undefined, whenTrue: Expression, colonToken: ColonToken | undefined, whenFalse: Expression): ConditionalExpression; 7648 updateConditionalExpression(node: ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; 7649 createTemplateExpression(head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression; 7650 updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: readonly TemplateSpan[]): TemplateExpression; 7651 createTemplateHead(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateHead; 7652 createTemplateHead(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateHead; 7653 createTemplateMiddle(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateMiddle; 7654 createTemplateMiddle(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateMiddle; 7655 createTemplateTail(text: string, rawText?: string, templateFlags?: TokenFlags): TemplateTail; 7656 createTemplateTail(text: string | undefined, rawText: string, templateFlags?: TokenFlags): TemplateTail; 7657 createNoSubstitutionTemplateLiteral(text: string, rawText?: string): NoSubstitutionTemplateLiteral; 7658 createNoSubstitutionTemplateLiteral(text: string | undefined, rawText: string): NoSubstitutionTemplateLiteral; 7659 createYieldExpression(asteriskToken: AsteriskToken, expression: Expression): YieldExpression; 7660 createYieldExpression(asteriskToken: undefined, expression: Expression | undefined): YieldExpression; 7661 updateYieldExpression(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression | undefined): YieldExpression; 7662 createSpreadElement(expression: Expression): SpreadElement; 7663 updateSpreadElement(node: SpreadElement, expression: Expression): SpreadElement; 7664 createClassExpression(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; 7665 updateClassExpression(node: ClassExpression, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassExpression; 7666 createOmittedExpression(): OmittedExpression; 7667 createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments; 7668 updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, expression: Expression, typeArguments: readonly TypeNode[] | undefined): ExpressionWithTypeArguments; 7669 createAsExpression(expression: Expression, type: TypeNode): AsExpression; 7670 updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression; 7671 createNonNullExpression(expression: Expression): NonNullExpression; 7672 updateNonNullExpression(node: NonNullExpression, expression: Expression): NonNullExpression; 7673 createNonNullChain(expression: Expression): NonNullChain; 7674 updateNonNullChain(node: NonNullChain, expression: Expression): NonNullChain; 7675 createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty; 7676 updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty; 7677 createSatisfiesExpression(expression: Expression, type: TypeNode): SatisfiesExpression; 7678 updateSatisfiesExpression(node: SatisfiesExpression, expression: Expression, type: TypeNode): SatisfiesExpression; 7679 createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; 7680 updateTemplateSpan(node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan; 7681 createSemicolonClassElement(): SemicolonClassElement; 7682 createBlock(statements: readonly Statement[], multiLine?: boolean): Block; 7683 updateBlock(node: Block, statements: readonly Statement[]): Block; 7684 createVariableStatement(modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement; 7685 updateVariableStatement(node: VariableStatement, modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList): VariableStatement; 7686 createEmptyStatement(): EmptyStatement; 7687 createExpressionStatement(expression: Expression): ExpressionStatement; 7688 updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement; 7689 createIfStatement(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement; 7690 updateIfStatement(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement; 7691 createDoStatement(statement: Statement, expression: Expression): DoStatement; 7692 updateDoStatement(node: DoStatement, statement: Statement, expression: Expression): DoStatement; 7693 createWhileStatement(expression: Expression, statement: Statement): WhileStatement; 7694 updateWhileStatement(node: WhileStatement, expression: Expression, statement: Statement): WhileStatement; 7695 createForStatement(initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; 7696 updateForStatement(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement; 7697 createForInStatement(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; 7698 updateForInStatement(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement; 7699 createForOfStatement(awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; 7700 updateForOfStatement(node: ForOfStatement, awaitModifier: AwaitKeyword | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement; 7701 createContinueStatement(label?: string | Identifier): ContinueStatement; 7702 updateContinueStatement(node: ContinueStatement, label: Identifier | undefined): ContinueStatement; 7703 createBreakStatement(label?: string | Identifier): BreakStatement; 7704 updateBreakStatement(node: BreakStatement, label: Identifier | undefined): BreakStatement; 7705 createReturnStatement(expression?: Expression): ReturnStatement; 7706 updateReturnStatement(node: ReturnStatement, expression: Expression | undefined): ReturnStatement; 7707 createWithStatement(expression: Expression, statement: Statement): WithStatement; 7708 updateWithStatement(node: WithStatement, expression: Expression, statement: Statement): WithStatement; 7709 createSwitchStatement(expression: Expression, caseBlock: CaseBlock): SwitchStatement; 7710 updateSwitchStatement(node: SwitchStatement, expression: Expression, caseBlock: CaseBlock): SwitchStatement; 7711 createLabeledStatement(label: string | Identifier, statement: Statement): LabeledStatement; 7712 updateLabeledStatement(node: LabeledStatement, label: Identifier, statement: Statement): LabeledStatement; 7713 createThrowStatement(expression: Expression): ThrowStatement; 7714 updateThrowStatement(node: ThrowStatement, expression: Expression): ThrowStatement; 7715 createTryStatement(tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; 7716 updateTryStatement(node: TryStatement, tryBlock: Block, catchClause: CatchClause | undefined, finallyBlock: Block | undefined): TryStatement; 7717 createDebuggerStatement(): DebuggerStatement; 7718 createVariableDeclaration(name: string | BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression): VariableDeclaration; 7719 updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 7720 createVariableDeclarationList(declarations: readonly VariableDeclaration[], flags?: NodeFlags): VariableDeclarationList; 7721 updateVariableDeclarationList(node: VariableDeclarationList, declarations: readonly VariableDeclaration[]): VariableDeclarationList; 7722 createFunctionDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; 7723 updateFunctionDeclaration(node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration; 7724 createClassDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; 7725 updateClassDeclaration(node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration; 7726 createInterfaceDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; 7727 updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration; 7728 createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; 7729 updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration; 7730 createEnumDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration; 7731 updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration; 7732 createModuleDeclaration(modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration; 7733 updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration; 7734 createModuleBlock(statements: readonly Statement[]): ModuleBlock; 7735 updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock; 7736 createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock; 7737 updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock; 7738 createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration; 7739 updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; 7740 createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; 7741 updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; 7742 createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes): ImportDeclaration; 7743 updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined): ImportDeclaration; 7744 createImportClause(phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 7745 /** @deprecated */ createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 7746 updateImportClause(node: ImportClause, phaseModifier: ImportPhaseModifierSyntaxKind | undefined, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 7747 /** @deprecated */ updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; 7748 /** @deprecated */ createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause; 7749 /** @deprecated */ updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause; 7750 /** @deprecated */ createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; 7751 /** @deprecated */ updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry; 7752 /** @deprecated */ createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; 7753 /** @deprecated */ updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; 7754 createImportAttributes(elements: NodeArray<ImportAttribute>, multiLine?: boolean): ImportAttributes; 7755 updateImportAttributes(node: ImportAttributes, elements: NodeArray<ImportAttribute>, multiLine?: boolean): ImportAttributes; 7756 createImportAttribute(name: ImportAttributeName, value: Expression): ImportAttribute; 7757 updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute; 7758 createNamespaceImport(name: Identifier): NamespaceImport; 7759 updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; 7760 createNamespaceExport(name: ModuleExportName): NamespaceExport; 7761 updateNamespaceExport(node: NamespaceExport, name: ModuleExportName): NamespaceExport; 7762 createNamedImports(elements: readonly ImportSpecifier[]): NamedImports; 7763 updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports; 7764 createImportSpecifier(isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier; 7765 updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier; 7766 createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; 7767 updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment; 7768 createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, attributes?: ImportAttributes): ExportDeclaration; 7769 updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, attributes: ImportAttributes | undefined): ExportDeclaration; 7770 createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; 7771 updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; 7772 createExportSpecifier(isTypeOnly: boolean, propertyName: string | ModuleExportName | undefined, name: string | ModuleExportName): ExportSpecifier; 7773 updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: ModuleExportName): ExportSpecifier; 7774 createExternalModuleReference(expression: Expression): ExternalModuleReference; 7775 updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference; 7776 createJSDocAllType(): JSDocAllType; 7777 createJSDocUnknownType(): JSDocUnknownType; 7778 createJSDocNonNullableType(type: TypeNode, postfix?: boolean): JSDocNonNullableType; 7779 updateJSDocNonNullableType(node: JSDocNonNullableType, type: TypeNode): JSDocNonNullableType; 7780 createJSDocNullableType(type: TypeNode, postfix?: boolean): JSDocNullableType; 7781 updateJSDocNullableType(node: JSDocNullableType, type: TypeNode): JSDocNullableType; 7782 createJSDocOptionalType(type: TypeNode): JSDocOptionalType; 7783 updateJSDocOptionalType(node: JSDocOptionalType, type: TypeNode): JSDocOptionalType; 7784 createJSDocFunctionType(parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType; 7785 updateJSDocFunctionType(node: JSDocFunctionType, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): JSDocFunctionType; 7786 createJSDocVariadicType(type: TypeNode): JSDocVariadicType; 7787 updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType; 7788 createJSDocNamepathType(type: TypeNode): JSDocNamepathType; 7789 updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType; 7790 createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression; 7791 updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression; 7792 createJSDocNameReference(name: EntityName | JSDocMemberName): JSDocNameReference; 7793 updateJSDocNameReference(node: JSDocNameReference, name: EntityName | JSDocMemberName): JSDocNameReference; 7794 createJSDocMemberName(left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName; 7795 updateJSDocMemberName(node: JSDocMemberName, left: EntityName | JSDocMemberName, right: Identifier): JSDocMemberName; 7796 createJSDocLink(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink; 7797 updateJSDocLink(node: JSDocLink, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLink; 7798 createJSDocLinkCode(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode; 7799 updateJSDocLinkCode(node: JSDocLinkCode, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkCode; 7800 createJSDocLinkPlain(name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain; 7801 updateJSDocLinkPlain(node: JSDocLinkPlain, name: EntityName | JSDocMemberName | undefined, text: string): JSDocLinkPlain; 7802 createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral; 7803 updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral; 7804 createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature; 7805 updateJSDocSignature(node: JSDocSignature, typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type: JSDocReturnTag | undefined): JSDocSignature; 7806 createJSDocTemplateTag(tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment?: string | NodeArray<JSDocComment>): JSDocTemplateTag; 7807 updateJSDocTemplateTag(node: JSDocTemplateTag, tagName: Identifier | undefined, constraint: JSDocTypeExpression | undefined, typeParameters: readonly TypeParameterDeclaration[], comment: string | NodeArray<JSDocComment> | undefined): JSDocTemplateTag; 7808 createJSDocTypedefTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocTypedefTag; 7809 updateJSDocTypedefTag(node: JSDocTypedefTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | JSDocTypeLiteral | undefined, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypedefTag; 7810 createJSDocParameterTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocParameterTag; 7811 updateJSDocParameterTag(node: JSDocParameterTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocParameterTag; 7812 createJSDocPropertyTag(tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, isNameFirst?: boolean, comment?: string | NodeArray<JSDocComment>): JSDocPropertyTag; 7813 updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | NodeArray<JSDocComment> | undefined): JSDocPropertyTag; 7814 createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocTypeTag; 7815 updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocTypeTag; 7816 createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag; 7817 updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string | NodeArray<JSDocComment>): JSDocSeeTag; 7818 createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocReturnTag; 7819 updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReturnTag; 7820 createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocThisTag; 7821 updateJSDocThisTag(node: JSDocThisTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocThisTag; 7822 createJSDocEnumTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocEnumTag; 7823 updateJSDocEnumTag(node: JSDocEnumTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocEnumTag; 7824 createJSDocCallbackTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName?: Identifier | JSDocNamespaceDeclaration, comment?: string | NodeArray<JSDocComment>): JSDocCallbackTag; 7825 updateJSDocCallbackTag(node: JSDocCallbackTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, fullName: Identifier | JSDocNamespaceDeclaration | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocCallbackTag; 7826 createJSDocOverloadTag(tagName: Identifier | undefined, typeExpression: JSDocSignature, comment?: string | NodeArray<JSDocComment>): JSDocOverloadTag; 7827 updateJSDocOverloadTag(node: JSDocOverloadTag, tagName: Identifier | undefined, typeExpression: JSDocSignature, comment: string | NodeArray<JSDocComment> | undefined): JSDocOverloadTag; 7828 createJSDocAugmentsTag(tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocAugmentsTag; 7829 updateJSDocAugmentsTag(node: JSDocAugmentsTag, tagName: Identifier | undefined, className: JSDocAugmentsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocAugmentsTag; 7830 createJSDocImplementsTag(tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment?: string | NodeArray<JSDocComment>): JSDocImplementsTag; 7831 updateJSDocImplementsTag(node: JSDocImplementsTag, tagName: Identifier | undefined, className: JSDocImplementsTag["class"], comment: string | NodeArray<JSDocComment> | undefined): JSDocImplementsTag; 7832 createJSDocAuthorTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocAuthorTag; 7833 updateJSDocAuthorTag(node: JSDocAuthorTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocAuthorTag; 7834 createJSDocClassTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocClassTag; 7835 updateJSDocClassTag(node: JSDocClassTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocClassTag; 7836 createJSDocPublicTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPublicTag; 7837 updateJSDocPublicTag(node: JSDocPublicTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPublicTag; 7838 createJSDocPrivateTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocPrivateTag; 7839 updateJSDocPrivateTag(node: JSDocPrivateTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocPrivateTag; 7840 createJSDocProtectedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocProtectedTag; 7841 updateJSDocProtectedTag(node: JSDocProtectedTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocProtectedTag; 7842 createJSDocReadonlyTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocReadonlyTag; 7843 updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag; 7844 createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag; 7845 updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag; 7846 createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag; 7847 updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag; 7848 createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag; 7849 updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag; 7850 createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment>): JSDocThrowsTag; 7851 updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined): JSDocThrowsTag; 7852 createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocSatisfiesTag; 7853 updateJSDocSatisfiesTag(node: JSDocSatisfiesTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocSatisfiesTag; 7854 createJSDocImportTag(tagName: Identifier | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes, comment?: string | NodeArray<JSDocComment>): JSDocImportTag; 7855 updateJSDocImportTag(node: JSDocImportTag, tagName: Identifier | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocImportTag; 7856 createJSDocText(text: string): JSDocText; 7857 updateJSDocText(node: JSDocText, text: string): JSDocText; 7858 createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc; 7859 updateJSDocComment(node: JSDoc, comment: string | NodeArray<JSDocComment> | undefined, tags: readonly JSDocTag[] | undefined): JSDoc; 7860 createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement; 7861 updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement; 7862 createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement; 7863 updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxSelfClosingElement; 7864 createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement; 7865 updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: readonly TypeNode[] | undefined, attributes: JsxAttributes): JsxOpeningElement; 7866 createJsxClosingElement(tagName: JsxTagNameExpression): JsxClosingElement; 7867 updateJsxClosingElement(node: JsxClosingElement, tagName: JsxTagNameExpression): JsxClosingElement; 7868 createJsxFragment(openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; 7869 createJsxText(text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText; 7870 updateJsxText(node: JsxText, text: string, containsOnlyTriviaWhiteSpaces?: boolean): JsxText; 7871 createJsxOpeningFragment(): JsxOpeningFragment; 7872 createJsxJsxClosingFragment(): JsxClosingFragment; 7873 updateJsxFragment(node: JsxFragment, openingFragment: JsxOpeningFragment, children: readonly JsxChild[], closingFragment: JsxClosingFragment): JsxFragment; 7874 createJsxAttribute(name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; 7875 updateJsxAttribute(node: JsxAttribute, name: JsxAttributeName, initializer: JsxAttributeValue | undefined): JsxAttribute; 7876 createJsxAttributes(properties: readonly JsxAttributeLike[]): JsxAttributes; 7877 updateJsxAttributes(node: JsxAttributes, properties: readonly JsxAttributeLike[]): JsxAttributes; 7878 createJsxSpreadAttribute(expression: Expression): JsxSpreadAttribute; 7879 updateJsxSpreadAttribute(node: JsxSpreadAttribute, expression: Expression): JsxSpreadAttribute; 7880 createJsxExpression(dotDotDotToken: DotDotDotToken | undefined, expression: Expression | undefined): JsxExpression; 7881 updateJsxExpression(node: JsxExpression, expression: Expression | undefined): JsxExpression; 7882 createJsxNamespacedName(namespace: Identifier, name: Identifier): JsxNamespacedName; 7883 updateJsxNamespacedName(node: JsxNamespacedName, namespace: Identifier, name: Identifier): JsxNamespacedName; 7884 createCaseClause(expression: Expression, statements: readonly Statement[]): CaseClause; 7885 updateCaseClause(node: CaseClause, expression: Expression, statements: readonly Statement[]): CaseClause; 7886 createDefaultClause(statements: readonly Statement[]): DefaultClause; 7887 updateDefaultClause(node: DefaultClause, statements: readonly Statement[]): DefaultClause; 7888 createHeritageClause(token: HeritageClause["token"], types: readonly ExpressionWithTypeArguments[]): HeritageClause; 7889 updateHeritageClause(node: HeritageClause, types: readonly ExpressionWithTypeArguments[]): HeritageClause; 7890 createCatchClause(variableDeclaration: string | BindingName | VariableDeclaration | undefined, block: Block): CatchClause; 7891 updateCatchClause(node: CatchClause, variableDeclaration: VariableDeclaration | undefined, block: Block): CatchClause; 7892 createPropertyAssignment(name: string | PropertyName, initializer: Expression): PropertyAssignment; 7893 updatePropertyAssignment(node: PropertyAssignment, name: PropertyName, initializer: Expression): PropertyAssignment; 7894 createShorthandPropertyAssignment(name: string | Identifier, objectAssignmentInitializer?: Expression): ShorthandPropertyAssignment; 7895 updateShorthandPropertyAssignment(node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | undefined): ShorthandPropertyAssignment; 7896 createSpreadAssignment(expression: Expression): SpreadAssignment; 7897 updateSpreadAssignment(node: SpreadAssignment, expression: Expression): SpreadAssignment; 7898 createEnumMember(name: string | PropertyName, initializer?: Expression): EnumMember; 7899 updateEnumMember(node: EnumMember, name: PropertyName, initializer: Expression | undefined): EnumMember; 7900 createSourceFile(statements: readonly Statement[], endOfFileToken: EndOfFileToken, flags: NodeFlags): SourceFile; 7901 updateSourceFile(node: SourceFile, statements: readonly Statement[], isDeclarationFile?: boolean, referencedFiles?: readonly FileReference[], typeReferences?: readonly FileReference[], hasNoDefaultLib?: boolean, libReferences?: readonly FileReference[]): SourceFile; 7902 createNotEmittedStatement(original: Node): NotEmittedStatement; 7903 createNotEmittedTypeElement(): NotEmittedTypeElement; 7904 createPartiallyEmittedExpression(expression: Expression, original?: Node): PartiallyEmittedExpression; 7905 updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; 7906 createCommaListExpression(elements: readonly Expression[]): CommaListExpression; 7907 updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; 7908 createBundle(sourceFiles: readonly SourceFile[]): Bundle; 7909 updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; 7910 createComma(left: Expression, right: Expression): BinaryExpression; 7911 createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; 7912 createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>; 7913 createLogicalOr(left: Expression, right: Expression): BinaryExpression; 7914 createLogicalAnd(left: Expression, right: Expression): BinaryExpression; 7915 createBitwiseOr(left: Expression, right: Expression): BinaryExpression; 7916 createBitwiseXor(left: Expression, right: Expression): BinaryExpression; 7917 createBitwiseAnd(left: Expression, right: Expression): BinaryExpression; 7918 createStrictEquality(left: Expression, right: Expression): BinaryExpression; 7919 createStrictInequality(left: Expression, right: Expression): BinaryExpression; 7920 createEquality(left: Expression, right: Expression): BinaryExpression; 7921 createInequality(left: Expression, right: Expression): BinaryExpression; 7922 createLessThan(left: Expression, right: Expression): BinaryExpression; 7923 createLessThanEquals(left: Expression, right: Expression): BinaryExpression; 7924 createGreaterThan(left: Expression, right: Expression): BinaryExpression; 7925 createGreaterThanEquals(left: Expression, right: Expression): BinaryExpression; 7926 createLeftShift(left: Expression, right: Expression): BinaryExpression; 7927 createRightShift(left: Expression, right: Expression): BinaryExpression; 7928 createUnsignedRightShift(left: Expression, right: Expression): BinaryExpression; 7929 createAdd(left: Expression, right: Expression): BinaryExpression; 7930 createSubtract(left: Expression, right: Expression): BinaryExpression; 7931 createMultiply(left: Expression, right: Expression): BinaryExpression; 7932 createDivide(left: Expression, right: Expression): BinaryExpression; 7933 createModulo(left: Expression, right: Expression): BinaryExpression; 7934 createExponent(left: Expression, right: Expression): BinaryExpression; 7935 createPrefixPlus(operand: Expression): PrefixUnaryExpression; 7936 createPrefixMinus(operand: Expression): PrefixUnaryExpression; 7937 createPrefixIncrement(operand: Expression): PrefixUnaryExpression; 7938 createPrefixDecrement(operand: Expression): PrefixUnaryExpression; 7939 createBitwiseNot(operand: Expression): PrefixUnaryExpression; 7940 createLogicalNot(operand: Expression): PrefixUnaryExpression; 7941 createPostfixIncrement(operand: Expression): PostfixUnaryExpression; 7942 createPostfixDecrement(operand: Expression): PostfixUnaryExpression; 7943 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[]): CallExpression; 7944 createImmediatelyInvokedFunctionExpression(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): CallExpression; 7945 createImmediatelyInvokedArrowFunction(statements: readonly Statement[]): ImmediatelyInvokedArrowFunction; 7946 createImmediatelyInvokedArrowFunction(statements: readonly Statement[], param: ParameterDeclaration, paramValue: Expression): ImmediatelyInvokedArrowFunction; 7947 createVoidZero(): VoidExpression; 7948 createExportDefault(expression: Expression): ExportAssignment; 7949 createExternalModuleExport(exportName: Identifier): ExportDeclaration; 7950 restoreOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression; 7951 /** 7952 * Updates a node that may contain modifiers, replacing only the modifiers of the node. 7953 */ 7954 replaceModifiers<T extends HasModifiers>(node: T, modifiers: readonly Modifier[] | ModifierFlags | undefined): T; 7955 /** 7956 * Updates a node that may contain decorators or modifiers, replacing only the decorators and modifiers of the node. 7957 */ 7958 replaceDecoratorsAndModifiers<T extends HasModifiers & HasDecorators>(node: T, modifiers: readonly ModifierLike[] | undefined): T; 7959 /** 7960 * Updates a node that contains a property name, replacing only the name of the node. 7961 */ 7962 replacePropertyName<T extends AccessorDeclaration | MethodDeclaration | MethodSignature | PropertyDeclaration | PropertySignature | PropertyAssignment>(node: T, name: T["name"]): T; 7963 } 7964 interface CoreTransformationContext { 7965 readonly factory: NodeFactory; 7966 /** Gets the compiler options supplied to the transformer. */ 7967 getCompilerOptions(): CompilerOptions; 7968 /** Starts a new lexical environment. */ 7969 startLexicalEnvironment(): void; 7970 /** Suspends the current lexical environment, usually after visiting a parameter list. */ 7971 suspendLexicalEnvironment(): void; 7972 /** Resumes a suspended lexical environment, usually before visiting a function body. */ 7973 resumeLexicalEnvironment(): void; 7974 /** Ends a lexical environment, returning any declarations. */ 7975 endLexicalEnvironment(): Statement[] | undefined; 7976 /** Hoists a function declaration to the containing scope. */ 7977 hoistFunctionDeclaration(node: FunctionDeclaration): void; 7978 /** Hoists a variable declaration to the containing scope. */ 7979 hoistVariableDeclaration(node: Identifier): void; 7980 } 7981 interface TransformationContext extends CoreTransformationContext { 7982 /** Records a request for a non-scoped emit helper in the current context. */ 7983 requestEmitHelper(helper: EmitHelper): void; 7984 /** Gets and resets the requested non-scoped emit helpers. */ 7985 readEmitHelpers(): EmitHelper[] | undefined; 7986 /** Enables expression substitutions in the pretty printer for the provided SyntaxKind. */ 7987 enableSubstitution(kind: SyntaxKind): void; 7988 /** Determines whether expression substitutions are enabled for the provided node. */ 7989 isSubstitutionEnabled(node: Node): boolean; 7990 /** 7991 * Hook used by transformers to substitute expressions just before they 7992 * are emitted by the pretty printer. 7993 * 7994 * NOTE: Transformation hooks should only be modified during `Transformer` initialization, 7995 * before returning the `NodeTransformer` callback. 7996 */ 7997 onSubstituteNode: (hint: EmitHint, node: Node) => Node; 7998 /** 7999 * Enables before/after emit notifications in the pretty printer for the provided 8000 * SyntaxKind. 8001 */ 8002 enableEmitNotification(kind: SyntaxKind): void; 8003 /** 8004 * Determines whether before/after emit notifications should be raised in the pretty 8005 * printer when it emits a node. 8006 */ 8007 isEmitNotificationEnabled(node: Node): boolean; 8008 /** 8009 * Hook used to allow transformers to capture state before or after 8010 * the printer emits a node. 8011 * 8012 * NOTE: Transformation hooks should only be modified during `Transformer` initialization, 8013 * before returning the `NodeTransformer` callback. 8014 */ 8015 onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; 8016 } 8017 interface TransformationResult<T extends Node> { 8018 /** Gets the transformed source files. */ 8019 transformed: T[]; 8020 /** Gets diagnostics for the transformation. */ 8021 diagnostics?: DiagnosticWithLocation[]; 8022 /** 8023 * Gets a substitute for a node, if one is available; otherwise, returns the original node. 8024 * 8025 * @param hint A hint as to the intended usage of the node. 8026 * @param node The node to substitute. 8027 */ 8028 substituteNode(hint: EmitHint, node: Node): Node; 8029 /** 8030 * Emits a node with possible notification. 8031 * 8032 * @param hint A hint as to the intended usage of the node. 8033 * @param node The node to emit. 8034 * @param emitCallback A callback used to emit the node. 8035 */ 8036 emitNodeWithNotification(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; 8037 /** 8038 * Indicates if a given node needs an emit notification 8039 * 8040 * @param node The node to emit. 8041 */ 8042 isEmitNotificationEnabled?(node: Node): boolean; 8043 /** 8044 * Clean up EmitNode entries on any parse-tree nodes. 8045 */ 8046 dispose(): void; 8047 } 8048 /** 8049 * A function that is used to initialize and return a `Transformer` callback, which in turn 8050 * will be used to transform one or more nodes. 8051 */ 8052 type TransformerFactory<T extends Node> = (context: TransformationContext) => Transformer<T>; 8053 /** 8054 * A function that transforms a node. 8055 */ 8056 type Transformer<T extends Node> = (node: T) => T; 8057 /** 8058 * A function that accepts and possibly transforms a node. 8059 */ 8060 type Visitor<TIn extends Node = Node, TOut extends Node | undefined = TIn | undefined> = (node: TIn) => VisitResult<TOut>; 8061 /** 8062 * A function that walks a node using the given visitor, lifting node arrays into single nodes, 8063 * returning an node which satisfies the test. 8064 * 8065 * - If the input node is undefined, then the output is undefined. 8066 * - If the visitor returns undefined, then the output is undefined. 8067 * - If the output node is not undefined, then it will satisfy the test function. 8068 * - In order to obtain a return type that is more specific than `Node`, a test 8069 * function _must_ be provided, and that function must be a type predicate. 8070 * 8071 * For the canonical implementation of this type, @see {visitNode}. 8072 */ 8073 interface NodeVisitor { 8074 <TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); 8075 <TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); 8076 } 8077 /** 8078 * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test. 8079 * 8080 * - If the input node array is undefined, the output is undefined. 8081 * - If the visitor can return undefined, the node it visits in the array will be reused. 8082 * - If the output node array is not undefined, then its contents will satisfy the test. 8083 * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test 8084 * function _must_ be provided, and that function must be a type predicate. 8085 * 8086 * For the canonical implementation of this type, @see {visitNodes}. 8087 */ 8088 interface NodesVisitor { 8089 <TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined); 8090 <TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined); 8091 } 8092 type VisitResult<T extends Node | undefined> = T | readonly Node[]; 8093 interface Printer { 8094 /** 8095 * Print a node and its subtree as-is, without any emit transformations. 8096 * @param hint A value indicating the purpose of a node. This is primarily used to 8097 * distinguish between an `Identifier` used in an expression position, versus an 8098 * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you 8099 * should just pass `Unspecified`. 8100 * @param node The node to print. The node and its subtree are printed as-is, without any 8101 * emit transformations. 8102 * @param sourceFile A source file that provides context for the node. The source text of 8103 * the file is used to emit the original source content for literals and identifiers, while 8104 * the identifiers of the source file are used when generating unique names to avoid 8105 * collisions. 8106 */ 8107 printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; 8108 /** 8109 * Prints a list of nodes using the given format flags 8110 */ 8111 printList<T extends Node>(format: ListFormat, list: NodeArray<T>, sourceFile: SourceFile): string; 8112 /** 8113 * Prints a source file as-is, without any emit transformations. 8114 */ 8115 printFile(sourceFile: SourceFile): string; 8116 /** 8117 * Prints a bundle of source files as-is, without any emit transformations. 8118 */ 8119 printBundle(bundle: Bundle): string; 8120 } 8121 interface PrintHandlers { 8122 /** 8123 * A hook used by the Printer when generating unique names to avoid collisions with 8124 * globally defined names that exist outside of the current source file. 8125 */ 8126 hasGlobalName?(name: string): boolean; 8127 /** 8128 * A hook used by the Printer to provide notifications prior to emitting a node. A 8129 * compatible implementation **must** invoke `emitCallback` with the provided `hint` and 8130 * `node` values. 8131 * @param hint A hint indicating the intended purpose of the node. 8132 * @param node The node to emit. 8133 * @param emitCallback A callback that, when invoked, will emit the node. 8134 * @example 8135 * ```ts 8136 * var printer = createPrinter(printerOptions, { 8137 * onEmitNode(hint, node, emitCallback) { 8138 * // set up or track state prior to emitting the node... 8139 * emitCallback(hint, node); 8140 * // restore state after emitting the node... 8141 * } 8142 * }); 8143 * ``` 8144 */ 8145 onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; 8146 /** 8147 * A hook used to check if an emit notification is required for a node. 8148 * @param node The node to emit. 8149 */ 8150 isEmitNotificationEnabled?(node: Node): boolean; 8151 /** 8152 * A hook used by the Printer to perform just-in-time substitution of a node. This is 8153 * primarily used by node transformations that need to substitute one node for another, 8154 * such as replacing `myExportedVar` with `exports.myExportedVar`. 8155 * @param hint A hint indicating the intended purpose of the node. 8156 * @param node The node to emit. 8157 * @example 8158 * ```ts 8159 * var printer = createPrinter(printerOptions, { 8160 * substituteNode(hint, node) { 8161 * // perform substitution if necessary... 8162 * return node; 8163 * } 8164 * }); 8165 * ``` 8166 */ 8167 substituteNode?(hint: EmitHint, node: Node): Node; 8168 } 8169 interface PrinterOptions { 8170 removeComments?: boolean; 8171 newLine?: NewLineKind; 8172 omitTrailingSemicolon?: boolean; 8173 noEmitHelpers?: boolean; 8174 } 8175 interface GetEffectiveTypeRootsHost { 8176 getCurrentDirectory?(): string; 8177 } 8178 interface TextSpan { 8179 start: number; 8180 length: number; 8181 } 8182 interface TextChangeRange { 8183 span: TextSpan; 8184 newLength: number; 8185 } 8186 interface SyntaxList extends Node { 8187 kind: SyntaxKind.SyntaxList; 8188 } 8189 enum ListFormat { 8190 None = 0, 8191 SingleLine = 0, 8192 MultiLine = 1, 8193 PreserveLines = 2, 8194 LinesMask = 3, 8195 NotDelimited = 0, 8196 BarDelimited = 4, 8197 AmpersandDelimited = 8, 8198 CommaDelimited = 16, 8199 AsteriskDelimited = 32, 8200 DelimitersMask = 60, 8201 AllowTrailingComma = 64, 8202 Indented = 128, 8203 SpaceBetweenBraces = 256, 8204 SpaceBetweenSiblings = 512, 8205 Braces = 1024, 8206 Parenthesis = 2048, 8207 AngleBrackets = 4096, 8208 SquareBrackets = 8192, 8209 BracketsMask = 15360, 8210 OptionalIfUndefined = 16384, 8211 OptionalIfEmpty = 32768, 8212 Optional = 49152, 8213 PreferNewLine = 65536, 8214 NoTrailingNewLine = 131072, 8215 NoInterveningComments = 262144, 8216 NoSpaceIfEmpty = 524288, 8217 SingleElement = 1048576, 8218 SpaceAfterList = 2097152, 8219 Modifiers = 2359808, 8220 HeritageClauses = 512, 8221 SingleLineTypeLiteralMembers = 768, 8222 MultiLineTypeLiteralMembers = 32897, 8223 SingleLineTupleTypeElements = 528, 8224 MultiLineTupleTypeElements = 657, 8225 UnionTypeConstituents = 516, 8226 IntersectionTypeConstituents = 520, 8227 ObjectBindingPatternElements = 525136, 8228 ArrayBindingPatternElements = 524880, 8229 ObjectLiteralExpressionProperties = 526226, 8230 ImportAttributes = 526226, 8231 /** @deprecated */ ImportClauseEntries = 526226, 8232 ArrayLiteralExpressionElements = 8914, 8233 CommaListElements = 528, 8234 CallExpressionArguments = 2576, 8235 NewExpressionArguments = 18960, 8236 TemplateExpressionSpans = 262144, 8237 SingleLineBlockStatements = 768, 8238 MultiLineBlockStatements = 129, 8239 VariableDeclarationList = 528, 8240 SingleLineFunctionBodyStatements = 768, 8241 MultiLineFunctionBodyStatements = 1, 8242 ClassHeritageClauses = 0, 8243 ClassMembers = 129, 8244 InterfaceMembers = 129, 8245 EnumMembers = 145, 8246 CaseBlockClauses = 129, 8247 NamedImportsOrExportsElements = 525136, 8248 JsxElementOrFragmentChildren = 262144, 8249 JsxElementAttributes = 262656, 8250 CaseOrDefaultClauseStatements = 163969, 8251 HeritageClauseTypes = 528, 8252 SourceFileStatements = 131073, 8253 Decorators = 2146305, 8254 TypeArguments = 53776, 8255 TypeParameters = 53776, 8256 Parameters = 2576, 8257 IndexSignatureParameters = 8848, 8258 JSDocComment = 33, 8259 } 8260 enum JSDocParsingMode { 8261 /** 8262 * Always parse JSDoc comments and include them in the AST. 8263 * 8264 * This is the default if no mode is provided. 8265 */ 8266 ParseAll = 0, 8267 /** 8268 * Never parse JSDoc comments, mo matter the file type. 8269 */ 8270 ParseNone = 1, 8271 /** 8272 * Parse only JSDoc comments which are needed to provide correct type errors. 8273 * 8274 * This will always parse JSDoc in non-TS files, but only parse JSDoc comments 8275 * containing `@see` and `@link` in TS files. 8276 */ 8277 ParseForTypeErrors = 2, 8278 /** 8279 * Parse only JSDoc comments which are needed to provide correct type info. 8280 * 8281 * This will always parse JSDoc in non-TS files, but never in TS files. 8282 * 8283 * Note: Do not use this mode if you require accurate type errors; use {@link ParseForTypeErrors} instead. 8284 */ 8285 ParseForTypeInfo = 3, 8286 } 8287 interface UserPreferences { 8288 readonly disableSuggestions?: boolean; 8289 readonly quotePreference?: "auto" | "double" | "single"; 8290 /** 8291 * If enabled, TypeScript will search through all external modules' exports and add them to the completions list. 8292 * This affects lone identifier completions but not completions on the right hand side of `obj.`. 8293 */ 8294 readonly includeCompletionsForModuleExports?: boolean; 8295 /** 8296 * Enables auto-import-style completions on partially-typed import statements. E.g., allows 8297 * `import write|` to be completed to `import { writeFile } from "fs"`. 8298 */ 8299 readonly includeCompletionsForImportStatements?: boolean; 8300 /** 8301 * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`. 8302 */ 8303 readonly includeCompletionsWithSnippetText?: boolean; 8304 /** 8305 * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled, 8306 * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined 8307 * values, with insertion text to replace preceding `.` tokens with `?.`. 8308 */ 8309 readonly includeAutomaticOptionalChainCompletions?: boolean; 8310 /** 8311 * If enabled, the completion list will include completions with invalid identifier names. 8312 * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. 8313 */ 8314 readonly includeCompletionsWithInsertText?: boolean; 8315 /** 8316 * If enabled, completions for class members (e.g. methods and properties) will include 8317 * a whole declaration for the member. 8318 * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of 8319 * `class A { foo }`. 8320 */ 8321 readonly includeCompletionsWithClassMemberSnippets?: boolean; 8322 /** 8323 * If enabled, object literal methods will have a method declaration completion entry in addition 8324 * to the regular completion entry containing just the method name. 8325 * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`, 8326 * in addition to `const objectLiteral: T = { foo }`. 8327 */ 8328 readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean; 8329 /** 8330 * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported. 8331 * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property. 8332 */ 8333 readonly useLabelDetailsInCompletionEntries?: boolean; 8334 readonly allowIncompleteCompletions?: boolean; 8335 readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative"; 8336 /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */ 8337 readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js"; 8338 readonly allowTextChangesInNewFiles?: boolean; 8339 readonly providePrefixAndSuffixTextForRename?: boolean; 8340 readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; 8341 readonly provideRefactorNotApplicableReason?: boolean; 8342 readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none"; 8343 readonly includeInlayParameterNameHints?: "none" | "literals" | "all"; 8344 readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean; 8345 readonly includeInlayFunctionParameterTypeHints?: boolean; 8346 readonly includeInlayVariableTypeHints?: boolean; 8347 readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean; 8348 readonly includeInlayPropertyDeclarationTypeHints?: boolean; 8349 readonly includeInlayFunctionLikeReturnTypeHints?: boolean; 8350 readonly includeInlayEnumMemberValueHints?: boolean; 8351 readonly interactiveInlayHints?: boolean; 8352 readonly allowRenameOfImportPath?: boolean; 8353 readonly autoImportFileExcludePatterns?: string[]; 8354 readonly autoImportSpecifierExcludeRegexes?: string[]; 8355 readonly preferTypeOnlyAutoImports?: boolean; 8356 /** 8357 * Indicates whether imports should be organized in a case-insensitive manner. 8358 */ 8359 readonly organizeImportsIgnoreCase?: "auto" | boolean; 8360 /** 8361 * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value 8362 * of their code points, or via "unicode" collation (via the 8363 * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale 8364 * specified in {@link organizeImportsCollationLocale}. 8365 * 8366 * Default: `"ordinal"`. 8367 */ 8368 readonly organizeImportsCollation?: "ordinal" | "unicode"; 8369 /** 8370 * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant 8371 * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale. 8372 * 8373 * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. 8374 * 8375 * Default: `"en"` 8376 */ 8377 readonly organizeImportsLocale?: string; 8378 /** 8379 * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate 8380 * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`. 8381 * 8382 * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. 8383 * 8384 * Default: `false` 8385 */ 8386 readonly organizeImportsNumericCollation?: boolean; 8387 /** 8388 * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When 8389 * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified 8390 * in {@link organizeImportsCollationLocale}. 8391 * 8392 * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. 8393 * 8394 * Default: `true` 8395 */ 8396 readonly organizeImportsAccentCollation?: boolean; 8397 /** 8398 * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale 8399 * specified in {@link organizeImportsCollationLocale} is used. 8400 * 8401 * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also 8402 * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`, 8403 * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be 8404 * case-insensitive. 8405 * 8406 * Default: `false` 8407 */ 8408 readonly organizeImportsCaseFirst?: "upper" | "lower" | false; 8409 /** 8410 * Indicates where named type-only imports should sort. "inline" sorts named imports without regard to if the import is 8411 * type-only. 8412 * 8413 * Default: `last` 8414 */ 8415 readonly organizeImportsTypeOrder?: OrganizeImportsTypeOrder; 8416 /** 8417 * Indicates whether to exclude standard library and node_modules file symbols from navTo results. 8418 */ 8419 readonly excludeLibrarySymbolsInNavTo?: boolean; 8420 readonly lazyConfiguredProjectsFromExternalProject?: boolean; 8421 readonly displayPartsForJSDoc?: boolean; 8422 readonly generateReturnInDocTemplate?: boolean; 8423 readonly disableLineTextInReferences?: boolean; 8424 /** 8425 * A positive integer indicating the maximum length of a hover text before it is truncated. 8426 * 8427 * Default: `500` 8428 */ 8429 readonly maximumHoverLength?: number; 8430 } 8431 type OrganizeImportsTypeOrder = "last" | "inline" | "first"; 8432 /** Represents a bigint literal value without requiring bigint support */ 8433 interface PseudoBigInt { 8434 negative: boolean; 8435 base10Value: string; 8436 } 8437 enum FileWatcherEventKind { 8438 Created = 0, 8439 Changed = 1, 8440 Deleted = 2, 8441 } 8442 type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void; 8443 type DirectoryWatcherCallback = (fileName: string) => void; 8444 type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; 8445 interface System { 8446 args: string[]; 8447 newLine: string; 8448 useCaseSensitiveFileNames: boolean; 8449 write(s: string): void; 8450 writeOutputIsTTY?(): boolean; 8451 getWidthOfTerminal?(): number; 8452 readFile(path: string, encoding?: string): string | undefined; 8453 getFileSize?(path: string): number; 8454 writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; 8455 /** 8456 * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that 8457 * use native OS file watching 8458 */ 8459 watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher; 8460 watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher; 8461 resolvePath(path: string): string; 8462 fileExists(path: string): boolean; 8463 directoryExists(path: string): boolean; 8464 createDirectory(path: string): void; 8465 getExecutingFilePath(): string; 8466 getCurrentDirectory(): string; 8467 getDirectories(path: string): string[]; 8468 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 8469 getModifiedTime?(path: string): Date | undefined; 8470 setModifiedTime?(path: string, time: Date): void; 8471 deleteFile?(path: string): void; 8472 /** 8473 * A good implementation is node.js' `crypto.createHash`. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm) 8474 */ 8475 createHash?(data: string): string; 8476 /** This must be cryptographically secure. Only implement this method using `crypto.createHash("sha256")`. */ 8477 createSHA256Hash?(data: string): string; 8478 getMemoryUsage?(): number; 8479 exit(exitCode?: number): void; 8480 realpath?(path: string): string; 8481 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 8482 clearTimeout?(timeoutId: any): void; 8483 clearScreen?(): void; 8484 base64decode?(input: string): string; 8485 base64encode?(input: string): string; 8486 } 8487 interface FileWatcher { 8488 close(): void; 8489 } 8490 let sys: System; 8491 function tokenToString(t: SyntaxKind): string | undefined; 8492 function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number; 8493 function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter; 8494 function isWhiteSpaceLike(ch: number): boolean; 8495 /** Does not include line breaks. For that, see isWhiteSpaceLike. */ 8496 function isWhiteSpaceSingleLine(ch: number): boolean; 8497 function isLineBreak(ch: number): boolean; 8498 function couldStartTrivia(text: string, pos: number): boolean; 8499 function forEachLeadingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; 8500 function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; 8501 function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; 8502 function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; 8503 function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; 8504 function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined; 8505 function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; 8506 function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined; 8507 /** Optionally, get the shebang */ 8508 function getShebang(text: string): string | undefined; 8509 function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; 8510 function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean; 8511 function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; 8512 type ErrorCallback = (message: DiagnosticMessage, length: number, arg0?: any) => void; 8513 interface Scanner { 8514 /** @deprecated use {@link getTokenFullStart} */ 8515 getStartPos(): number; 8516 getToken(): SyntaxKind; 8517 getTokenFullStart(): number; 8518 getTokenStart(): number; 8519 getTokenEnd(): number; 8520 /** @deprecated use {@link getTokenEnd} */ 8521 getTextPos(): number; 8522 /** @deprecated use {@link getTokenStart} */ 8523 getTokenPos(): number; 8524 getTokenText(): string; 8525 getTokenValue(): string; 8526 hasUnicodeEscape(): boolean; 8527 hasExtendedUnicodeEscape(): boolean; 8528 hasPrecedingLineBreak(): boolean; 8529 isIdentifier(): boolean; 8530 isReservedWord(): boolean; 8531 isUnterminated(): boolean; 8532 reScanGreaterToken(): SyntaxKind; 8533 reScanSlashToken(): SyntaxKind; 8534 reScanAsteriskEqualsToken(): SyntaxKind; 8535 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; 8536 /** @deprecated use {@link reScanTemplateToken}(false) */ 8537 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; 8538 scanJsxIdentifier(): SyntaxKind; 8539 scanJsxAttributeValue(): SyntaxKind; 8540 reScanJsxAttributeValue(): SyntaxKind; 8541 reScanJsxToken(allowMultilineJsxText?: boolean): JsxTokenSyntaxKind; 8542 reScanLessThanToken(): SyntaxKind; 8543 reScanHashToken(): SyntaxKind; 8544 reScanQuestionToken(): SyntaxKind; 8545 reScanInvalidIdentifier(): SyntaxKind; 8546 scanJsxToken(): JsxTokenSyntaxKind; 8547 scanJsDocToken(): JSDocSyntaxKind; 8548 scan(): SyntaxKind; 8549 getText(): string; 8550 setText(text: string | undefined, start?: number, length?: number): void; 8551 setOnError(onError: ErrorCallback | undefined): void; 8552 setScriptTarget(scriptTarget: ScriptTarget): void; 8553 setLanguageVariant(variant: LanguageVariant): void; 8554 setScriptKind(scriptKind: ScriptKind): void; 8555 setJSDocParsingMode(kind: JSDocParsingMode): void; 8556 /** @deprecated use {@link resetTokenState} */ 8557 setTextPos(textPos: number): void; 8558 resetTokenState(pos: number): void; 8559 lookAhead<T>(callback: () => T): T; 8560 scanRange<T>(start: number, length: number, callback: () => T): T; 8561 tryScan<T>(callback: () => T): T; 8562 } 8563 function isExternalModuleNameRelative(moduleName: string): boolean; 8564 function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>; 8565 function getDefaultLibFileName(options: CompilerOptions): string; 8566 function textSpanEnd(span: TextSpan): number; 8567 function textSpanIsEmpty(span: TextSpan): boolean; 8568 function textSpanContainsPosition(span: TextSpan, position: number): boolean; 8569 function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; 8570 function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; 8571 function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined; 8572 function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; 8573 function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; 8574 function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean; 8575 function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; 8576 function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined; 8577 function createTextSpan(start: number, length: number): TextSpan; 8578 function createTextSpanFromBounds(start: number, end: number): TextSpan; 8579 function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; 8580 function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; 8581 function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; 8582 /** 8583 * Called to merge all the changes that occurred across several versions of a script snapshot 8584 * into a single change. i.e. if a user keeps making successive edits to a script we will 8585 * have a text change from V1 to V2, V2 to V3, ..., Vn. 8586 * 8587 * This function will then merge those changes into a single change range valid between V1 and 8588 * Vn. 8589 */ 8590 function collapseTextChangeRangesAcrossMultipleVersions(changes: readonly TextChangeRange[]): TextChangeRange; 8591 function getTypeParameterOwner(d: Declaration): Declaration | undefined; 8592 function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration; 8593 function isEmptyBindingPattern(node: BindingName): node is BindingPattern; 8594 function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean; 8595 function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration; 8596 function getCombinedModifierFlags(node: Declaration): ModifierFlags; 8597 function getCombinedNodeFlags(node: Node): NodeFlags; 8598 /** 8599 * Checks to see if the locale is in the appropriate format, 8600 * and if it is, attempts to set the appropriate language. 8601 */ 8602 function validateLocaleAndSetLanguage(locale: string, sys: { 8603 getExecutingFilePath(): string; 8604 resolvePath(path: string): string; 8605 fileExists(fileName: string): boolean; 8606 readFile(fileName: string): string | undefined; 8607 }, errors?: Diagnostic[]): void; 8608 function getOriginalNode(node: Node): Node; 8609 function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T; 8610 function getOriginalNode(node: Node | undefined): Node | undefined; 8611 function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined; 8612 /** 8613 * Iterates through the parent chain of a node and performs the callback on each parent until the callback 8614 * returns a truthy value, then returns that value. 8615 * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" 8616 * At that point findAncestor returns undefined. 8617 */ 8618 function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; 8619 function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; 8620 /** 8621 * Gets a value indicating whether a node originated in the parse tree. 8622 * 8623 * @param node The node to test. 8624 */ 8625 function isParseTreeNode(node: Node): boolean; 8626 /** 8627 * Gets the original parse tree node for a node. 8628 * 8629 * @param node The original node. 8630 * @returns The original parse tree node if found; otherwise, undefined. 8631 */ 8632 function getParseTreeNode(node: Node | undefined): Node | undefined; 8633 /** 8634 * Gets the original parse tree node for a node. 8635 * 8636 * @param node The original node. 8637 * @param nodeTest A callback used to ensure the correct type of parse tree node is returned. 8638 * @returns The original parse tree node if found; otherwise, undefined. 8639 */ 8640 function getParseTreeNode<T extends Node>(node: T | undefined, nodeTest?: (node: Node) => node is T): T | undefined; 8641 /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */ 8642 function escapeLeadingUnderscores(identifier: string): __String; 8643 /** 8644 * Remove extra underscore from escaped identifier text content. 8645 * 8646 * @param identifier The escaped identifier text. 8647 * @returns The unescaped identifier text. 8648 */ 8649 function unescapeLeadingUnderscores(identifier: __String): string; 8650 function idText(identifierOrPrivateName: Identifier | PrivateIdentifier): string; 8651 /** 8652 * If the text of an Identifier matches a keyword (including contextual and TypeScript-specific keywords), returns the 8653 * SyntaxKind for the matching keyword. 8654 */ 8655 function identifierToKeywordKind(node: Identifier): KeywordSyntaxKind | undefined; 8656 function symbolName(symbol: Symbol): string; 8657 function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; 8658 function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; 8659 function getDecorators(node: HasDecorators): readonly Decorator[] | undefined; 8660 function getModifiers(node: HasModifiers): readonly Modifier[] | undefined; 8661 /** 8662 * Gets the JSDoc parameter tags for the node if present. 8663 * 8664 * @remarks Returns any JSDoc param tag whose name matches the provided 8665 * parameter, whether a param tag on a containing function 8666 * expression, or a param tag on a variable declaration whose 8667 * initializer is the containing function. The tags closest to the 8668 * node are returned first, so in the previous example, the param 8669 * tag on the containing function expression would be first. 8670 * 8671 * For binding patterns, parameter tags are matched by position. 8672 */ 8673 function getJSDocParameterTags(param: ParameterDeclaration): readonly JSDocParameterTag[]; 8674 /** 8675 * Gets the JSDoc type parameter tags for the node if present. 8676 * 8677 * @remarks Returns any JSDoc template tag whose names match the provided 8678 * parameter, whether a template tag on a containing function 8679 * expression, or a template tag on a variable declaration whose 8680 * initializer is the containing function. The tags closest to the 8681 * node are returned first, so in the previous example, the template 8682 * tag on the containing function expression would be first. 8683 */ 8684 function getJSDocTypeParameterTags(param: TypeParameterDeclaration): readonly JSDocTemplateTag[]; 8685 /** 8686 * Return true if the node has JSDoc parameter tags. 8687 * 8688 * @remarks Includes parameter tags that are not directly on the node, 8689 * for example on a variable declaration whose initializer is a function expression. 8690 */ 8691 function hasJSDocParameterTags(node: FunctionLikeDeclaration | SignatureDeclaration): boolean; 8692 /** Gets the JSDoc augments tag for the node if present */ 8693 function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined; 8694 /** Gets the JSDoc implements tags for the node if present */ 8695 function getJSDocImplementsTags(node: Node): readonly JSDocImplementsTag[]; 8696 /** Gets the JSDoc class tag for the node if present */ 8697 function getJSDocClassTag(node: Node): JSDocClassTag | undefined; 8698 /** Gets the JSDoc public tag for the node if present */ 8699 function getJSDocPublicTag(node: Node): JSDocPublicTag | undefined; 8700 /** Gets the JSDoc private tag for the node if present */ 8701 function getJSDocPrivateTag(node: Node): JSDocPrivateTag | undefined; 8702 /** Gets the JSDoc protected tag for the node if present */ 8703 function getJSDocProtectedTag(node: Node): JSDocProtectedTag | undefined; 8704 /** Gets the JSDoc protected tag for the node if present */ 8705 function getJSDocReadonlyTag(node: Node): JSDocReadonlyTag | undefined; 8706 function getJSDocOverrideTagNoCache(node: Node): JSDocOverrideTag | undefined; 8707 /** Gets the JSDoc deprecated tag for the node if present */ 8708 function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined; 8709 /** Gets the JSDoc enum tag for the node if present */ 8710 function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined; 8711 /** Gets the JSDoc this tag for the node if present */ 8712 function getJSDocThisTag(node: Node): JSDocThisTag | undefined; 8713 /** Gets the JSDoc return tag for the node if present */ 8714 function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined; 8715 /** Gets the JSDoc template tag for the node if present */ 8716 function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined; 8717 function getJSDocSatisfiesTag(node: Node): JSDocSatisfiesTag | undefined; 8718 /** Gets the JSDoc type tag for the node if present and valid */ 8719 function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined; 8720 /** 8721 * Gets the type node for the node if provided via JSDoc. 8722 * 8723 * @remarks The search includes any JSDoc param tag that relates 8724 * to the provided parameter, for example a type tag on the 8725 * parameter itself, or a param tag on a containing function 8726 * expression, or a param tag on a variable declaration whose 8727 * initializer is the containing function. The tags closest to the 8728 * node are examined first, so in the previous example, the type 8729 * tag directly on the node would be returned. 8730 */ 8731 function getJSDocType(node: Node): TypeNode | undefined; 8732 /** 8733 * Gets the return type node for the node if provided via JSDoc return tag or type tag. 8734 * 8735 * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function 8736 * gets the type from inside the braces, after the fat arrow, etc. 8737 */ 8738 function getJSDocReturnType(node: Node): TypeNode | undefined; 8739 /** Get all JSDoc tags related to a node, including those on parent nodes. */ 8740 function getJSDocTags(node: Node): readonly JSDocTag[]; 8741 /** Gets all JSDoc tags that match a specified predicate */ 8742 function getAllJSDocTags<T extends JSDocTag>(node: Node, predicate: (tag: JSDocTag) => tag is T): readonly T[]; 8743 /** Gets all JSDoc tags of a specified kind */ 8744 function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): readonly JSDocTag[]; 8745 /** Gets the text of a jsdoc comment, flattening links to their text. */ 8746 function getTextOfJSDocComment(comment?: string | NodeArray<JSDocComment>): string | undefined; 8747 /** 8748 * Gets the effective type parameters. If the node was parsed in a 8749 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. 8750 * 8751 * This does *not* return type parameters from a jsdoc reference to a generic type, eg 8752 * 8753 * type Id = <T>(x: T) => T 8754 * /** @type {Id} / 8755 * function id(x) { return x } 8756 */ 8757 function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[]; 8758 function getEffectiveConstraintOfTypeParameter(node: TypeParameterDeclaration): TypeNode | undefined; 8759 function isMemberName(node: Node): node is MemberName; 8760 function isPropertyAccessChain(node: Node): node is PropertyAccessChain; 8761 function isElementAccessChain(node: Node): node is ElementAccessChain; 8762 function isCallChain(node: Node): node is CallChain; 8763 function isOptionalChain(node: Node): node is PropertyAccessChain | ElementAccessChain | CallChain | NonNullChain; 8764 function isNullishCoalesce(node: Node): boolean; 8765 function isConstTypeReference(node: Node): boolean; 8766 function skipPartiallyEmittedExpressions(node: Expression): Expression; 8767 function skipPartiallyEmittedExpressions(node: Node): Node; 8768 function isNonNullChain(node: Node): node is NonNullChain; 8769 function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; 8770 function isNamedExportBindings(node: Node): node is NamedExportBindings; 8771 function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; 8772 /** 8773 * True if kind is of some token syntax kind. 8774 * For example, this is true for an IfKeyword but not for an IfStatement. 8775 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. 8776 */ 8777 function isTokenKind(kind: SyntaxKind): boolean; 8778 /** 8779 * True if node is of some token syntax kind. 8780 * For example, this is true for an IfKeyword but not for an IfStatement. 8781 * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. 8782 */ 8783 function isToken(n: Node): boolean; 8784 function isLiteralExpression(node: Node): node is LiteralExpression; 8785 function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; 8786 function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; 8787 function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; 8788 function isTypeOnlyImportDeclaration(node: Node): node is TypeOnlyImportDeclaration; 8789 function isTypeOnlyExportDeclaration(node: Node): node is TypeOnlyExportDeclaration; 8790 function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration; 8791 function isPartOfTypeOnlyImportOrExportDeclaration(node: Node): boolean; 8792 function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; 8793 function isImportAttributeName(node: Node): node is ImportAttributeName; 8794 function isModifier(node: Node): node is Modifier; 8795 function isEntityName(node: Node): node is EntityName; 8796 function isPropertyName(node: Node): node is PropertyName; 8797 function isBindingName(node: Node): node is BindingName; 8798 function isFunctionLike(node: Node | undefined): node is SignatureDeclaration; 8799 function isClassElement(node: Node): node is ClassElement; 8800 function isClassLike(node: Node): node is ClassLikeDeclaration; 8801 function isAccessor(node: Node): node is AccessorDeclaration; 8802 function isAutoAccessorPropertyDeclaration(node: Node): node is AutoAccessorPropertyDeclaration; 8803 function isModifierLike(node: Node): node is ModifierLike; 8804 function isTypeElement(node: Node): node is TypeElement; 8805 function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement; 8806 function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike; 8807 /** 8808 * Node test that determines whether a node is a valid type node. 8809 * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* 8810 * of a TypeNode. 8811 */ 8812 function isTypeNode(node: Node): node is TypeNode; 8813 function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode; 8814 function isArrayBindingElement(node: Node): node is ArrayBindingElement; 8815 function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName; 8816 function isCallLikeExpression(node: Node): node is CallLikeExpression; 8817 function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; 8818 function isTemplateLiteral(node: Node): node is TemplateLiteral; 8819 function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression; 8820 function isLiteralTypeLiteral(node: Node): node is NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; 8821 /** 8822 * Determines whether a node is an expression based only on its kind. 8823 */ 8824 function isExpression(node: Node): node is Expression; 8825 function isAssertionExpression(node: Node): node is AssertionExpression; 8826 function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; 8827 function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; 8828 function isConciseBody(node: Node): node is ConciseBody; 8829 function isForInitializer(node: Node): node is ForInitializer; 8830 function isModuleBody(node: Node): node is ModuleBody; 8831 function isNamedImportBindings(node: Node): node is NamedImportBindings; 8832 function isDeclarationStatement(node: Node): node is DeclarationStatement; 8833 function isStatement(node: Node): node is Statement; 8834 function isModuleReference(node: Node): node is ModuleReference; 8835 function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression; 8836 function isJsxChild(node: Node): node is JsxChild; 8837 function isJsxAttributeLike(node: Node): node is JsxAttributeLike; 8838 function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression; 8839 function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; 8840 function isJsxCallLike(node: Node): node is JsxCallLike; 8841 function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; 8842 /** True if node is of a kind that may contain comment text. */ 8843 function isJSDocCommentContainingNode(node: Node): boolean; 8844 function isSetAccessor(node: Node): node is SetAccessorDeclaration; 8845 function isGetAccessor(node: Node): node is GetAccessorDeclaration; 8846 /** True if has initializer node attached to it. */ 8847 function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer; 8848 function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; 8849 function isStringLiteralLike(node: Node | FileReference): node is StringLiteralLike; 8850 function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain; 8851 function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean; 8852 function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean; 8853 function isInternalDeclaration(node: Node, sourceFile?: SourceFile): boolean; 8854 const unchangedTextChangeRange: TextChangeRange; 8855 type ParameterPropertyDeclaration = ParameterDeclaration & { 8856 parent: ConstructorDeclaration; 8857 name: Identifier; 8858 }; 8859 function isPartOfTypeNode(node: Node): boolean; 8860 /** 8861 * This function checks multiple locations for JSDoc comments that apply to a host node. 8862 * At each location, the whole comment may apply to the node, or only a specific tag in 8863 * the comment. In the first case, location adds the entire {@link JSDoc} object. In the 8864 * second case, it adds the applicable {@link JSDocTag}. 8865 * 8866 * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a 8867 * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`. 8868 * 8869 * ```ts 8870 * /** JSDoc will be returned for `a` *\/ 8871 * const a = 0 8872 * /** 8873 * * Entire JSDoc will be returned for `b` 8874 * * @param c JSDocTag will be returned for `c` 8875 * *\/ 8876 * function b(/** JSDoc will be returned for `c` *\/ c) {} 8877 * ``` 8878 */ 8879 function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[]; 8880 /** 8881 * Create an external source map source file reference 8882 */ 8883 function createSourceMapSource(fileName: string, text: string, skipTrivia?: (pos: number) => number): SourceMapSource; 8884 function setOriginalNode<T extends Node>(node: T, original: Node | undefined): T; 8885 const factory: NodeFactory; 8886 /** 8887 * Clears any `EmitNode` entries from parse-tree nodes. 8888 * @param sourceFile A source file. 8889 */ 8890 function disposeEmitNodes(sourceFile: SourceFile | undefined): void; 8891 /** 8892 * Sets flags that control emit behavior of a node. 8893 */ 8894 function setEmitFlags<T extends Node>(node: T, emitFlags: EmitFlags): T; 8895 /** 8896 * Gets a custom text range to use when emitting source maps. 8897 */ 8898 function getSourceMapRange(node: Node): SourceMapRange; 8899 /** 8900 * Sets a custom text range to use when emitting source maps. 8901 */ 8902 function setSourceMapRange<T extends Node>(node: T, range: SourceMapRange | undefined): T; 8903 /** 8904 * Gets the TextRange to use for source maps for a token of a node. 8905 */ 8906 function getTokenSourceMapRange(node: Node, token: SyntaxKind): SourceMapRange | undefined; 8907 /** 8908 * Sets the TextRange to use for source maps for a token of a node. 8909 */ 8910 function setTokenSourceMapRange<T extends Node>(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T; 8911 /** 8912 * Gets a custom text range to use when emitting comments. 8913 */ 8914 function getCommentRange(node: Node): TextRange; 8915 /** 8916 * Sets a custom text range to use when emitting comments. 8917 */ 8918 function setCommentRange<T extends Node>(node: T, range: TextRange): T; 8919 function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined; 8920 function setSyntheticLeadingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T; 8921 function addSyntheticLeadingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; 8922 function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined; 8923 function setSyntheticTrailingComments<T extends Node>(node: T, comments: SynthesizedComment[] | undefined): T; 8924 function addSyntheticTrailingComment<T extends Node>(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T; 8925 function moveSyntheticComments<T extends Node>(node: T, original: Node): T; 8926 /** 8927 * Gets the constant value to emit for an expression representing an enum. 8928 */ 8929 function getConstantValue(node: AccessExpression): string | number | undefined; 8930 /** 8931 * Sets the constant value to emit for an expression. 8932 */ 8933 function setConstantValue(node: AccessExpression, value: string | number): AccessExpression; 8934 /** 8935 * Adds an EmitHelper to a node. 8936 */ 8937 function addEmitHelper<T extends Node>(node: T, helper: EmitHelper): T; 8938 /** 8939 * Add EmitHelpers to a node. 8940 */ 8941 function addEmitHelpers<T extends Node>(node: T, helpers: EmitHelper[] | undefined): T; 8942 /** 8943 * Removes an EmitHelper from a node. 8944 */ 8945 function removeEmitHelper(node: Node, helper: EmitHelper): boolean; 8946 /** 8947 * Gets the EmitHelpers of a node. 8948 */ 8949 function getEmitHelpers(node: Node): EmitHelper[] | undefined; 8950 /** 8951 * Moves matching emit helpers from a source node to a target node. 8952 */ 8953 function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; 8954 function isNumericLiteral(node: Node): node is NumericLiteral; 8955 function isBigIntLiteral(node: Node): node is BigIntLiteral; 8956 function isStringLiteral(node: Node): node is StringLiteral; 8957 function isJsxText(node: Node): node is JsxText; 8958 function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral; 8959 function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral; 8960 function isTemplateHead(node: Node): node is TemplateHead; 8961 function isTemplateMiddle(node: Node): node is TemplateMiddle; 8962 function isTemplateTail(node: Node): node is TemplateTail; 8963 function isDotDotDotToken(node: Node): node is DotDotDotToken; 8964 function isPlusToken(node: Node): node is PlusToken; 8965 function isMinusToken(node: Node): node is MinusToken; 8966 function isAsteriskToken(node: Node): node is AsteriskToken; 8967 function isExclamationToken(node: Node): node is ExclamationToken; 8968 function isQuestionToken(node: Node): node is QuestionToken; 8969 function isColonToken(node: Node): node is ColonToken; 8970 function isQuestionDotToken(node: Node): node is QuestionDotToken; 8971 function isEqualsGreaterThanToken(node: Node): node is EqualsGreaterThanToken; 8972 function isIdentifier(node: Node): node is Identifier; 8973 function isPrivateIdentifier(node: Node): node is PrivateIdentifier; 8974 function isAssertsKeyword(node: Node): node is AssertsKeyword; 8975 function isAwaitKeyword(node: Node): node is AwaitKeyword; 8976 function isQualifiedName(node: Node): node is QualifiedName; 8977 function isComputedPropertyName(node: Node): node is ComputedPropertyName; 8978 function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration; 8979 function isParameter(node: Node): node is ParameterDeclaration; 8980 function isDecorator(node: Node): node is Decorator; 8981 function isPropertySignature(node: Node): node is PropertySignature; 8982 function isPropertyDeclaration(node: Node): node is PropertyDeclaration; 8983 function isMethodSignature(node: Node): node is MethodSignature; 8984 function isMethodDeclaration(node: Node): node is MethodDeclaration; 8985 function isClassStaticBlockDeclaration(node: Node): node is ClassStaticBlockDeclaration; 8986 function isConstructorDeclaration(node: Node): node is ConstructorDeclaration; 8987 function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration; 8988 function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration; 8989 function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration; 8990 function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration; 8991 function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration; 8992 function isTypePredicateNode(node: Node): node is TypePredicateNode; 8993 function isTypeReferenceNode(node: Node): node is TypeReferenceNode; 8994 function isFunctionTypeNode(node: Node): node is FunctionTypeNode; 8995 function isConstructorTypeNode(node: Node): node is ConstructorTypeNode; 8996 function isTypeQueryNode(node: Node): node is TypeQueryNode; 8997 function isTypeLiteralNode(node: Node): node is TypeLiteralNode; 8998 function isArrayTypeNode(node: Node): node is ArrayTypeNode; 8999 function isTupleTypeNode(node: Node): node is TupleTypeNode; 9000 function isNamedTupleMember(node: Node): node is NamedTupleMember; 9001 function isOptionalTypeNode(node: Node): node is OptionalTypeNode; 9002 function isRestTypeNode(node: Node): node is RestTypeNode; 9003 function isUnionTypeNode(node: Node): node is UnionTypeNode; 9004 function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; 9005 function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; 9006 function isInferTypeNode(node: Node): node is InferTypeNode; 9007 function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; 9008 function isThisTypeNode(node: Node): node is ThisTypeNode; 9009 function isTypeOperatorNode(node: Node): node is TypeOperatorNode; 9010 function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode; 9011 function isMappedTypeNode(node: Node): node is MappedTypeNode; 9012 function isLiteralTypeNode(node: Node): node is LiteralTypeNode; 9013 function isImportTypeNode(node: Node): node is ImportTypeNode; 9014 function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan; 9015 function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode; 9016 function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; 9017 function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; 9018 function isBindingElement(node: Node): node is BindingElement; 9019 function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression; 9020 function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; 9021 function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; 9022 function isElementAccessExpression(node: Node): node is ElementAccessExpression; 9023 function isCallExpression(node: Node): node is CallExpression; 9024 function isNewExpression(node: Node): node is NewExpression; 9025 function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; 9026 function isTypeAssertionExpression(node: Node): node is TypeAssertion; 9027 function isParenthesizedExpression(node: Node): node is ParenthesizedExpression; 9028 function isFunctionExpression(node: Node): node is FunctionExpression; 9029 function isArrowFunction(node: Node): node is ArrowFunction; 9030 function isDeleteExpression(node: Node): node is DeleteExpression; 9031 function isTypeOfExpression(node: Node): node is TypeOfExpression; 9032 function isVoidExpression(node: Node): node is VoidExpression; 9033 function isAwaitExpression(node: Node): node is AwaitExpression; 9034 function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression; 9035 function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression; 9036 function isBinaryExpression(node: Node): node is BinaryExpression; 9037 function isConditionalExpression(node: Node): node is ConditionalExpression; 9038 function isTemplateExpression(node: Node): node is TemplateExpression; 9039 function isYieldExpression(node: Node): node is YieldExpression; 9040 function isSpreadElement(node: Node): node is SpreadElement; 9041 function isClassExpression(node: Node): node is ClassExpression; 9042 function isOmittedExpression(node: Node): node is OmittedExpression; 9043 function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments; 9044 function isAsExpression(node: Node): node is AsExpression; 9045 function isSatisfiesExpression(node: Node): node is SatisfiesExpression; 9046 function isNonNullExpression(node: Node): node is NonNullExpression; 9047 function isMetaProperty(node: Node): node is MetaProperty; 9048 function isSyntheticExpression(node: Node): node is SyntheticExpression; 9049 function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression; 9050 function isCommaListExpression(node: Node): node is CommaListExpression; 9051 function isTemplateSpan(node: Node): node is TemplateSpan; 9052 function isSemicolonClassElement(node: Node): node is SemicolonClassElement; 9053 function isBlock(node: Node): node is Block; 9054 function isVariableStatement(node: Node): node is VariableStatement; 9055 function isEmptyStatement(node: Node): node is EmptyStatement; 9056 function isExpressionStatement(node: Node): node is ExpressionStatement; 9057 function isIfStatement(node: Node): node is IfStatement; 9058 function isDoStatement(node: Node): node is DoStatement; 9059 function isWhileStatement(node: Node): node is WhileStatement; 9060 function isForStatement(node: Node): node is ForStatement; 9061 function isForInStatement(node: Node): node is ForInStatement; 9062 function isForOfStatement(node: Node): node is ForOfStatement; 9063 function isContinueStatement(node: Node): node is ContinueStatement; 9064 function isBreakStatement(node: Node): node is BreakStatement; 9065 function isReturnStatement(node: Node): node is ReturnStatement; 9066 function isWithStatement(node: Node): node is WithStatement; 9067 function isSwitchStatement(node: Node): node is SwitchStatement; 9068 function isLabeledStatement(node: Node): node is LabeledStatement; 9069 function isThrowStatement(node: Node): node is ThrowStatement; 9070 function isTryStatement(node: Node): node is TryStatement; 9071 function isDebuggerStatement(node: Node): node is DebuggerStatement; 9072 function isVariableDeclaration(node: Node): node is VariableDeclaration; 9073 function isVariableDeclarationList(node: Node): node is VariableDeclarationList; 9074 function isFunctionDeclaration(node: Node): node is FunctionDeclaration; 9075 function isClassDeclaration(node: Node): node is ClassDeclaration; 9076 function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration; 9077 function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration; 9078 function isEnumDeclaration(node: Node): node is EnumDeclaration; 9079 function isModuleDeclaration(node: Node): node is ModuleDeclaration; 9080 function isModuleBlock(node: Node): node is ModuleBlock; 9081 function isCaseBlock(node: Node): node is CaseBlock; 9082 function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration; 9083 function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration; 9084 function isImportDeclaration(node: Node): node is ImportDeclaration; 9085 function isImportClause(node: Node): node is ImportClause; 9086 function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer; 9087 /** @deprecated */ 9088 function isAssertClause(node: Node): node is AssertClause; 9089 /** @deprecated */ 9090 function isAssertEntry(node: Node): node is AssertEntry; 9091 function isImportAttributes(node: Node): node is ImportAttributes; 9092 function isImportAttribute(node: Node): node is ImportAttribute; 9093 function isNamespaceImport(node: Node): node is NamespaceImport; 9094 function isNamespaceExport(node: Node): node is NamespaceExport; 9095 function isNamedImports(node: Node): node is NamedImports; 9096 function isImportSpecifier(node: Node): node is ImportSpecifier; 9097 function isExportAssignment(node: Node): node is ExportAssignment; 9098 function isExportDeclaration(node: Node): node is ExportDeclaration; 9099 function isNamedExports(node: Node): node is NamedExports; 9100 function isExportSpecifier(node: Node): node is ExportSpecifier; 9101 function isModuleExportName(node: Node): node is ModuleExportName; 9102 function isMissingDeclaration(node: Node): node is MissingDeclaration; 9103 function isNotEmittedStatement(node: Node): node is NotEmittedStatement; 9104 function isExternalModuleReference(node: Node): node is ExternalModuleReference; 9105 function isJsxElement(node: Node): node is JsxElement; 9106 function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement; 9107 function isJsxOpeningElement(node: Node): node is JsxOpeningElement; 9108 function isJsxClosingElement(node: Node): node is JsxClosingElement; 9109 function isJsxFragment(node: Node): node is JsxFragment; 9110 function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment; 9111 function isJsxClosingFragment(node: Node): node is JsxClosingFragment; 9112 function isJsxAttribute(node: Node): node is JsxAttribute; 9113 function isJsxAttributes(node: Node): node is JsxAttributes; 9114 function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute; 9115 function isJsxExpression(node: Node): node is JsxExpression; 9116 function isJsxNamespacedName(node: Node): node is JsxNamespacedName; 9117 function isCaseClause(node: Node): node is CaseClause; 9118 function isDefaultClause(node: Node): node is DefaultClause; 9119 function isHeritageClause(node: Node): node is HeritageClause; 9120 function isCatchClause(node: Node): node is CatchClause; 9121 function isPropertyAssignment(node: Node): node is PropertyAssignment; 9122 function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; 9123 function isSpreadAssignment(node: Node): node is SpreadAssignment; 9124 function isEnumMember(node: Node): node is EnumMember; 9125 function isSourceFile(node: Node): node is SourceFile; 9126 function isBundle(node: Node): node is Bundle; 9127 function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; 9128 function isJSDocNameReference(node: Node): node is JSDocNameReference; 9129 function isJSDocMemberName(node: Node): node is JSDocMemberName; 9130 function isJSDocLink(node: Node): node is JSDocLink; 9131 function isJSDocLinkCode(node: Node): node is JSDocLinkCode; 9132 function isJSDocLinkPlain(node: Node): node is JSDocLinkPlain; 9133 function isJSDocAllType(node: Node): node is JSDocAllType; 9134 function isJSDocUnknownType(node: Node): node is JSDocUnknownType; 9135 function isJSDocNullableType(node: Node): node is JSDocNullableType; 9136 function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType; 9137 function isJSDocOptionalType(node: Node): node is JSDocOptionalType; 9138 function isJSDocFunctionType(node: Node): node is JSDocFunctionType; 9139 function isJSDocVariadicType(node: Node): node is JSDocVariadicType; 9140 function isJSDocNamepathType(node: Node): node is JSDocNamepathType; 9141 function isJSDoc(node: Node): node is JSDoc; 9142 function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral; 9143 function isJSDocSignature(node: Node): node is JSDocSignature; 9144 function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; 9145 function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag; 9146 function isJSDocClassTag(node: Node): node is JSDocClassTag; 9147 function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag; 9148 function isJSDocPublicTag(node: Node): node is JSDocPublicTag; 9149 function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag; 9150 function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag; 9151 function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag; 9152 function isJSDocOverrideTag(node: Node): node is JSDocOverrideTag; 9153 function isJSDocOverloadTag(node: Node): node is JSDocOverloadTag; 9154 function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag; 9155 function isJSDocSeeTag(node: Node): node is JSDocSeeTag; 9156 function isJSDocEnumTag(node: Node): node is JSDocEnumTag; 9157 function isJSDocParameterTag(node: Node): node is JSDocParameterTag; 9158 function isJSDocReturnTag(node: Node): node is JSDocReturnTag; 9159 function isJSDocThisTag(node: Node): node is JSDocThisTag; 9160 function isJSDocTypeTag(node: Node): node is JSDocTypeTag; 9161 function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag; 9162 function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag; 9163 function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag; 9164 function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag; 9165 function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag; 9166 function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag; 9167 function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag; 9168 function isJSDocImportTag(node: Node): node is JSDocImportTag; 9169 function isQuestionOrExclamationToken(node: Node): node is QuestionToken | ExclamationToken; 9170 function isIdentifierOrThisTypeNode(node: Node): node is Identifier | ThisTypeNode; 9171 function isReadonlyKeywordOrPlusOrMinusToken(node: Node): node is ReadonlyKeyword | PlusToken | MinusToken; 9172 function isQuestionOrPlusOrMinusToken(node: Node): node is QuestionToken | PlusToken | MinusToken; 9173 function isModuleName(node: Node): node is ModuleName; 9174 function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken; 9175 function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T; 9176 function canHaveModifiers(node: Node): node is HasModifiers; 9177 function canHaveDecorators(node: Node): node is HasDecorators; 9178 /** 9179 * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes 9180 * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, 9181 * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns 9182 * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. 9183 * 9184 * @param node a given node to visit its children 9185 * @param cbNode a callback to be invoked for all child nodes 9186 * @param cbNodes a callback to be invoked for embedded array 9187 * 9188 * @remarks `forEachChild` must visit the children of a node in the order 9189 * that they appear in the source code. The language service depends on this property to locate nodes by position. 9190 */ 9191 function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined; 9192 function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile; 9193 function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined; 9194 /** 9195 * Parse json text into SyntaxTree and return node and parse errors if any 9196 * @param fileName 9197 * @param sourceText 9198 */ 9199 function parseJsonText(fileName: string, sourceText: string): JsonSourceFile; 9200 function isExternalModule(file: SourceFile): boolean; 9201 function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; 9202 interface CreateSourceFileOptions { 9203 languageVersion: ScriptTarget; 9204 /** 9205 * Controls the format the file is detected as - this can be derived from only the path 9206 * and files on disk, but needs to be done with a module resolution cache in scope to be performant. 9207 * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. 9208 */ 9209 impliedNodeFormat?: ResolutionMode; 9210 /** 9211 * Controls how module-y-ness is set for the given file. Usually the result of calling 9212 * `getSetExternalModuleIndicator` on a valid `CompilerOptions` object. If not present, the default 9213 * check specified by `isFileProbablyExternalModule` will be used to set the field. 9214 */ 9215 setExternalModuleIndicator?: (file: SourceFile) => void; 9216 jsDocParsingMode?: JSDocParsingMode; 9217 } 9218 function parseCommandLine(commandLine: readonly string[], readFile?: (path: string) => string | undefined): ParsedCommandLine; 9219 function parseBuildCommand(commandLine: readonly string[]): ParsedBuildCommand; 9220 /** 9221 * Reads the config file, reports errors if any and exits if the config file cannot be found 9222 */ 9223 function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; 9224 /** 9225 * Read tsconfig.json file 9226 * @param fileName The path to the config file 9227 */ 9228 function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): { 9229 config?: any; 9230 error?: Diagnostic; 9231 }; 9232 /** 9233 * Parse the text of the tsconfig.json file 9234 * @param fileName The path to the config file 9235 * @param jsonText The text of the config file 9236 */ 9237 function parseConfigFileTextToJson(fileName: string, jsonText: string): { 9238 config?: any; 9239 error?: Diagnostic; 9240 }; 9241 /** 9242 * Read tsconfig.json file 9243 * @param fileName The path to the config file 9244 */ 9245 function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile; 9246 /** 9247 * Convert the json syntax tree into the json value 9248 */ 9249 function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]): any; 9250 /** 9251 * Parse the contents of a config file (tsconfig.json). 9252 * @param json The contents of the config file to parse 9253 * @param host Instance of ParseConfigHost used to enumerate files in folder. 9254 * @param basePath A root directory to resolve relative path entries in the config 9255 * file to. e.g. outDir 9256 */ 9257 function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine; 9258 /** 9259 * Parse the contents of a config file (tsconfig.json). 9260 * @param jsonNode The contents of the config file to parse 9261 * @param host Instance of ParseConfigHost used to enumerate files in folder. 9262 * @param basePath A root directory to resolve relative path entries in the config 9263 * file to. e.g. outDir 9264 */ 9265 function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: readonly FileExtensionInfo[], extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>, existingWatchOptions?: WatchOptions): ParsedCommandLine; 9266 function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { 9267 options: CompilerOptions; 9268 errors: Diagnostic[]; 9269 }; 9270 function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): { 9271 options: TypeAcquisition; 9272 errors: Diagnostic[]; 9273 }; 9274 /** Parsed command line for build */ 9275 interface ParsedBuildCommand { 9276 buildOptions: BuildOptions; 9277 watchOptions: WatchOptions | undefined; 9278 projects: string[]; 9279 errors: Diagnostic[]; 9280 } 9281 type DiagnosticReporter = (diagnostic: Diagnostic) => void; 9282 /** 9283 * Reports config file diagnostics 9284 */ 9285 interface ConfigFileDiagnosticsReporter { 9286 /** 9287 * Reports unrecoverable error when parsing config file 9288 */ 9289 onUnRecoverableConfigFileDiagnostic: DiagnosticReporter; 9290 } 9291 /** 9292 * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors 9293 */ 9294 interface ParseConfigFileHost extends ParseConfigHost, ConfigFileDiagnosticsReporter { 9295 getCurrentDirectory(): string; 9296 } 9297 interface ParsedTsconfig { 9298 raw: any; 9299 options?: CompilerOptions; 9300 watchOptions?: WatchOptions; 9301 typeAcquisition?: TypeAcquisition; 9302 /** 9303 * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet 9304 */ 9305 extendedConfigPath?: string | string[]; 9306 } 9307 interface ExtendedConfigCacheEntry { 9308 extendedResult: TsConfigSourceFile; 9309 extendedConfig: ParsedTsconfig | undefined; 9310 } 9311 function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined; 9312 /** 9313 * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. 9314 * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups 9315 * is assumed to be the same as root directory of the project. 9316 */ 9317 function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: ResolutionMode): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; 9318 /** 9319 * Given a set of options, returns the set of type directive names 9320 * that should be included for this program automatically. 9321 * This list could either come from the config file, 9322 * or from enumerating the types root + initial secondary types lookup location. 9323 * More type directives might appear in the program later as a result of loading actual source files; 9324 * this list is only the set of defaults that are implicitly included. 9325 */ 9326 function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[]; 9327 function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): ModuleResolutionCache; 9328 function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache; 9329 function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined; 9330 function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations; 9331 function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 9332 function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 9333 function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; 9334 interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, NonRelativeNameResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache { 9335 } 9336 interface ModeAwareCache<T> { 9337 get(key: string, mode: ResolutionMode): T | undefined; 9338 set(key: string, mode: ResolutionMode, value: T): this; 9339 delete(key: string, mode: ResolutionMode): this; 9340 has(key: string, mode: ResolutionMode): boolean; 9341 forEach(cb: (elem: T, key: string, mode: ResolutionMode) => void): void; 9342 size(): number; 9343 } 9344 /** 9345 * Cached resolutions per containing directory. 9346 * This assumes that any module id will have the same resolution for sibling files located in the same folder. 9347 */ 9348 interface PerDirectoryResolutionCache<T> { 9349 getFromDirectoryCache(name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined): T | undefined; 9350 getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache<T>; 9351 clear(): void; 9352 /** 9353 * Updates with the current compilerOptions the cache will operate with. 9354 * This updates the redirects map as well if needed so module resolutions are cached if they can across the projects 9355 */ 9356 update(options: CompilerOptions): void; 9357 } 9358 interface NonRelativeNameResolutionCache<T> { 9359 getFromNonRelativeNameCache(nonRelativeName: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined): T | undefined; 9360 getOrCreateCacheForNonRelativeName(nonRelativeName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerNonRelativeNameCache<T>; 9361 clear(): void; 9362 /** 9363 * Updates with the current compilerOptions the cache will operate with. 9364 * This updates the redirects map as well if needed so module resolutions are cached if they can across the projects 9365 */ 9366 update(options: CompilerOptions): void; 9367 } 9368 interface PerNonRelativeNameCache<T> { 9369 get(directory: string): T | undefined; 9370 set(directory: string, result: T): void; 9371 } 9372 interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache { 9373 getPackageJsonInfoCache(): PackageJsonInfoCache; 9374 } 9375 /** 9376 * Stored map from non-relative module name to a table: directory -> result of module lookup in this directory 9377 * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive. 9378 */ 9379 interface NonRelativeModuleNameResolutionCache extends NonRelativeNameResolutionCache<ResolvedModuleWithFailedLookupLocations>, PackageJsonInfoCache { 9380 /** @deprecated Use getOrCreateCacheForNonRelativeName */ 9381 getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerModuleNameCache; 9382 } 9383 interface PackageJsonInfoCache { 9384 clear(): void; 9385 } 9386 type PerModuleNameCache = PerNonRelativeNameCache<ResolvedModuleWithFailedLookupLocations>; 9387 /** 9388 * Visits a Node using the supplied visitor, possibly returning a new Node in its place. 9389 * 9390 * - If the input node is undefined, then the output is undefined. 9391 * - If the visitor returns undefined, then the output is undefined. 9392 * - If the output node is not undefined, then it will satisfy the test function. 9393 * - In order to obtain a return type that is more specific than `Node`, a test 9394 * function _must_ be provided, and that function must be a type predicate. 9395 * 9396 * @param node The Node to visit. 9397 * @param visitor The callback used to visit the Node. 9398 * @param test A callback to execute to verify the Node is valid. 9399 * @param lift An optional callback to execute to lift a NodeArray into a valid Node. 9400 */ 9401 function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined); 9402 /** 9403 * Visits a Node using the supplied visitor, possibly returning a new Node in its place. 9404 * 9405 * - If the input node is undefined, then the output is undefined. 9406 * - If the visitor returns undefined, then the output is undefined. 9407 * - If the output node is not undefined, then it will satisfy the test function. 9408 * - In order to obtain a return type that is more specific than `Node`, a test 9409 * function _must_ be provided, and that function must be a type predicate. 9410 * 9411 * @param node The Node to visit. 9412 * @param visitor The callback used to visit the Node. 9413 * @param test A callback to execute to verify the Node is valid. 9414 * @param lift An optional callback to execute to lift a NodeArray into a valid Node. 9415 */ 9416 function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined); 9417 /** 9418 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. 9419 * 9420 * - If the input node array is undefined, the output is undefined. 9421 * - If the visitor can return undefined, the node it visits in the array will be reused. 9422 * - If the output node array is not undefined, then its contents will satisfy the test. 9423 * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test 9424 * function _must_ be provided, and that function must be a type predicate. 9425 * 9426 * @param nodes The NodeArray to visit. 9427 * @param visitor The callback used to visit a Node. 9428 * @param test A node test to execute for each node. 9429 * @param start An optional value indicating the starting offset at which to start visiting. 9430 * @param count An optional value indicating the maximum number of nodes to visit. 9431 */ 9432 function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined); 9433 /** 9434 * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place. 9435 * 9436 * - If the input node array is undefined, the output is undefined. 9437 * - If the visitor can return undefined, the node it visits in the array will be reused. 9438 * - If the output node array is not undefined, then its contents will satisfy the test. 9439 * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test 9440 * function _must_ be provided, and that function must be a type predicate. 9441 * 9442 * @param nodes The NodeArray to visit. 9443 * @param visitor The callback used to visit a Node. 9444 * @param test A node test to execute for each node. 9445 * @param start An optional value indicating the starting offset at which to start visiting. 9446 * @param count An optional value indicating the maximum number of nodes to visit. 9447 */ 9448 function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined); 9449 /** 9450 * Starts a new lexical environment and visits a statement list, ending the lexical environment 9451 * and merging hoisted declarations upon completion. 9452 */ 9453 function visitLexicalEnvironment(statements: NodeArray<Statement>, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean, nodesVisitor?: NodesVisitor): NodeArray<Statement>; 9454 /** 9455 * Starts a new lexical environment and visits a parameter list, suspending the lexical 9456 * environment upon completion. 9457 */ 9458 function visitParameterList(nodes: NodeArray<ParameterDeclaration>, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration>; 9459 function visitParameterList(nodes: NodeArray<ParameterDeclaration> | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor): NodeArray<ParameterDeclaration> | undefined; 9460 /** 9461 * Resumes a suspended lexical environment and visits a function body, ending the lexical 9462 * environment and merging hoisted declarations upon completion. 9463 */ 9464 function visitFunctionBody(node: FunctionBody, visitor: Visitor, context: TransformationContext): FunctionBody; 9465 /** 9466 * Resumes a suspended lexical environment and visits a function body, ending the lexical 9467 * environment and merging hoisted declarations upon completion. 9468 */ 9469 function visitFunctionBody(node: FunctionBody | undefined, visitor: Visitor, context: TransformationContext): FunctionBody | undefined; 9470 /** 9471 * Resumes a suspended lexical environment and visits a concise body, ending the lexical 9472 * environment and merging hoisted declarations upon completion. 9473 */ 9474 function visitFunctionBody(node: ConciseBody, visitor: Visitor, context: TransformationContext): ConciseBody; 9475 /** 9476 * Visits an iteration body, adding any block-scoped variables required by the transformation. 9477 */ 9478 function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement; 9479 /** 9480 * Visits the elements of a {@link CommaListExpression}. 9481 * @param visitor The visitor to use when visiting expressions whose result will not be discarded at runtime. 9482 * @param discardVisitor The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor}. 9483 */ 9484 function visitCommaListElements(elements: NodeArray<Expression>, visitor: Visitor, discardVisitor?: Visitor): NodeArray<Expression>; 9485 /** 9486 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. 9487 * 9488 * @param node The Node whose children will be visited. 9489 * @param visitor The callback used to visit each child. 9490 * @param context A lexical environment context for the visitor. 9491 */ 9492 function visitEachChild<T extends Node>(node: T, visitor: Visitor, context: TransformationContext | undefined): T; 9493 /** 9494 * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place. 9495 * 9496 * @param node The Node whose children will be visited. 9497 * @param visitor The callback used to visit each child. 9498 * @param context A lexical environment context for the visitor. 9499 */ 9500 function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext | undefined, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; 9501 function getTsBuildInfoEmitOutputFilePath(options: CompilerOptions): string | undefined; 9502 function getOutputFileNames(commandLine: ParsedCommandLine, inputFileName: string, ignoreCase: boolean): readonly string[]; 9503 function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; 9504 enum ProgramUpdateLevel { 9505 /** Program is updated with same root file names and options */ 9506 Update = 0, 9507 /** Loads program after updating root file names from the disk */ 9508 RootNamesAndUpdate = 1, 9509 /** 9510 * Loads program completely, including: 9511 * - re-reading contents of config file from disk 9512 * - calculating root file names for the program 9513 * - Updating the program 9514 */ 9515 Full = 2, 9516 } 9517 function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; 9518 function resolveTripleslashReference(moduleName: string, containingFile: string): string; 9519 function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; 9520 function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 9521 function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string; 9522 function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; 9523 function formatDiagnosticsWithColorAndContext(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string; 9524 function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string; 9525 /** 9526 * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly 9527 * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file. 9528 */ 9529 function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ResolutionMode; 9530 /** 9531 * Use `program.getModeForResolutionAtIndex`, which retrieves the correct `compilerOptions`, instead of this function whenever possible. 9532 * Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode 9533 * explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In 9534 * `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the 9535 * input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns 9536 * `undefined`, as the result would have no impact on module resolution, emit, or type checking. 9537 * @param file File to fetch the resolution mode within 9538 * @param index Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations 9539 * @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options 9540 * should be the options of the referenced project, not the referencing project. 9541 */ 9542 function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode; 9543 /** 9544 * Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible. 9545 * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution 9546 * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes, 9547 * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of 9548 * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript. 9549 * Some examples: 9550 * 9551 * ```ts 9552 * // tsc foo.mts --module nodenext 9553 * import {} from "mod"; 9554 * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension 9555 * 9556 * // tsc foo.cts --module nodenext 9557 * import {} from "mod"; 9558 * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension 9559 * 9560 * // tsc foo.ts --module preserve --moduleResolution bundler 9561 * import {} from "mod"; 9562 * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler` 9563 * // supports conditional imports/exports 9564 * 9565 * // tsc foo.ts --module preserve --moduleResolution node10 9566 * import {} from "mod"; 9567 * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10` 9568 * // does not support conditional imports/exports 9569 * 9570 * // tsc foo.ts --module commonjs --moduleResolution node10 9571 * import type {} from "mod" with { "resolution-mode": "import" }; 9572 * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute 9573 * ``` 9574 * 9575 * @param file The file the import or import-like reference is contained within 9576 * @param usage The module reference string 9577 * @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options 9578 * should be the options of the referenced project, not the referencing project. 9579 * @returns The final resolution mode of the import 9580 */ 9581 function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode; 9582 function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[]; 9583 /** 9584 * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the 9585 * `options` parameter. 9586 * 9587 * @param fileName The file name to check the format of (it need not exist on disk) 9588 * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often 9589 * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data 9590 * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution` 9591 * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format 9592 */ 9593 function getImpliedNodeFormatForFile(fileName: string, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode; 9594 /** 9595 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' 9596 * that represent a compilation unit. 9597 * 9598 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and 9599 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in. 9600 * 9601 * @param createProgramOptions - The options for creating a program. 9602 * @returns A 'Program' object. 9603 */ 9604 function createProgram(createProgramOptions: CreateProgramOptions): Program; 9605 /** 9606 * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' 9607 * that represent a compilation unit. 9608 * 9609 * Creating a program proceeds from a set of root files, expanding the set of inputs by following imports and 9610 * triple-slash-reference-path directives transitively. '@types' and triple-slash-reference-types are also pulled in. 9611 * 9612 * @param rootNames - A set of root files. 9613 * @param options - The compiler options which should be used. 9614 * @param host - The host interacts with the underlying file system. 9615 * @param oldProgram - Reuses an old program structure. 9616 * @param configFileParsingDiagnostics - error during config file parsing 9617 * @returns A 'Program' object. 9618 */ 9619 function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program; 9620 /** 9621 * Returns the target config filename of a project reference. 9622 * Note: The file might not exist. 9623 */ 9624 function resolveProjectReferencePath(ref: ProjectReference): ResolvedConfigFileName; 9625 interface FormatDiagnosticsHost { 9626 getCurrentDirectory(): string; 9627 getCanonicalFileName(fileName: string): string; 9628 getNewLine(): string; 9629 } 9630 interface EmitOutput { 9631 outputFiles: OutputFile[]; 9632 emitSkipped: boolean; 9633 diagnostics: readonly Diagnostic[]; 9634 } 9635 interface OutputFile { 9636 name: string; 9637 writeByteOrderMark: boolean; 9638 text: string; 9639 } 9640 /** 9641 * Create the builder to manage semantic diagnostics and cache them 9642 */ 9643 function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): SemanticDiagnosticsBuilderProgram; 9644 function createSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): SemanticDiagnosticsBuilderProgram; 9645 /** 9646 * Create the builder that can handle the changes in program and iterate through changed files 9647 * to emit the those files and manage semantic diagnostics cache as well 9648 */ 9649 function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): EmitAndSemanticDiagnosticsBuilderProgram; 9650 function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): EmitAndSemanticDiagnosticsBuilderProgram; 9651 /** 9652 * Creates a builder thats just abstraction over program and can be used with watch 9653 */ 9654 function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[]): BuilderProgram; 9655 function createAbstractBuilder(rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[]): BuilderProgram; 9656 type AffectedFileResult<T> = { 9657 result: T; 9658 affected: SourceFile | Program; 9659 } | undefined; 9660 interface BuilderProgramHost { 9661 /** 9662 * If provided this would be used this hash instead of actual file shape text for detecting changes 9663 */ 9664 createHash?: (data: string) => string; 9665 /** 9666 * When emit or emitNextAffectedFile are called without writeFile, 9667 * this callback if present would be used to write files 9668 */ 9669 writeFile?: WriteFileCallback; 9670 } 9671 /** 9672 * Builder to manage the program state changes 9673 */ 9674 interface BuilderProgram { 9675 /** 9676 * Returns current program 9677 */ 9678 getProgram(): Program; 9679 /** 9680 * Get compiler options of the program 9681 */ 9682 getCompilerOptions(): CompilerOptions; 9683 /** 9684 * Get the source file in the program with file name 9685 */ 9686 getSourceFile(fileName: string): SourceFile | undefined; 9687 /** 9688 * Get a list of files in the program 9689 */ 9690 getSourceFiles(): readonly SourceFile[]; 9691 /** 9692 * Get the diagnostics for compiler options 9693 */ 9694 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 9695 /** 9696 * Get the diagnostics that dont belong to any file 9697 */ 9698 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 9699 /** 9700 * Get the diagnostics from config file parsing 9701 */ 9702 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 9703 /** 9704 * Get the syntax diagnostics, for all source files if source file is not supplied 9705 */ 9706 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 9707 /** 9708 * Get the declaration diagnostics, for all source files if source file is not supplied 9709 */ 9710 getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[]; 9711 /** 9712 * Get all the dependencies of the file 9713 */ 9714 getAllDependencies(sourceFile: SourceFile): readonly string[]; 9715 /** 9716 * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program 9717 * The semantic diagnostics are cached and managed here 9718 * Note that it is assumed that when asked about semantic diagnostics through this API, 9719 * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics 9720 * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, 9721 * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics 9722 */ 9723 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 9724 /** 9725 * Emits the JavaScript and declaration files. 9726 * When targetSource file is specified, emits the files corresponding to that source file, 9727 * otherwise for the whole program. 9728 * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, 9729 * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, 9730 * it will only emit all the affected files instead of whole program 9731 * 9732 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host 9733 * in that order would be used to write the files 9734 */ 9735 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; 9736 /** 9737 * Get the current directory of the program 9738 */ 9739 getCurrentDirectory(): string; 9740 } 9741 /** 9742 * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files 9743 */ 9744 interface SemanticDiagnosticsBuilderProgram extends BuilderProgram { 9745 /** 9746 * Gets the semantic diagnostics from the program for the next affected file and caches it 9747 * Returns undefined if the iteration is complete 9748 */ 9749 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>; 9750 } 9751 /** 9752 * The builder that can handle the changes in program and iterate through changed file to emit the files 9753 * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files 9754 */ 9755 interface EmitAndSemanticDiagnosticsBuilderProgram extends SemanticDiagnosticsBuilderProgram { 9756 /** 9757 * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete 9758 * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host 9759 * in that order would be used to write the files 9760 */ 9761 emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>; 9762 } 9763 function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined; 9764 function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost; 9765 function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T; 9766 /** 9767 * Create the watch compiler host for either configFile or fileNames and its options 9768 */ 9769 function createWatchCompilerHost<T extends BuilderProgram>(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile<T>; 9770 function createWatchCompilerHost<T extends BuilderProgram>(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[], watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions<T>; 9771 /** 9772 * Creates the watch from the host for root files and compiler options 9773 */ 9774 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfFilesAndCompilerOptions<T>): WatchOfFilesAndCompilerOptions<T>; 9775 /** 9776 * Creates the watch from the host for config file 9777 */ 9778 function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>; 9779 interface ReadBuildProgramHost { 9780 useCaseSensitiveFileNames(): boolean; 9781 getCurrentDirectory(): string; 9782 readFile(fileName: string): string | undefined; 9783 } 9784 interface IncrementalProgramOptions<T extends BuilderProgram> { 9785 rootNames: readonly string[]; 9786 options: CompilerOptions; 9787 configFileParsingDiagnostics?: readonly Diagnostic[]; 9788 projectReferences?: readonly ProjectReference[]; 9789 host?: CompilerHost; 9790 createProgram?: CreateProgram<T>; 9791 } 9792 type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number) => void; 9793 /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */ 9794 type CreateProgram<T extends BuilderProgram> = (rootNames: readonly string[] | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: readonly Diagnostic[], projectReferences?: readonly ProjectReference[] | undefined) => T; 9795 /** Host that has watch functionality used in --watch mode */ 9796 interface WatchHost { 9797 /** If provided, called with Diagnostic message that informs about change in watch status */ 9798 onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void; 9799 /** Used to watch changes in source files, missing files needed to update the program or config file */ 9800 watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher; 9801 /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */ 9802 watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher; 9803 /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */ 9804 setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; 9805 /** If provided, will be used to reset existing delayed compilation */ 9806 clearTimeout?(timeoutId: any): void; 9807 preferNonRecursiveWatch?: boolean; 9808 } 9809 interface ProgramHost<T extends BuilderProgram> { 9810 /** 9811 * Used to create the program when need for program creation or recreation detected 9812 */ 9813 createProgram: CreateProgram<T>; 9814 useCaseSensitiveFileNames(): boolean; 9815 getNewLine(): string; 9816 getCurrentDirectory(): string; 9817 getDefaultLibFileName(options: CompilerOptions): string; 9818 getDefaultLibLocation?(): string; 9819 createHash?(data: string): string; 9820 /** 9821 * Use to check file presence for source files and 9822 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well 9823 */ 9824 fileExists(path: string): boolean; 9825 /** 9826 * Use to read file text for source files and 9827 * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well 9828 */ 9829 readFile(path: string, encoding?: string): string | undefined; 9830 /** If provided, used for module resolution as well as to handle directory structure */ 9831 directoryExists?(path: string): boolean; 9832 /** If provided, used in resolutions as well as handling directory structure */ 9833 getDirectories?(path: string): string[]; 9834 /** If provided, used to cache and handle directory structure modifications */ 9835 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 9836 /** Symbol links resolution */ 9837 realpath?(path: string): string; 9838 /** If provided would be used to write log about compilation */ 9839 trace?(s: string): void; 9840 /** If provided is used to get the environment variable */ 9841 getEnvironmentVariable?(name: string): string | undefined; 9842 /** 9843 * @deprecated supply resolveModuleNameLiterals instead for resolution that can handle newer resolution modes like nodenext 9844 * 9845 * If provided, used to resolve the module names, otherwise typescript's default module resolution 9846 */ 9847 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[]; 9848 /** 9849 * @deprecated supply resolveTypeReferenceDirectiveReferences instead for resolution that can handle newer resolution modes like nodenext 9850 * 9851 * If provided, used to resolve type reference directives, otherwise typescript's default resolution 9852 */ 9853 resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode): (ResolvedTypeReferenceDirective | undefined)[]; 9854 resolveModuleNameLiterals?(moduleLiterals: readonly StringLiteralLike[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile, reusedNames: readonly StringLiteralLike[] | undefined): readonly ResolvedModuleWithFailedLookupLocations[]; 9855 resolveTypeReferenceDirectiveReferences?<T extends FileReference | string>(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile | undefined, reusedNames: readonly T[] | undefined): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; 9856 /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */ 9857 hasInvalidatedResolutions?(filePath: Path): boolean; 9858 /** 9859 * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it 9860 */ 9861 getModuleResolutionCache?(): ModuleResolutionCache | undefined; 9862 jsDocParsingMode?: JSDocParsingMode; 9863 } 9864 interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost { 9865 /** Instead of using output d.ts file from project reference, use its source file */ 9866 useSourceOfProjectReferenceRedirect?(): boolean; 9867 /** If provided, use this method to get parsed command lines for referenced projects */ 9868 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 9869 /** If provided, callback to invoke after every new program creation */ 9870 afterProgramCreate?(program: T): void; 9871 } 9872 /** 9873 * Host to create watch with root files and options 9874 */ 9875 interface WatchCompilerHostOfFilesAndCompilerOptions<T extends BuilderProgram> extends WatchCompilerHost<T> { 9876 /** root files to use to generate program */ 9877 rootFiles: string[]; 9878 /** Compiler options */ 9879 options: CompilerOptions; 9880 watchOptions?: WatchOptions; 9881 /** Project References */ 9882 projectReferences?: readonly ProjectReference[]; 9883 } 9884 /** 9885 * Host to create watch with config file 9886 */ 9887 interface WatchCompilerHostOfConfigFile<T extends BuilderProgram> extends WatchCompilerHost<T>, ConfigFileDiagnosticsReporter { 9888 /** Name of the config file to compile */ 9889 configFileName: string; 9890 /** Options to extend */ 9891 optionsToExtend?: CompilerOptions; 9892 watchOptionsToExtend?: WatchOptions; 9893 extraFileExtensions?: readonly FileExtensionInfo[]; 9894 /** 9895 * Used to generate source file names from the config file and its include, exclude, files rules 9896 * and also to cache the directory stucture 9897 */ 9898 readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 9899 } 9900 interface Watch<T> { 9901 /** Synchronize with host and get updated program */ 9902 getProgram(): T; 9903 /** Closes the watch */ 9904 close(): void; 9905 } 9906 /** 9907 * Creates the watch what generates program using the config file 9908 */ 9909 interface WatchOfConfigFile<T> extends Watch<T> { 9910 } 9911 /** 9912 * Creates the watch that generates program using the root files and compiler options 9913 */ 9914 interface WatchOfFilesAndCompilerOptions<T> extends Watch<T> { 9915 /** Updates the root files in the program, only if this is not config file compilation */ 9916 updateRootFileNames(fileNames: string[]): void; 9917 } 9918 /** 9919 * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic 9920 */ 9921 function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter; 9922 function createSolutionBuilderHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportErrorSummary?: ReportEmitErrorSummary): SolutionBuilderHost<T>; 9923 function createSolutionBuilderWithWatchHost<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>(system?: System, createProgram?: CreateProgram<T>, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): SolutionBuilderWithWatchHost<T>; 9924 function createSolutionBuilder<T extends BuilderProgram>(host: SolutionBuilderHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions): SolutionBuilder<T>; 9925 function createSolutionBuilderWithWatch<T extends BuilderProgram>(host: SolutionBuilderWithWatchHost<T>, rootNames: readonly string[], defaultOptions: BuildOptions, baseWatchOptions?: WatchOptions): SolutionBuilder<T>; 9926 interface BuildOptions { 9927 dry?: boolean; 9928 force?: boolean; 9929 verbose?: boolean; 9930 stopBuildOnErrors?: boolean; 9931 incremental?: boolean; 9932 assumeChangesOnlyAffectDirectDependencies?: boolean; 9933 declaration?: boolean; 9934 declarationMap?: boolean; 9935 emitDeclarationOnly?: boolean; 9936 sourceMap?: boolean; 9937 inlineSourceMap?: boolean; 9938 traceResolution?: boolean; 9939 [option: string]: CompilerOptionsValue | undefined; 9940 } 9941 type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void; 9942 interface ReportFileInError { 9943 fileName: string; 9944 line: number; 9945 } 9946 interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> { 9947 createDirectory?(path: string): void; 9948 /** 9949 * Should provide create directory and writeFile if done of invalidatedProjects is not invoked with 9950 * writeFileCallback 9951 */ 9952 writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; 9953 getCustomTransformers?: (project: string) => CustomTransformers | undefined; 9954 getModifiedTime(fileName: string): Date | undefined; 9955 setModifiedTime(fileName: string, date: Date): void; 9956 deleteFile(fileName: string): void; 9957 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 9958 reportDiagnostic: DiagnosticReporter; 9959 reportSolutionBuilderStatus: DiagnosticReporter; 9960 afterProgramEmitAndDiagnostics?(program: T): void; 9961 } 9962 interface SolutionBuilderHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T> { 9963 reportErrorSummary?: ReportEmitErrorSummary; 9964 } 9965 interface SolutionBuilderWithWatchHost<T extends BuilderProgram> extends SolutionBuilderHostBase<T>, WatchHost { 9966 } 9967 interface SolutionBuilder<T extends BuilderProgram> { 9968 build(project?: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus; 9969 clean(project?: string): ExitStatus; 9970 buildReferences(project: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers): ExitStatus; 9971 cleanReferences(project?: string): ExitStatus; 9972 getNextInvalidatedProject(cancellationToken?: CancellationToken): InvalidatedProject<T> | undefined; 9973 } 9974 enum InvalidatedProjectKind { 9975 Build = 0, 9976 UpdateOutputFileStamps = 1, 9977 } 9978 interface InvalidatedProjectBase { 9979 readonly kind: InvalidatedProjectKind; 9980 readonly project: ResolvedConfigFileName; 9981 /** 9982 * To dispose this project and ensure that all the necessary actions are taken and state is updated accordingly 9983 */ 9984 done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): ExitStatus; 9985 getCompilerOptions(): CompilerOptions; 9986 getCurrentDirectory(): string; 9987 } 9988 interface UpdateOutputFileStampsProject extends InvalidatedProjectBase { 9989 readonly kind: InvalidatedProjectKind.UpdateOutputFileStamps; 9990 updateOutputFileStatmps(): void; 9991 } 9992 interface BuildInvalidedProject<T extends BuilderProgram> extends InvalidatedProjectBase { 9993 readonly kind: InvalidatedProjectKind.Build; 9994 getBuilderProgram(): T | undefined; 9995 getProgram(): Program | undefined; 9996 getSourceFile(fileName: string): SourceFile | undefined; 9997 getSourceFiles(): readonly SourceFile[]; 9998 getOptionsDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 9999 getGlobalDiagnostics(cancellationToken?: CancellationToken): readonly Diagnostic[]; 10000 getConfigFileParsingDiagnostics(): readonly Diagnostic[]; 10001 getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 10002 getAllDependencies(sourceFile: SourceFile): readonly string[]; 10003 getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[]; 10004 getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>; 10005 emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; 10006 } 10007 type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T>; 10008 /** Returns true if commandline is --build and needs to be parsed useing parseBuildCommand */ 10009 function isBuildCommand(commandLineArgs: readonly string[]): boolean; 10010 function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings; 10011 /** 10012 * Represents an immutable snapshot of a script at a specified time.Once acquired, the 10013 * snapshot is observably immutable. i.e. the same calls with the same parameters will return 10014 * the same values. 10015 */ 10016 interface IScriptSnapshot { 10017 /** Gets a portion of the script snapshot specified by [start, end). */ 10018 getText(start: number, end: number): string; 10019 /** Gets the length of this script snapshot. */ 10020 getLength(): number; 10021 /** 10022 * Gets the TextChangeRange that describe how the text changed between this text and 10023 * an older version. This information is used by the incremental parser to determine 10024 * what sections of the script need to be re-parsed. 'undefined' can be returned if the 10025 * change range cannot be determined. However, in that case, incremental parsing will 10026 * not happen and the entire document will be re - parsed. 10027 */ 10028 getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined; 10029 /** Releases all resources held by this script snapshot */ 10030 dispose?(): void; 10031 } 10032 namespace ScriptSnapshot { 10033 function fromString(text: string): IScriptSnapshot; 10034 } 10035 interface PreProcessedFileInfo { 10036 referencedFiles: FileReference[]; 10037 typeReferenceDirectives: FileReference[]; 10038 libReferenceDirectives: FileReference[]; 10039 importedFiles: FileReference[]; 10040 ambientExternalModules?: string[]; 10041 isLibFile: boolean; 10042 } 10043 interface HostCancellationToken { 10044 isCancellationRequested(): boolean; 10045 } 10046 interface InstallPackageOptions { 10047 fileName: Path; 10048 packageName: string; 10049 } 10050 interface PerformanceEvent { 10051 kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider"; 10052 durationMs: number; 10053 } 10054 enum LanguageServiceMode { 10055 Semantic = 0, 10056 PartialSemantic = 1, 10057 Syntactic = 2, 10058 } 10059 interface IncompleteCompletionsCache { 10060 get(): CompletionInfo | undefined; 10061 set(response: CompletionInfo): void; 10062 clear(): void; 10063 } 10064 interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalResolutionCacheHost { 10065 getCompilationSettings(): CompilerOptions; 10066 getNewLine?(): string; 10067 getProjectVersion?(): string; 10068 getScriptFileNames(): string[]; 10069 getScriptKind?(fileName: string): ScriptKind; 10070 getScriptVersion(fileName: string): string; 10071 getScriptSnapshot(fileName: string): IScriptSnapshot | undefined; 10072 getProjectReferences?(): readonly ProjectReference[] | undefined; 10073 getLocalizedDiagnosticMessages?(): any; 10074 getCancellationToken?(): HostCancellationToken; 10075 getCurrentDirectory(): string; 10076 getDefaultLibFileName(options: CompilerOptions): string; 10077 log?(s: string): void; 10078 trace?(s: string): void; 10079 error?(s: string): void; 10080 useCaseSensitiveFileNames?(): boolean; 10081 readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; 10082 realpath?(path: string): string; 10083 readFile(path: string, encoding?: string): string | undefined; 10084 fileExists(path: string): boolean; 10085 getTypeRootsVersion?(): number; 10086 /** @deprecated supply resolveModuleNameLiterals instead for resolution that can handle newer resolution modes like nodenext */ 10087 resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[]; 10088 getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined; 10089 /** @deprecated supply resolveTypeReferenceDirectiveReferences instead for resolution that can handle newer resolution modes like nodenext */ 10090 resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode): (ResolvedTypeReferenceDirective | undefined)[]; 10091 resolveModuleNameLiterals?(moduleLiterals: readonly StringLiteralLike[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile, reusedNames: readonly StringLiteralLike[] | undefined): readonly ResolvedModuleWithFailedLookupLocations[]; 10092 resolveTypeReferenceDirectiveReferences?<T extends FileReference | string>(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile | undefined, reusedNames: readonly T[] | undefined): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; 10093 getDirectories?(directoryName: string): string[]; 10094 /** 10095 * Gets a set of custom transformers to use during emit. 10096 */ 10097 getCustomTransformers?(): CustomTransformers | undefined; 10098 isKnownTypesPackageName?(name: string): boolean; 10099 installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>; 10100 writeFile?(fileName: string, content: string): void; 10101 getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; 10102 jsDocParsingMode?: JSDocParsingMode | undefined; 10103 } 10104 type WithMetadata<T> = T & { 10105 metadata?: unknown; 10106 }; 10107 enum SemanticClassificationFormat { 10108 Original = "original", 10109 TwentyTwenty = "2020", 10110 } 10111 interface LanguageService { 10112 /** This is used as a part of restarting the language service. */ 10113 cleanupSemanticCache(): void; 10114 /** 10115 * Gets errors indicating invalid syntax in a file. 10116 * 10117 * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos, 10118 * grammatical errors, and misplaced punctuation. Likewise, examples of syntax 10119 * errors in TypeScript are missing parentheses in an `if` statement, mismatched 10120 * curly braces, and using a reserved keyword as a variable name. 10121 * 10122 * These diagnostics are inexpensive to compute and don't require knowledge of 10123 * other files. Note that a non-empty result increases the likelihood of false positives 10124 * from `getSemanticDiagnostics`. 10125 * 10126 * While these represent the majority of syntax-related diagnostics, there are some 10127 * that require the type system, which will be present in `getSemanticDiagnostics`. 10128 * 10129 * @param fileName A path to the file you want syntactic diagnostics for 10130 */ 10131 getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; 10132 /** 10133 * Gets warnings or errors indicating type system issues in a given file. 10134 * Requesting semantic diagnostics may start up the type system and 10135 * run deferred work, so the first call may take longer than subsequent calls. 10136 * 10137 * Unlike the other get*Diagnostics functions, these diagnostics can potentially not 10138 * include a reference to a source file. Specifically, the first time this is called, 10139 * it will return global diagnostics with no associated location. 10140 * 10141 * To contrast the differences between semantic and syntactic diagnostics, consider the 10142 * sentence: "The sun is green." is syntactically correct; those are real English words with 10143 * correct sentence structure. However, it is semantically invalid, because it is not true. 10144 * 10145 * @param fileName A path to the file you want semantic diagnostics for 10146 */ 10147 getSemanticDiagnostics(fileName: string): Diagnostic[]; 10148 /** 10149 * Gets suggestion diagnostics for a specific file. These diagnostics tend to 10150 * proactively suggest refactors, as opposed to diagnostics that indicate 10151 * potentially incorrect runtime behavior. 10152 * 10153 * @param fileName A path to the file you want semantic diagnostics for 10154 */ 10155 getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[]; 10156 /** 10157 * Gets global diagnostics related to the program configuration and compiler options. 10158 */ 10159 getCompilerOptionsDiagnostics(): Diagnostic[]; 10160 /** @deprecated Use getEncodedSyntacticClassifications instead. */ 10161 getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; 10162 getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; 10163 /** @deprecated Use getEncodedSemanticClassifications instead. */ 10164 getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; 10165 getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; 10166 /** Encoded as triples of [start, length, ClassificationType]. */ 10167 getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; 10168 /** 10169 * Gets semantic highlights information for a particular file. Has two formats, an older 10170 * version used by VS and a format used by VS Code. 10171 * 10172 * @param fileName The path to the file 10173 * @param position A text span to return results within 10174 * @param format Which format to use, defaults to "original" 10175 * @returns a number array encoded as triples of [start, length, ClassificationType, ...]. 10176 */ 10177 getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications; 10178 /** 10179 * Gets completion entries at a particular position in a file. 10180 * 10181 * @param fileName The path to the file 10182 * @param position A zero-based index of the character where you want the entries 10183 * @param options An object describing how the request was triggered and what kinds 10184 * of code actions can be returned with the completions. 10185 * @param formattingSettings settings needed for calling formatting functions. 10186 */ 10187 getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined; 10188 /** 10189 * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`. 10190 * 10191 * @param fileName The path to the file 10192 * @param position A zero based index of the character where you want the entries 10193 * @param entryName The `name` from an existing completion which came from `getCompletionsAtPosition` 10194 * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility 10195 * @param source `source` property from the completion entry 10196 * @param preferences User settings, can be undefined for backwards compatibility 10197 * @param data `data` property from the completion entry 10198 */ 10199 getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeOptions | FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined, data: CompletionEntryData | undefined): CompletionEntryDetails | undefined; 10200 getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined; 10201 /** 10202 * Gets semantic information about the identifier at a particular position in a 10203 * file. Quick info is what you typically see when you hover in an editor. 10204 * 10205 * @param fileName The path to the file 10206 * @param position A zero-based index of the character where you want the quick info 10207 * @param maximumLength Maximum length of a quickinfo text before it is truncated. 10208 */ 10209 getQuickInfoAtPosition(fileName: string, position: number, maximumLength?: number): QuickInfo | undefined; 10210 getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; 10211 getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; 10212 getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; 10213 getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo; 10214 /** @deprecated Use the signature with `UserPreferences` instead. */ 10215 getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo; 10216 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined; 10217 /** @deprecated Pass `providePrefixAndSuffixTextForRename` as part of a `UserPreferences` parameter. */ 10218 findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined; 10219 getSmartSelectionRange(fileName: string, position: number): SelectionRange; 10220 getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; 10221 getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined; 10222 getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; 10223 getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined; 10224 getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined; 10225 findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined; 10226 getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined; 10227 getFileReferences(fileName: string): ReferenceEntry[]; 10228 getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean, excludeLibFiles?: boolean): NavigateToItem[]; 10229 getNavigationBarItems(fileName: string): NavigationBarItem[]; 10230 getNavigationTree(fileName: string): NavigationTree; 10231 prepareCallHierarchy(fileName: string, position: number): CallHierarchyItem | CallHierarchyItem[] | undefined; 10232 provideCallHierarchyIncomingCalls(fileName: string, position: number): CallHierarchyIncomingCall[]; 10233 provideCallHierarchyOutgoingCalls(fileName: string, position: number): CallHierarchyOutgoingCall[]; 10234 provideInlayHints(fileName: string, span: TextSpan, preferences: UserPreferences | undefined): InlayHint[]; 10235 getOutliningSpans(fileName: string): OutliningSpan[]; 10236 getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; 10237 getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; 10238 getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number; 10239 getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 10240 getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 10241 getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; 10242 getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; 10243 isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; 10244 /** 10245 * 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. 10246 * Editors should call this after `>` is typed. 10247 */ 10248 getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined; 10249 getLinkedEditingRangeAtPosition(fileName: string, position: number): LinkedEditingInfo | undefined; 10250 getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined; 10251 toLineColumnOffset?(fileName: string, position: number): LineAndCharacter; 10252 getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[]; 10253 getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions; 10254 applyCodeActionCommand(action: CodeActionCommand, formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult>; 10255 applyCodeActionCommand(action: CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult[]>; 10256 applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>; 10257 /** @deprecated `fileName` will be ignored */ 10258 applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>; 10259 /** @deprecated `fileName` will be ignored */ 10260 applyCodeActionCommand(fileName: string, action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>; 10261 /** @deprecated `fileName` will be ignored */ 10262 applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>; 10263 /** 10264 * @param includeInteractiveActions Include refactor actions that require additional arguments to be 10265 * passed when calling `getEditsForRefactor`. When true, clients should inspect the `isInteractive` 10266 * property of each returned `RefactorActionInfo` and ensure they are able to collect the appropriate 10267 * arguments for any interactive action before offering it. 10268 */ 10269 getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[]; 10270 getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined, interactiveRefactorArguments?: InteractiveRefactorArguments): RefactorEditInfo | undefined; 10271 getMoveToRefactoringFileSuggestions(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): { 10272 newFileName: string; 10273 files: string[]; 10274 }; 10275 organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; 10276 getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[]; 10277 getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput; 10278 getProgram(): Program | undefined; 10279 toggleLineComment(fileName: string, textRange: TextRange): TextChange[]; 10280 toggleMultilineComment(fileName: string, textRange: TextRange): TextChange[]; 10281 commentSelection(fileName: string, textRange: TextRange): TextChange[]; 10282 uncommentSelection(fileName: string, textRange: TextRange): TextChange[]; 10283 getSupportedCodeFixes(fileName?: string): readonly string[]; 10284 dispose(): void; 10285 preparePasteEditsForFile(fileName: string, copiedTextRanges: TextRange[]): boolean; 10286 getPasteEdits(args: PasteEditsArgs, formatOptions: FormatCodeSettings): PasteEdits; 10287 } 10288 interface JsxClosingTagInfo { 10289 readonly newText: string; 10290 } 10291 interface LinkedEditingInfo { 10292 readonly ranges: TextSpan[]; 10293 wordPattern?: string; 10294 } 10295 interface CombinedCodeFixScope { 10296 type: "file"; 10297 fileName: string; 10298 } 10299 enum OrganizeImportsMode { 10300 All = "All", 10301 SortAndCombine = "SortAndCombine", 10302 RemoveUnused = "RemoveUnused", 10303 } 10304 interface PasteEdits { 10305 edits: readonly FileTextChanges[]; 10306 fixId?: {}; 10307 } 10308 interface PasteEditsArgs { 10309 targetFile: string; 10310 pastedText: string[]; 10311 pasteLocations: TextRange[]; 10312 copiedFrom: { 10313 file: string; 10314 range: TextRange[]; 10315 } | undefined; 10316 preferences: UserPreferences; 10317 } 10318 interface OrganizeImportsArgs extends CombinedCodeFixScope { 10319 /** @deprecated Use `mode` instead */ 10320 skipDestructiveCodeActions?: boolean; 10321 mode?: OrganizeImportsMode; 10322 } 10323 type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " "; 10324 enum CompletionTriggerKind { 10325 /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */ 10326 Invoked = 1, 10327 /** Completion was triggered by a trigger character. */ 10328 TriggerCharacter = 2, 10329 /** Completion was re-triggered as the current completion list is incomplete. */ 10330 TriggerForIncompleteCompletions = 3, 10331 } 10332 interface GetCompletionsAtPositionOptions extends UserPreferences { 10333 /** 10334 * If the editor is asking for completions because a certain character was typed 10335 * (as opposed to when the user explicitly requested them) this should be set. 10336 */ 10337 triggerCharacter?: CompletionsTriggerCharacter; 10338 triggerKind?: CompletionTriggerKind; 10339 /** 10340 * Include a `symbol` property on each completion entry object. 10341 * Symbols reference cyclic data structures and sometimes an entire TypeChecker instance, 10342 * so use caution when serializing or retaining completion entries retrieved with this option. 10343 * @default false 10344 */ 10345 includeSymbol?: boolean; 10346 /** @deprecated Use includeCompletionsForModuleExports */ 10347 includeExternalModuleExports?: boolean; 10348 /** @deprecated Use includeCompletionsWithInsertText */ 10349 includeInsertTextCompletions?: boolean; 10350 } 10351 type SignatureHelpTriggerCharacter = "," | "(" | "<"; 10352 type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")"; 10353 interface SignatureHelpItemsOptions { 10354 triggerReason?: SignatureHelpTriggerReason; 10355 } 10356 type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason; 10357 /** 10358 * Signals that the user manually requested signature help. 10359 * The language service will unconditionally attempt to provide a result. 10360 */ 10361 interface SignatureHelpInvokedReason { 10362 kind: "invoked"; 10363 triggerCharacter?: undefined; 10364 } 10365 /** 10366 * Signals that the signature help request came from a user typing a character. 10367 * Depending on the character and the syntactic context, the request may or may not be served a result. 10368 */ 10369 interface SignatureHelpCharacterTypedReason { 10370 kind: "characterTyped"; 10371 /** 10372 * Character that was responsible for triggering signature help. 10373 */ 10374 triggerCharacter: SignatureHelpTriggerCharacter; 10375 } 10376 /** 10377 * Signals that this signature help request came from typing a character or moving the cursor. 10378 * This should only occur if a signature help session was already active and the editor needs to see if it should adjust. 10379 * The language service will unconditionally attempt to provide a result. 10380 * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move. 10381 */ 10382 interface SignatureHelpRetriggeredReason { 10383 kind: "retrigger"; 10384 /** 10385 * Character that was responsible for triggering signature help. 10386 */ 10387 triggerCharacter?: SignatureHelpRetriggerCharacter; 10388 } 10389 interface ApplyCodeActionCommandResult { 10390 successMessage: string; 10391 } 10392 interface Classifications { 10393 spans: number[]; 10394 endOfLineState: EndOfLineState; 10395 } 10396 interface ClassifiedSpan { 10397 textSpan: TextSpan; 10398 classificationType: ClassificationTypeNames; 10399 } 10400 interface ClassifiedSpan2020 { 10401 textSpan: TextSpan; 10402 classificationType: number; 10403 } 10404 /** 10405 * Navigation bar interface designed for visual studio's dual-column layout. 10406 * This does not form a proper tree. 10407 * The navbar is returned as a list of top-level items, each of which has a list of child items. 10408 * Child items always have an empty array for their `childItems`. 10409 */ 10410 interface NavigationBarItem { 10411 text: string; 10412 kind: ScriptElementKind; 10413 kindModifiers: string; 10414 spans: TextSpan[]; 10415 childItems: NavigationBarItem[]; 10416 indent: number; 10417 bolded: boolean; 10418 grayed: boolean; 10419 } 10420 /** 10421 * Node in a tree of nested declarations in a file. 10422 * The top node is always a script or module node. 10423 */ 10424 interface NavigationTree { 10425 /** Name of the declaration, or a short description, e.g. "<class>". */ 10426 text: string; 10427 kind: ScriptElementKind; 10428 /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */ 10429 kindModifiers: string; 10430 /** 10431 * Spans of the nodes that generated this declaration. 10432 * There will be more than one if this is the result of merging. 10433 */ 10434 spans: TextSpan[]; 10435 nameSpan: TextSpan | undefined; 10436 /** Present if non-empty */ 10437 childItems?: NavigationTree[]; 10438 } 10439 interface CallHierarchyItem { 10440 name: string; 10441 kind: ScriptElementKind; 10442 kindModifiers?: string; 10443 file: string; 10444 span: TextSpan; 10445 selectionSpan: TextSpan; 10446 containerName?: string; 10447 } 10448 interface CallHierarchyIncomingCall { 10449 from: CallHierarchyItem; 10450 fromSpans: TextSpan[]; 10451 } 10452 interface CallHierarchyOutgoingCall { 10453 to: CallHierarchyItem; 10454 fromSpans: TextSpan[]; 10455 } 10456 enum InlayHintKind { 10457 Type = "Type", 10458 Parameter = "Parameter", 10459 Enum = "Enum", 10460 } 10461 interface InlayHint { 10462 /** This property will be the empty string when displayParts is set. */ 10463 text: string; 10464 position: number; 10465 kind: InlayHintKind; 10466 whitespaceBefore?: boolean; 10467 whitespaceAfter?: boolean; 10468 displayParts?: InlayHintDisplayPart[]; 10469 } 10470 interface InlayHintDisplayPart { 10471 text: string; 10472 span?: TextSpan; 10473 file?: string; 10474 } 10475 interface TodoCommentDescriptor { 10476 text: string; 10477 priority: number; 10478 } 10479 interface TodoComment { 10480 descriptor: TodoCommentDescriptor; 10481 message: string; 10482 position: number; 10483 } 10484 interface TextChange { 10485 span: TextSpan; 10486 newText: string; 10487 } 10488 interface FileTextChanges { 10489 fileName: string; 10490 textChanges: readonly TextChange[]; 10491 isNewFile?: boolean; 10492 } 10493 interface CodeAction { 10494 /** Description of the code action to display in the UI of the editor */ 10495 description: string; 10496 /** Text changes to apply to each file as part of the code action */ 10497 changes: FileTextChanges[]; 10498 /** 10499 * If the user accepts the code fix, the editor should send the action back in a `applyAction` request. 10500 * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix. 10501 */ 10502 commands?: CodeActionCommand[]; 10503 } 10504 interface CodeFixAction extends CodeAction { 10505 /** Short name to identify the fix, for use by telemetry. */ 10506 fixName: string; 10507 /** 10508 * If present, one may call 'getCombinedCodeFix' with this fixId. 10509 * This may be omitted to indicate that the code fix can't be applied in a group. 10510 */ 10511 fixId?: {}; 10512 fixAllDescription?: string; 10513 } 10514 interface CombinedCodeActions { 10515 changes: readonly FileTextChanges[]; 10516 commands?: readonly CodeActionCommand[]; 10517 } 10518 type CodeActionCommand = InstallPackageAction; 10519 interface InstallPackageAction { 10520 } 10521 /** 10522 * A set of one or more available refactoring actions, grouped under a parent refactoring. 10523 */ 10524 interface ApplicableRefactorInfo { 10525 /** 10526 * The programmatic name of the refactoring 10527 */ 10528 name: string; 10529 /** 10530 * A description of this refactoring category to show to the user. 10531 * If the refactoring gets inlined (see below), this text will not be visible. 10532 */ 10533 description: string; 10534 /** 10535 * Inlineable refactorings can have their actions hoisted out to the top level 10536 * of a context menu. Non-inlineanable refactorings should always be shown inside 10537 * their parent grouping. 10538 * 10539 * If not specified, this value is assumed to be 'true' 10540 */ 10541 inlineable?: boolean; 10542 actions: RefactorActionInfo[]; 10543 } 10544 /** 10545 * Represents a single refactoring action - for example, the "Extract Method..." refactor might 10546 * offer several actions, each corresponding to a surround class or closure to extract into. 10547 */ 10548 interface RefactorActionInfo { 10549 /** 10550 * The programmatic name of the refactoring action 10551 */ 10552 name: string; 10553 /** 10554 * A description of this refactoring action to show to the user. 10555 * If the parent refactoring is inlined away, this will be the only text shown, 10556 * so this description should make sense by itself if the parent is inlineable=true 10557 */ 10558 description: string; 10559 /** 10560 * A message to show to the user if the refactoring cannot be applied in 10561 * the current context. 10562 */ 10563 notApplicableReason?: string; 10564 /** 10565 * The hierarchical dotted name of the refactor action. 10566 */ 10567 kind?: string; 10568 /** 10569 * Indicates that the action requires additional arguments to be passed 10570 * when calling `getEditsForRefactor`. 10571 */ 10572 isInteractive?: boolean; 10573 /** 10574 * Range of code the refactoring will be applied to. 10575 */ 10576 range?: { 10577 start: { 10578 line: number; 10579 offset: number; 10580 }; 10581 end: { 10582 line: number; 10583 offset: number; 10584 }; 10585 }; 10586 } 10587 /** 10588 * A set of edits to make in response to a refactor action, plus an optional 10589 * location where renaming should be invoked from 10590 */ 10591 interface RefactorEditInfo { 10592 edits: FileTextChanges[]; 10593 renameFilename?: string; 10594 renameLocation?: number; 10595 commands?: CodeActionCommand[]; 10596 notApplicableReason?: string; 10597 } 10598 type RefactorTriggerReason = "implicit" | "invoked"; 10599 interface TextInsertion { 10600 newText: string; 10601 /** The position in newText the caret should point to after the insertion. */ 10602 caretOffset: number; 10603 } 10604 interface DocumentSpan { 10605 textSpan: TextSpan; 10606 fileName: string; 10607 /** 10608 * If the span represents a location that was remapped (e.g. via a .d.ts.map file), 10609 * then the original filename and span will be specified here 10610 */ 10611 originalTextSpan?: TextSpan; 10612 originalFileName?: string; 10613 /** 10614 * If DocumentSpan.textSpan is the span for name of the declaration, 10615 * then this is the span for relevant declaration 10616 */ 10617 contextSpan?: TextSpan; 10618 originalContextSpan?: TextSpan; 10619 } 10620 interface RenameLocation extends DocumentSpan { 10621 readonly prefixText?: string; 10622 readonly suffixText?: string; 10623 } 10624 interface ReferenceEntry extends DocumentSpan { 10625 isWriteAccess: boolean; 10626 isInString?: true; 10627 } 10628 interface ImplementationLocation extends DocumentSpan { 10629 kind: ScriptElementKind; 10630 displayParts: SymbolDisplayPart[]; 10631 } 10632 enum HighlightSpanKind { 10633 none = "none", 10634 definition = "definition", 10635 reference = "reference", 10636 writtenReference = "writtenReference", 10637 } 10638 interface HighlightSpan { 10639 fileName?: string; 10640 isInString?: true; 10641 textSpan: TextSpan; 10642 contextSpan?: TextSpan; 10643 kind: HighlightSpanKind; 10644 } 10645 interface NavigateToItem { 10646 name: string; 10647 kind: ScriptElementKind; 10648 kindModifiers: string; 10649 matchKind: "exact" | "prefix" | "substring" | "camelCase"; 10650 isCaseSensitive: boolean; 10651 fileName: string; 10652 textSpan: TextSpan; 10653 containerName: string; 10654 containerKind: ScriptElementKind; 10655 } 10656 enum IndentStyle { 10657 None = 0, 10658 Block = 1, 10659 Smart = 2, 10660 } 10661 enum SemicolonPreference { 10662 Ignore = "ignore", 10663 Insert = "insert", 10664 Remove = "remove", 10665 } 10666 /** @deprecated - consider using EditorSettings instead */ 10667 interface EditorOptions { 10668 BaseIndentSize?: number; 10669 IndentSize: number; 10670 TabSize: number; 10671 NewLineCharacter: string; 10672 ConvertTabsToSpaces: boolean; 10673 IndentStyle: IndentStyle; 10674 } 10675 interface EditorSettings { 10676 baseIndentSize?: number; 10677 indentSize?: number; 10678 tabSize?: number; 10679 newLineCharacter?: string; 10680 convertTabsToSpaces?: boolean; 10681 indentStyle?: IndentStyle; 10682 trimTrailingWhitespace?: boolean; 10683 } 10684 /** @deprecated - consider using FormatCodeSettings instead */ 10685 interface FormatCodeOptions extends EditorOptions { 10686 InsertSpaceAfterCommaDelimiter: boolean; 10687 InsertSpaceAfterSemicolonInForStatements: boolean; 10688 InsertSpaceBeforeAndAfterBinaryOperators: boolean; 10689 InsertSpaceAfterConstructor?: boolean; 10690 InsertSpaceAfterKeywordsInControlFlowStatements: boolean; 10691 InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; 10692 InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; 10693 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean; 10694 InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; 10695 InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; 10696 InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; 10697 InsertSpaceAfterTypeAssertion?: boolean; 10698 InsertSpaceBeforeFunctionParenthesis?: boolean; 10699 PlaceOpenBraceOnNewLineForFunctions: boolean; 10700 PlaceOpenBraceOnNewLineForControlBlocks: boolean; 10701 insertSpaceBeforeTypeAnnotation?: boolean; 10702 } 10703 interface FormatCodeSettings extends EditorSettings { 10704 readonly insertSpaceAfterCommaDelimiter?: boolean; 10705 readonly insertSpaceAfterSemicolonInForStatements?: boolean; 10706 readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean; 10707 readonly insertSpaceAfterConstructor?: boolean; 10708 readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean; 10709 readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; 10710 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; 10711 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; 10712 readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; 10713 readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; 10714 readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean; 10715 readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; 10716 readonly insertSpaceAfterTypeAssertion?: boolean; 10717 readonly insertSpaceBeforeFunctionParenthesis?: boolean; 10718 readonly placeOpenBraceOnNewLineForFunctions?: boolean; 10719 readonly placeOpenBraceOnNewLineForControlBlocks?: boolean; 10720 readonly insertSpaceBeforeTypeAnnotation?: boolean; 10721 readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean; 10722 readonly semicolons?: SemicolonPreference; 10723 readonly indentSwitchCase?: boolean; 10724 } 10725 interface DefinitionInfo extends DocumentSpan { 10726 kind: ScriptElementKind; 10727 name: string; 10728 containerKind: ScriptElementKind; 10729 containerName: string; 10730 unverified?: boolean; 10731 } 10732 interface DefinitionInfoAndBoundSpan { 10733 definitions?: readonly DefinitionInfo[]; 10734 textSpan: TextSpan; 10735 } 10736 interface ReferencedSymbolDefinitionInfo extends DefinitionInfo { 10737 displayParts: SymbolDisplayPart[]; 10738 } 10739 interface ReferencedSymbol { 10740 definition: ReferencedSymbolDefinitionInfo; 10741 references: ReferencedSymbolEntry[]; 10742 } 10743 interface ReferencedSymbolEntry extends ReferenceEntry { 10744 isDefinition?: boolean; 10745 } 10746 enum SymbolDisplayPartKind { 10747 aliasName = 0, 10748 className = 1, 10749 enumName = 2, 10750 fieldName = 3, 10751 interfaceName = 4, 10752 keyword = 5, 10753 lineBreak = 6, 10754 numericLiteral = 7, 10755 stringLiteral = 8, 10756 localName = 9, 10757 methodName = 10, 10758 moduleName = 11, 10759 operator = 12, 10760 parameterName = 13, 10761 propertyName = 14, 10762 punctuation = 15, 10763 space = 16, 10764 text = 17, 10765 typeParameterName = 18, 10766 enumMemberName = 19, 10767 functionName = 20, 10768 regularExpressionLiteral = 21, 10769 link = 22, 10770 linkName = 23, 10771 linkText = 24, 10772 } 10773 interface SymbolDisplayPart { 10774 /** 10775 * Text of an item describing the symbol. 10776 */ 10777 text: string; 10778 /** 10779 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). 10780 */ 10781 kind: string; 10782 } 10783 interface JSDocLinkDisplayPart extends SymbolDisplayPart { 10784 target: DocumentSpan; 10785 } 10786 interface JSDocTagInfo { 10787 name: string; 10788 text?: SymbolDisplayPart[]; 10789 } 10790 interface QuickInfo { 10791 kind: ScriptElementKind; 10792 kindModifiers: string; 10793 textSpan: TextSpan; 10794 displayParts?: SymbolDisplayPart[]; 10795 documentation?: SymbolDisplayPart[]; 10796 tags?: JSDocTagInfo[]; 10797 canIncreaseVerbosityLevel?: boolean; 10798 } 10799 type RenameInfo = RenameInfoSuccess | RenameInfoFailure; 10800 interface RenameInfoSuccess { 10801 canRename: true; 10802 /** 10803 * File or directory to rename. 10804 * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. 10805 */ 10806 fileToRename?: string; 10807 displayName: string; 10808 /** 10809 * Full display name of item to be renamed. 10810 * If item to be renamed is a file, then this is the original text of the module specifer 10811 */ 10812 fullDisplayName: string; 10813 kind: ScriptElementKind; 10814 kindModifiers: string; 10815 triggerSpan: TextSpan; 10816 } 10817 interface RenameInfoFailure { 10818 canRename: false; 10819 localizedErrorMessage: string; 10820 } 10821 /** 10822 * @deprecated Use `UserPreferences` instead. 10823 */ 10824 interface RenameInfoOptions { 10825 readonly allowRenameOfImportPath?: boolean; 10826 } 10827 interface DocCommentTemplateOptions { 10828 readonly generateReturnInDocTemplate?: boolean; 10829 } 10830 interface InteractiveRefactorArguments { 10831 targetFile: string; 10832 } 10833 /** 10834 * Signature help information for a single parameter 10835 */ 10836 interface SignatureHelpParameter { 10837 name: string; 10838 documentation: SymbolDisplayPart[]; 10839 displayParts: SymbolDisplayPart[]; 10840 isOptional: boolean; 10841 isRest?: boolean; 10842 } 10843 interface SelectionRange { 10844 textSpan: TextSpan; 10845 parent?: SelectionRange; 10846 } 10847 /** 10848 * Represents a single signature to show in signature help. 10849 * The id is used for subsequent calls into the language service to ask questions about the 10850 * signature help item in the context of any documents that have been updated. i.e. after 10851 * an edit has happened, while signature help is still active, the host can ask important 10852 * questions like 'what parameter is the user currently contained within?'. 10853 */ 10854 interface SignatureHelpItem { 10855 isVariadic: boolean; 10856 prefixDisplayParts: SymbolDisplayPart[]; 10857 suffixDisplayParts: SymbolDisplayPart[]; 10858 separatorDisplayParts: SymbolDisplayPart[]; 10859 parameters: SignatureHelpParameter[]; 10860 documentation: SymbolDisplayPart[]; 10861 tags: JSDocTagInfo[]; 10862 } 10863 /** 10864 * Represents a set of signature help items, and the preferred item that should be selected. 10865 */ 10866 interface SignatureHelpItems { 10867 items: SignatureHelpItem[]; 10868 applicableSpan: TextSpan; 10869 selectedItemIndex: number; 10870 argumentIndex: number; 10871 argumentCount: number; 10872 } 10873 enum CompletionInfoFlags { 10874 None = 0, 10875 MayIncludeAutoImports = 1, 10876 IsImportStatementCompletion = 2, 10877 IsContinuation = 4, 10878 ResolvedModuleSpecifiers = 8, 10879 ResolvedModuleSpecifiersBeyondLimit = 16, 10880 MayIncludeMethodSnippets = 32, 10881 } 10882 interface CompletionInfo { 10883 /** For performance telemetry. */ 10884 flags?: CompletionInfoFlags; 10885 /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ 10886 isGlobalCompletion: boolean; 10887 isMemberCompletion: boolean; 10888 /** 10889 * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use 10890 * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span 10891 * must be used to commit that completion entry. 10892 */ 10893 optionalReplacementSpan?: TextSpan; 10894 /** 10895 * true when the current location also allows for a new identifier 10896 */ 10897 isNewIdentifierLocation: boolean; 10898 /** 10899 * Indicates to client to continue requesting completions on subsequent keystrokes. 10900 */ 10901 isIncomplete?: true; 10902 entries: CompletionEntry[]; 10903 /** 10904 * Default commit characters for the completion entries. 10905 */ 10906 defaultCommitCharacters?: string[]; 10907 } 10908 interface CompletionEntryDataAutoImport { 10909 /** 10910 * The name of the property or export in the module's symbol table. Differs from the completion name 10911 * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default. 10912 */ 10913 exportName: string; 10914 exportMapKey?: ExportMapInfoKey; 10915 moduleSpecifier?: string; 10916 /** The file name declaring the export's module symbol, if it was an external module */ 10917 fileName?: string; 10918 /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */ 10919 ambientModuleName?: string; 10920 /** True if the export was found in the package.json AutoImportProvider */ 10921 isPackageJsonImport?: true; 10922 } 10923 interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport { 10924 exportMapKey: ExportMapInfoKey; 10925 } 10926 interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport { 10927 moduleSpecifier: string; 10928 } 10929 type CompletionEntryData = CompletionEntryDataUnresolved | CompletionEntryDataResolved; 10930 interface CompletionEntry { 10931 name: string; 10932 kind: ScriptElementKind; 10933 kindModifiers?: string; 10934 /** 10935 * A string that is used for comparing completion items so that they can be ordered. This 10936 * is often the same as the name but may be different in certain circumstances. 10937 */ 10938 sortText: string; 10939 /** 10940 * Text to insert instead of `name`. 10941 * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`, 10942 * coupled with `replacementSpan` to replace a dotted access with a bracket access. 10943 */ 10944 insertText?: string; 10945 /** 10946 * A string that should be used when filtering a set of 10947 * completion items. 10948 */ 10949 filterText?: string; 10950 /** 10951 * `insertText` should be interpreted as a snippet if true. 10952 */ 10953 isSnippet?: true; 10954 /** 10955 * An optional span that indicates the text to be replaced by this completion item. 10956 * If present, this span should be used instead of the default one. 10957 * It will be set if the required span differs from the one generated by the default replacement behavior. 10958 */ 10959 replacementSpan?: TextSpan; 10960 /** 10961 * Indicates whether commiting this completion entry will require additional code actions to be 10962 * made to avoid errors. The CompletionEntryDetails will have these actions. 10963 */ 10964 hasAction?: true; 10965 /** 10966 * Identifier (not necessarily human-readable) identifying where this completion came from. 10967 */ 10968 source?: string; 10969 /** 10970 * Human-readable description of the `source`. 10971 */ 10972 sourceDisplay?: SymbolDisplayPart[]; 10973 /** 10974 * Additional details for the label. 10975 */ 10976 labelDetails?: CompletionEntryLabelDetails; 10977 /** 10978 * If true, this completion should be highlighted as recommended. There will only be one of these. 10979 * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class. 10980 * Then either that enum/class or a namespace containing it will be the recommended symbol. 10981 */ 10982 isRecommended?: true; 10983 /** 10984 * If true, this completion was generated from traversing the name table of an unchecked JS file, 10985 * and therefore may not be accurate. 10986 */ 10987 isFromUncheckedFile?: true; 10988 /** 10989 * If true, this completion was for an auto-import of a module not yet in the program, but listed 10990 * in the project package.json. Used for telemetry reporting. 10991 */ 10992 isPackageJsonImport?: true; 10993 /** 10994 * If true, this completion was an auto-import-style completion of an import statement (i.e., the 10995 * module specifier was inserted along with the imported identifier). Used for telemetry reporting. 10996 */ 10997 isImportStatementCompletion?: true; 10998 /** 10999 * For API purposes. 11000 * Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`. 11001 * @example Get declaration of completion: `symbol.valueDeclaration` 11002 */ 11003 symbol?: Symbol; 11004 /** 11005 * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`, 11006 * that allows TS Server to look up the symbol represented by the completion item, disambiguating 11007 * items with the same name. Currently only defined for auto-import completions, but the type is 11008 * `unknown` in the protocol, so it can be changed as needed to support other kinds of completions. 11009 * The presence of this property should generally not be used to assume that this completion entry 11010 * is an auto-import. 11011 */ 11012 data?: CompletionEntryData; 11013 /** 11014 * If this completion entry is selected, typing a commit character will cause the entry to be accepted. 11015 */ 11016 commitCharacters?: string[]; 11017 } 11018 interface CompletionEntryLabelDetails { 11019 /** 11020 * An optional string which is rendered less prominently directly after 11021 * {@link CompletionEntry.name name}, without any spacing. Should be 11022 * used for function signatures or type annotations. 11023 */ 11024 detail?: string; 11025 /** 11026 * An optional string which is rendered less prominently after 11027 * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified 11028 * names or file path. 11029 */ 11030 description?: string; 11031 } 11032 interface CompletionEntryDetails { 11033 name: string; 11034 kind: ScriptElementKind; 11035 kindModifiers: string; 11036 displayParts: SymbolDisplayPart[]; 11037 documentation?: SymbolDisplayPart[]; 11038 tags?: JSDocTagInfo[]; 11039 codeActions?: CodeAction[]; 11040 /** @deprecated Use `sourceDisplay` instead. */ 11041 source?: SymbolDisplayPart[]; 11042 sourceDisplay?: SymbolDisplayPart[]; 11043 } 11044 interface OutliningSpan { 11045 /** The span of the document to actually collapse. */ 11046 textSpan: TextSpan; 11047 /** The span of the document to display when the user hovers over the collapsed span. */ 11048 hintSpan: TextSpan; 11049 /** The text to display in the editor for the collapsed region. */ 11050 bannerText: string; 11051 /** 11052 * Whether or not this region should be automatically collapsed when 11053 * the 'Collapse to Definitions' command is invoked. 11054 */ 11055 autoCollapse: boolean; 11056 /** 11057 * Classification of the contents of the span 11058 */ 11059 kind: OutliningSpanKind; 11060 } 11061 enum OutliningSpanKind { 11062 /** Single or multi-line comments */ 11063 Comment = "comment", 11064 /** Sections marked by '// #region' and '// #endregion' comments */ 11065 Region = "region", 11066 /** Declarations and expressions */ 11067 Code = "code", 11068 /** Contiguous blocks of import declarations */ 11069 Imports = "imports", 11070 } 11071 enum OutputFileType { 11072 JavaScript = 0, 11073 SourceMap = 1, 11074 Declaration = 2, 11075 } 11076 enum EndOfLineState { 11077 None = 0, 11078 InMultiLineCommentTrivia = 1, 11079 InSingleQuoteStringLiteral = 2, 11080 InDoubleQuoteStringLiteral = 3, 11081 InTemplateHeadOrNoSubstitutionTemplate = 4, 11082 InTemplateMiddleOrTail = 5, 11083 InTemplateSubstitutionPosition = 6, 11084 } 11085 enum TokenClass { 11086 Punctuation = 0, 11087 Keyword = 1, 11088 Operator = 2, 11089 Comment = 3, 11090 Whitespace = 4, 11091 Identifier = 5, 11092 NumberLiteral = 6, 11093 BigIntLiteral = 7, 11094 StringLiteral = 8, 11095 RegExpLiteral = 9, 11096 } 11097 interface ClassificationResult { 11098 finalLexState: EndOfLineState; 11099 entries: ClassificationInfo[]; 11100 } 11101 interface ClassificationInfo { 11102 length: number; 11103 classification: TokenClass; 11104 } 11105 interface Classifier { 11106 /** 11107 * Gives lexical classifications of tokens on a line without any syntactic context. 11108 * For instance, a token consisting of the text 'string' can be either an identifier 11109 * named 'string' or the keyword 'string', however, because this classifier is not aware, 11110 * it relies on certain heuristics to give acceptable results. For classifications where 11111 * speed trumps accuracy, this function is preferable; however, for true accuracy, the 11112 * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the 11113 * lexical, syntactic, and semantic classifiers may issue the best user experience. 11114 * 11115 * @param text The text of a line to classify. 11116 * @param lexState The state of the lexical classifier at the end of the previous line. 11117 * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. 11118 * If there is no syntactic classifier (syntacticClassifierAbsent=true), 11119 * certain heuristics may be used in its place; however, if there is a 11120 * syntactic classifier (syntacticClassifierAbsent=false), certain 11121 * classifications which may be incorrectly categorized will be given 11122 * back as Identifiers in order to allow the syntactic classifier to 11123 * subsume the classification. 11124 * @deprecated Use getLexicalClassifications instead. 11125 */ 11126 getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; 11127 getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; 11128 } 11129 enum ScriptElementKind { 11130 unknown = "", 11131 warning = "warning", 11132 /** predefined type (void) or keyword (class) */ 11133 keyword = "keyword", 11134 /** top level script node */ 11135 scriptElement = "script", 11136 /** module foo {} */ 11137 moduleElement = "module", 11138 /** class X {} */ 11139 classElement = "class", 11140 /** var x = class X {} */ 11141 localClassElement = "local class", 11142 /** interface Y {} */ 11143 interfaceElement = "interface", 11144 /** type T = ... */ 11145 typeElement = "type", 11146 /** enum E */ 11147 enumElement = "enum", 11148 enumMemberElement = "enum member", 11149 /** 11150 * Inside module and script only 11151 * const v = .. 11152 */ 11153 variableElement = "var", 11154 /** Inside function */ 11155 localVariableElement = "local var", 11156 /** using foo = ... */ 11157 variableUsingElement = "using", 11158 /** await using foo = ... */ 11159 variableAwaitUsingElement = "await using", 11160 /** 11161 * Inside module and script only 11162 * function f() { } 11163 */ 11164 functionElement = "function", 11165 /** Inside function */ 11166 localFunctionElement = "local function", 11167 /** class X { [public|private]* foo() {} } */ 11168 memberFunctionElement = "method", 11169 /** class X { [public|private]* [get|set] foo:number; } */ 11170 memberGetAccessorElement = "getter", 11171 memberSetAccessorElement = "setter", 11172 /** 11173 * class X { [public|private]* foo:number; } 11174 * interface Y { foo:number; } 11175 */ 11176 memberVariableElement = "property", 11177 /** class X { [public|private]* accessor foo: number; } */ 11178 memberAccessorVariableElement = "accessor", 11179 /** 11180 * class X { constructor() { } } 11181 * class X { static { } } 11182 */ 11183 constructorImplementationElement = "constructor", 11184 /** interface Y { ():number; } */ 11185 callSignatureElement = "call", 11186 /** interface Y { []:number; } */ 11187 indexSignatureElement = "index", 11188 /** interface Y { new():Y; } */ 11189 constructSignatureElement = "construct", 11190 /** function foo(*Y*: string) */ 11191 parameterElement = "parameter", 11192 typeParameterElement = "type parameter", 11193 primitiveType = "primitive type", 11194 label = "label", 11195 alias = "alias", 11196 constElement = "const", 11197 letElement = "let", 11198 directory = "directory", 11199 externalModuleName = "external module name", 11200 /** 11201 * <JsxTagName attribute1 attribute2={0} /> 11202 * @deprecated 11203 */ 11204 jsxAttribute = "JSX attribute", 11205 /** String literal */ 11206 string = "string", 11207 /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */ 11208 link = "link", 11209 /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */ 11210 linkName = "link name", 11211 /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */ 11212 linkText = "link text", 11213 } 11214 enum ScriptElementKindModifier { 11215 none = "", 11216 publicMemberModifier = "public", 11217 privateMemberModifier = "private", 11218 protectedMemberModifier = "protected", 11219 exportedModifier = "export", 11220 ambientModifier = "declare", 11221 staticModifier = "static", 11222 abstractModifier = "abstract", 11223 optionalModifier = "optional", 11224 deprecatedModifier = "deprecated", 11225 dtsModifier = ".d.ts", 11226 tsModifier = ".ts", 11227 tsxModifier = ".tsx", 11228 jsModifier = ".js", 11229 jsxModifier = ".jsx", 11230 jsonModifier = ".json", 11231 dmtsModifier = ".d.mts", 11232 mtsModifier = ".mts", 11233 mjsModifier = ".mjs", 11234 dctsModifier = ".d.cts", 11235 ctsModifier = ".cts", 11236 cjsModifier = ".cjs", 11237 } 11238 enum ClassificationTypeNames { 11239 comment = "comment", 11240 identifier = "identifier", 11241 keyword = "keyword", 11242 numericLiteral = "number", 11243 bigintLiteral = "bigint", 11244 operator = "operator", 11245 stringLiteral = "string", 11246 whiteSpace = "whitespace", 11247 text = "text", 11248 punctuation = "punctuation", 11249 className = "class name", 11250 enumName = "enum name", 11251 interfaceName = "interface name", 11252 moduleName = "module name", 11253 typeParameterName = "type parameter name", 11254 typeAliasName = "type alias name", 11255 parameterName = "parameter name", 11256 docCommentTagName = "doc comment tag name", 11257 jsxOpenTagName = "jsx open tag name", 11258 jsxCloseTagName = "jsx close tag name", 11259 jsxSelfClosingTagName = "jsx self closing tag name", 11260 jsxAttribute = "jsx attribute", 11261 jsxText = "jsx text", 11262 jsxAttributeStringLiteralValue = "jsx attribute string literal value", 11263 } 11264 enum ClassificationType { 11265 comment = 1, 11266 identifier = 2, 11267 keyword = 3, 11268 numericLiteral = 4, 11269 operator = 5, 11270 stringLiteral = 6, 11271 regularExpressionLiteral = 7, 11272 whiteSpace = 8, 11273 text = 9, 11274 punctuation = 10, 11275 className = 11, 11276 enumName = 12, 11277 interfaceName = 13, 11278 moduleName = 14, 11279 typeParameterName = 15, 11280 typeAliasName = 16, 11281 parameterName = 17, 11282 docCommentTagName = 18, 11283 jsxOpenTagName = 19, 11284 jsxCloseTagName = 20, 11285 jsxSelfClosingTagName = 21, 11286 jsxAttribute = 22, 11287 jsxText = 23, 11288 jsxAttributeStringLiteralValue = 24, 11289 bigintLiteral = 25, 11290 } 11291 interface InlayHintsContext { 11292 file: SourceFile; 11293 program: Program; 11294 cancellationToken: CancellationToken; 11295 host: LanguageServiceHost; 11296 span: TextSpan; 11297 preferences: UserPreferences; 11298 } 11299 type ExportMapInfoKey = string & { 11300 __exportInfoKey: void; 11301 }; 11302 /** The classifier is used for syntactic highlighting in editors via the TSServer */ 11303 function createClassifier(): Classifier; 11304 interface DocumentHighlights { 11305 fileName: string; 11306 highlightSpans: HighlightSpan[]; 11307 } 11308 function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string, jsDocParsingMode?: JSDocParsingMode): DocumentRegistry; 11309 /** 11310 * The document registry represents a store of SourceFile objects that can be shared between 11311 * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) 11312 * of files in the context. 11313 * SourceFile objects account for most of the memory usage by the language service. Sharing 11314 * the same DocumentRegistry instance between different instances of LanguageService allow 11315 * for more efficient memory utilization since all projects will share at least the library 11316 * file (lib.d.ts). 11317 * 11318 * A more advanced use of the document registry is to serialize sourceFile objects to disk 11319 * and re-hydrate them when needed. 11320 * 11321 * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it 11322 * to all subsequent createLanguageService calls. 11323 */ 11324 interface DocumentRegistry { 11325 /** 11326 * Request a stored SourceFile with a given fileName and compilationSettings. 11327 * The first call to acquire will call createLanguageServiceSourceFile to generate 11328 * the SourceFile if was not found in the registry. 11329 * 11330 * @param fileName The name of the file requested 11331 * @param compilationSettingsOrHost Some compilation settings like target affects the 11332 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store 11333 * multiple copies of the same file for different compilation settings. A minimal 11334 * resolution cache is needed to fully define a source file's shape when 11335 * the compilation settings include `module: node16`+, so providing a cache host 11336 * object should be preferred. A common host is a language service `ConfiguredProject`. 11337 * @param scriptSnapshot Text of the file. Only used if the file was not found 11338 * in the registry and a new one was created. 11339 * @param version Current version of the file. Only used if the file was not found 11340 * in the registry and a new one was created. 11341 */ 11342 acquireDocument(fileName: string, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile; 11343 acquireDocumentWithKey(fileName: string, path: Path, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile; 11344 /** 11345 * Request an updated version of an already existing SourceFile with a given fileName 11346 * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile 11347 * to get an updated SourceFile. 11348 * 11349 * @param fileName The name of the file requested 11350 * @param compilationSettingsOrHost Some compilation settings like target affects the 11351 * shape of a the resulting SourceFile. This allows the DocumentRegistry to store 11352 * multiple copies of the same file for different compilation settings. A minimal 11353 * resolution cache is needed to fully define a source file's shape when 11354 * the compilation settings include `module: node16`+, so providing a cache host 11355 * object should be preferred. A common host is a language service `ConfiguredProject`. 11356 * @param scriptSnapshot Text of the file. 11357 * @param version Current version of the file. 11358 */ 11359 updateDocument(fileName: string, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile; 11360 updateDocumentWithKey(fileName: string, path: Path, compilationSettingsOrHost: CompilerOptions | MinimalResolutionCacheHost, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind, sourceFileOptions?: CreateSourceFileOptions | ScriptTarget): SourceFile; 11361 getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; 11362 /** 11363 * Informs the DocumentRegistry that a file is not needed any longer. 11364 * 11365 * Note: It is not allowed to call release on a SourceFile that was not acquired from 11366 * this registry originally. 11367 * 11368 * @param fileName The name of the file to be released 11369 * @param compilationSettings The compilation settings used to acquire the file 11370 * @param scriptKind The script kind of the file to be released 11371 * 11372 * @deprecated pass scriptKind and impliedNodeFormat for correctness 11373 */ 11374 releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind?: ScriptKind): void; 11375 /** 11376 * Informs the DocumentRegistry that a file is not needed any longer. 11377 * 11378 * Note: It is not allowed to call release on a SourceFile that was not acquired from 11379 * this registry originally. 11380 * 11381 * @param fileName The name of the file to be released 11382 * @param compilationSettings The compilation settings used to acquire the file 11383 * @param scriptKind The script kind of the file to be released 11384 * @param impliedNodeFormat The implied source file format of the file to be released 11385 */ 11386 releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void; 11387 /** 11388 * @deprecated pass scriptKind for and impliedNodeFormat correctness */ 11389 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind?: ScriptKind): void; 11390 releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void; 11391 reportStats(): string; 11392 } 11393 type DocumentRegistryBucketKey = string & { 11394 __bucketKey: any; 11395 }; 11396 function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; 11397 function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput; 11398 function transpileDeclaration(input: string, transpileOptions: TranspileOptions): TranspileOutput; 11399 function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; 11400 interface TranspileOptions { 11401 compilerOptions?: CompilerOptions; 11402 fileName?: string; 11403 reportDiagnostics?: boolean; 11404 moduleName?: string; 11405 renamedDependencies?: MapLike<string>; 11406 transformers?: CustomTransformers; 11407 jsDocParsingMode?: JSDocParsingMode; 11408 } 11409 interface TranspileOutput { 11410 outputText: string; 11411 diagnostics?: Diagnostic[]; 11412 sourceMapText?: string; 11413 } 11414 function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; 11415 function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string; 11416 function getDefaultCompilerOptions(): CompilerOptions; 11417 function getSupportedCodeFixes(): readonly string[]; 11418 function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile; 11419 function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile; 11420 function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService; 11421 /** 11422 * Get the path of the default library files (lib.d.ts) as distributed with the typescript 11423 * node package. 11424 * The functionality is not supported if the ts module is consumed outside of a node module. 11425 */ 11426 function getDefaultLibFilePath(options: CompilerOptions): string; 11427 /** The version of the language service API */ 11428 const servicesVersion = "0.8"; 11429 /** 11430 * Transform one or more nodes using the supplied transformers. 11431 * @param source A single `Node` or an array of `Node` objects. 11432 * @param transformers An array of `TransformerFactory` callbacks used to process the transformation. 11433 * @param compilerOptions Optional compiler options. 11434 */ 11435 function transform<T extends Node>(source: T | T[], transformers: TransformerFactory<T>[], compilerOptions?: CompilerOptions): TransformationResult<T>; 11436 } 11437 export = ts;