Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier-eslint / node_modules / typescript / lib / protocol.d.ts
1 /**
2  * Declaration module describing the TypeScript Server protocol
3  */
4 declare namespace ts.server.protocol {
5     const enum CommandTypes {
6         JsxClosingTag = "jsxClosingTag",
7         Brace = "brace",
8         BraceCompletion = "braceCompletion",
9         GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
10         Change = "change",
11         Close = "close",
12         /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
13         Completions = "completions",
14         CompletionInfo = "completionInfo",
15         CompletionDetails = "completionEntryDetails",
16         CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
17         CompileOnSaveEmitFile = "compileOnSaveEmitFile",
18         Configure = "configure",
19         Definition = "definition",
20         DefinitionAndBoundSpan = "definitionAndBoundSpan",
21         Implementation = "implementation",
22         Exit = "exit",
23         Format = "format",
24         Formatonkey = "formatonkey",
25         Geterr = "geterr",
26         GeterrForProject = "geterrForProject",
27         SemanticDiagnosticsSync = "semanticDiagnosticsSync",
28         SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
29         SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
30         NavBar = "navbar",
31         Navto = "navto",
32         NavTree = "navtree",
33         NavTreeFull = "navtree-full",
34         /** @deprecated */
35         Occurrences = "occurrences",
36         DocumentHighlights = "documentHighlights",
37         Open = "open",
38         Quickinfo = "quickinfo",
39         References = "references",
40         Reload = "reload",
41         Rename = "rename",
42         Saveto = "saveto",
43         SignatureHelp = "signatureHelp",
44         Status = "status",
45         TypeDefinition = "typeDefinition",
46         ProjectInfo = "projectInfo",
47         ReloadProjects = "reloadProjects",
48         Unknown = "unknown",
49         OpenExternalProject = "openExternalProject",
50         OpenExternalProjects = "openExternalProjects",
51         CloseExternalProject = "closeExternalProject",
52         UpdateOpen = "updateOpen",
53         GetOutliningSpans = "getOutliningSpans",
54         TodoComments = "todoComments",
55         Indentation = "indentation",
56         DocCommentTemplate = "docCommentTemplate",
57         CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
58         GetCodeFixes = "getCodeFixes",
59         GetCombinedCodeFix = "getCombinedCodeFix",
60         ApplyCodeActionCommand = "applyCodeActionCommand",
61         GetSupportedCodeFixes = "getSupportedCodeFixes",
62         GetApplicableRefactors = "getApplicableRefactors",
63         GetEditsForRefactor = "getEditsForRefactor",
64         OrganizeImports = "organizeImports",
65         GetEditsForFileRename = "getEditsForFileRename",
66         ConfigurePlugin = "configurePlugin",
67         SelectionRange = "selectionRange",
68         PrepareCallHierarchy = "prepareCallHierarchy",
69         ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
70         ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls"
71     }
72     /**
73      * A TypeScript Server message
74      */
75     interface Message {
76         /**
77          * Sequence number of the message
78          */
79         seq: number;
80         /**
81          * One of "request", "response", or "event"
82          */
83         type: "request" | "response" | "event";
84     }
85     /**
86      * Client-initiated request message
87      */
88     interface Request extends Message {
89         type: "request";
90         /**
91          * The command to execute
92          */
93         command: string;
94         /**
95          * Object containing arguments for the command
96          */
97         arguments?: any;
98     }
99     /**
100      * Request to reload the project structure for all the opened files
101      */
102     interface ReloadProjectsRequest extends Message {
103         command: CommandTypes.ReloadProjects;
104     }
105     /**
106      * Server-initiated event message
107      */
108     interface Event extends Message {
109         type: "event";
110         /**
111          * Name of event
112          */
113         event: string;
114         /**
115          * Event-specific information
116          */
117         body?: any;
118     }
119     /**
120      * Response by server to client request message.
121      */
122     interface Response extends Message {
123         type: "response";
124         /**
125          * Sequence number of the request message.
126          */
127         request_seq: number;
128         /**
129          * Outcome of the request.
130          */
131         success: boolean;
132         /**
133          * The command requested.
134          */
135         command: string;
136         /**
137          * If success === false, this should always be provided.
138          * Otherwise, may (or may not) contain a success message.
139          */
140         message?: string;
141         /**
142          * Contains message body if success === true.
143          */
144         body?: any;
145         /**
146          * Contains extra information that plugin can include to be passed on
147          */
148         metadata?: unknown;
149         /**
150          * Exposes information about the performance of this request-response pair.
151          */
152         performanceData?: PerformanceData;
153     }
154     interface PerformanceData {
155         /**
156          * Time spent updating the program graph, in milliseconds.
157          */
158         updateGraphDurationMs?: number;
159     }
160     /**
161      * Arguments for FileRequest messages.
162      */
163     interface FileRequestArgs {
164         /**
165          * The file for the request (absolute pathname required).
166          */
167         file: string;
168         projectFileName?: string;
169     }
170     interface StatusRequest extends Request {
171         command: CommandTypes.Status;
172     }
173     interface StatusResponseBody {
174         /**
175          * The TypeScript version (`ts.version`).
176          */
177         version: string;
178     }
179     /**
180      * Response to StatusRequest
181      */
182     interface StatusResponse extends Response {
183         body: StatusResponseBody;
184     }
185     /**
186      * Requests a JS Doc comment template for a given position
187      */
188     interface DocCommentTemplateRequest extends FileLocationRequest {
189         command: CommandTypes.DocCommentTemplate;
190     }
191     /**
192      * Response to DocCommentTemplateRequest
193      */
194     interface DocCommandTemplateResponse extends Response {
195         body?: TextInsertion;
196     }
197     /**
198      * A request to get TODO comments from the file
199      */
200     interface TodoCommentRequest extends FileRequest {
201         command: CommandTypes.TodoComments;
202         arguments: TodoCommentRequestArgs;
203     }
204     /**
205      * Arguments for TodoCommentRequest request.
206      */
207     interface TodoCommentRequestArgs extends FileRequestArgs {
208         /**
209          * Array of target TodoCommentDescriptors that describes TODO comments to be found
210          */
211         descriptors: TodoCommentDescriptor[];
212     }
213     /**
214      * Response for TodoCommentRequest request.
215      */
216     interface TodoCommentsResponse extends Response {
217         body?: TodoComment[];
218     }
219     /**
220      * A request to determine if the caret is inside a comment.
221      */
222     interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
223         command: CommandTypes.GetSpanOfEnclosingComment;
224         arguments: SpanOfEnclosingCommentRequestArgs;
225     }
226     interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
227         /**
228          * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
229          */
230         onlyMultiLine: boolean;
231     }
232     /**
233      * Request to obtain outlining spans in file.
234      */
235     interface OutliningSpansRequest extends FileRequest {
236         command: CommandTypes.GetOutliningSpans;
237     }
238     interface OutliningSpan {
239         /** The span of the document to actually collapse. */
240         textSpan: TextSpan;
241         /** The span of the document to display when the user hovers over the collapsed span. */
242         hintSpan: TextSpan;
243         /** The text to display in the editor for the collapsed region. */
244         bannerText: string;
245         /**
246          * Whether or not this region should be automatically collapsed when
247          * the 'Collapse to Definitions' command is invoked.
248          */
249         autoCollapse: boolean;
250         /**
251          * Classification of the contents of the span
252          */
253         kind: OutliningSpanKind;
254     }
255     /**
256      * Response to OutliningSpansRequest request.
257      */
258     interface OutliningSpansResponse extends Response {
259         body?: OutliningSpan[];
260     }
261     /**
262      * A request to get indentation for a location in file
263      */
264     interface IndentationRequest extends FileLocationRequest {
265         command: CommandTypes.Indentation;
266         arguments: IndentationRequestArgs;
267     }
268     /**
269      * Response for IndentationRequest request.
270      */
271     interface IndentationResponse extends Response {
272         body?: IndentationResult;
273     }
274     /**
275      * Indentation result representing where indentation should be placed
276      */
277     interface IndentationResult {
278         /**
279          * The base position in the document that the indent should be relative to
280          */
281         position: number;
282         /**
283          * The number of columns the indent should be at relative to the position's column.
284          */
285         indentation: number;
286     }
287     /**
288      * Arguments for IndentationRequest request.
289      */
290     interface IndentationRequestArgs extends FileLocationRequestArgs {
291         /**
292          * An optional set of settings to be used when computing indentation.
293          * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
294          */
295         options?: EditorSettings;
296     }
297     /**
298      * Arguments for ProjectInfoRequest request.
299      */
300     interface ProjectInfoRequestArgs extends FileRequestArgs {
301         /**
302          * Indicate if the file name list of the project is needed
303          */
304         needFileNameList: boolean;
305     }
306     /**
307      * A request to get the project information of the current file.
308      */
309     interface ProjectInfoRequest extends Request {
310         command: CommandTypes.ProjectInfo;
311         arguments: ProjectInfoRequestArgs;
312     }
313     /**
314      * A request to retrieve compiler options diagnostics for a project
315      */
316     interface CompilerOptionsDiagnosticsRequest extends Request {
317         arguments: CompilerOptionsDiagnosticsRequestArgs;
318     }
319     /**
320      * Arguments for CompilerOptionsDiagnosticsRequest request.
321      */
322     interface CompilerOptionsDiagnosticsRequestArgs {
323         /**
324          * Name of the project to retrieve compiler options diagnostics.
325          */
326         projectFileName: string;
327     }
328     /**
329      * Response message body for "projectInfo" request
330      */
331     interface ProjectInfo {
332         /**
333          * For configured project, this is the normalized path of the 'tsconfig.json' file
334          * For inferred project, this is undefined
335          */
336         configFileName: string;
337         /**
338          * The list of normalized file name in the project, including 'lib.d.ts'
339          */
340         fileNames?: string[];
341         /**
342          * Indicates if the project has a active language service instance
343          */
344         languageServiceDisabled?: boolean;
345     }
346     /**
347      * Represents diagnostic info that includes location of diagnostic in two forms
348      * - start position and length of the error span
349      * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
350      */
351     interface DiagnosticWithLinePosition {
352         message: string;
353         start: number;
354         length: number;
355         startLocation: Location;
356         endLocation: Location;
357         category: string;
358         code: number;
359         /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
360         reportsUnnecessary?: {};
361         relatedInformation?: DiagnosticRelatedInformation[];
362     }
363     /**
364      * Response message for "projectInfo" request
365      */
366     interface ProjectInfoResponse extends Response {
367         body?: ProjectInfo;
368     }
369     /**
370      * Request whose sole parameter is a file name.
371      */
372     interface FileRequest extends Request {
373         arguments: FileRequestArgs;
374     }
375     /**
376      * Instances of this interface specify a location in a source file:
377      * (file, line, character offset), where line and character offset are 1-based.
378      */
379     interface FileLocationRequestArgs extends FileRequestArgs {
380         /**
381          * The line number for the request (1-based).
382          */
383         line: number;
384         /**
385          * The character offset (on the line) for the request (1-based).
386          */
387         offset: number;
388     }
389     type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
390     /**
391      * Request refactorings at a given position or selection area.
392      */
393     interface GetApplicableRefactorsRequest extends Request {
394         command: CommandTypes.GetApplicableRefactors;
395         arguments: GetApplicableRefactorsRequestArgs;
396     }
397     type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs;
398     /**
399      * Response is a list of available refactorings.
400      * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
401      */
402     interface GetApplicableRefactorsResponse extends Response {
403         body?: ApplicableRefactorInfo[];
404     }
405     /**
406      * A set of one or more available refactoring actions, grouped under a parent refactoring.
407      */
408     interface ApplicableRefactorInfo {
409         /**
410          * The programmatic name of the refactoring
411          */
412         name: string;
413         /**
414          * A description of this refactoring category to show to the user.
415          * If the refactoring gets inlined (see below), this text will not be visible.
416          */
417         description: string;
418         /**
419          * Inlineable refactorings can have their actions hoisted out to the top level
420          * of a context menu. Non-inlineanable refactorings should always be shown inside
421          * their parent grouping.
422          *
423          * If not specified, this value is assumed to be 'true'
424          */
425         inlineable?: boolean;
426         actions: RefactorActionInfo[];
427     }
428     /**
429      * Represents a single refactoring action - for example, the "Extract Method..." refactor might
430      * offer several actions, each corresponding to a surround class or closure to extract into.
431      */
432     interface RefactorActionInfo {
433         /**
434          * The programmatic name of the refactoring action
435          */
436         name: string;
437         /**
438          * A description of this refactoring action to show to the user.
439          * If the parent refactoring is inlined away, this will be the only text shown,
440          * so this description should make sense by itself if the parent is inlineable=true
441          */
442         description: string;
443     }
444     interface GetEditsForRefactorRequest extends Request {
445         command: CommandTypes.GetEditsForRefactor;
446         arguments: GetEditsForRefactorRequestArgs;
447     }
448     /**
449      * Request the edits that a particular refactoring action produces.
450      * Callers must specify the name of the refactor and the name of the action.
451      */
452     type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
453         refactor: string;
454         action: string;
455     };
456     interface GetEditsForRefactorResponse extends Response {
457         body?: RefactorEditInfo;
458     }
459     interface RefactorEditInfo {
460         edits: FileCodeEdits[];
461         /**
462          * An optional location where the editor should start a rename operation once
463          * the refactoring edits have been applied
464          */
465         renameLocation?: Location;
466         renameFilename?: string;
467     }
468     /**
469      * Organize imports by:
470      *   1) Removing unused imports
471      *   2) Coalescing imports from the same module
472      *   3) Sorting imports
473      */
474     interface OrganizeImportsRequest extends Request {
475         command: CommandTypes.OrganizeImports;
476         arguments: OrganizeImportsRequestArgs;
477     }
478     type OrganizeImportsScope = GetCombinedCodeFixScope;
479     interface OrganizeImportsRequestArgs {
480         scope: OrganizeImportsScope;
481     }
482     interface OrganizeImportsResponse extends Response {
483         body: readonly FileCodeEdits[];
484     }
485     interface GetEditsForFileRenameRequest extends Request {
486         command: CommandTypes.GetEditsForFileRename;
487         arguments: GetEditsForFileRenameRequestArgs;
488     }
489     /** Note: Paths may also be directories. */
490     interface GetEditsForFileRenameRequestArgs {
491         readonly oldFilePath: string;
492         readonly newFilePath: string;
493     }
494     interface GetEditsForFileRenameResponse extends Response {
495         body: readonly FileCodeEdits[];
496     }
497     /**
498      * Request for the available codefixes at a specific position.
499      */
500     interface CodeFixRequest extends Request {
501         command: CommandTypes.GetCodeFixes;
502         arguments: CodeFixRequestArgs;
503     }
504     interface GetCombinedCodeFixRequest extends Request {
505         command: CommandTypes.GetCombinedCodeFix;
506         arguments: GetCombinedCodeFixRequestArgs;
507     }
508     interface GetCombinedCodeFixResponse extends Response {
509         body: CombinedCodeActions;
510     }
511     interface ApplyCodeActionCommandRequest extends Request {
512         command: CommandTypes.ApplyCodeActionCommand;
513         arguments: ApplyCodeActionCommandRequestArgs;
514     }
515     interface ApplyCodeActionCommandResponse extends Response {
516     }
517     interface FileRangeRequestArgs extends FileRequestArgs {
518         /**
519          * The line number for the request (1-based).
520          */
521         startLine: number;
522         /**
523          * The character offset (on the line) for the request (1-based).
524          */
525         startOffset: number;
526         /**
527          * The line number for the request (1-based).
528          */
529         endLine: number;
530         /**
531          * The character offset (on the line) for the request (1-based).
532          */
533         endOffset: number;
534     }
535     /**
536      * Instances of this interface specify errorcodes on a specific location in a sourcefile.
537      */
538     interface CodeFixRequestArgs extends FileRangeRequestArgs {
539         /**
540          * Errorcodes we want to get the fixes for.
541          */
542         errorCodes: readonly number[];
543     }
544     interface GetCombinedCodeFixRequestArgs {
545         scope: GetCombinedCodeFixScope;
546         fixId: {};
547     }
548     interface GetCombinedCodeFixScope {
549         type: "file";
550         args: FileRequestArgs;
551     }
552     interface ApplyCodeActionCommandRequestArgs {
553         /** May also be an array of commands. */
554         command: {};
555     }
556     /**
557      * Response for GetCodeFixes request.
558      */
559     interface GetCodeFixesResponse extends Response {
560         body?: CodeAction[];
561     }
562     /**
563      * A request whose arguments specify a file location (file, line, col).
564      */
565     interface FileLocationRequest extends FileRequest {
566         arguments: FileLocationRequestArgs;
567     }
568     /**
569      * A request to get codes of supported code fixes.
570      */
571     interface GetSupportedCodeFixesRequest extends Request {
572         command: CommandTypes.GetSupportedCodeFixes;
573     }
574     /**
575      * A response for GetSupportedCodeFixesRequest request.
576      */
577     interface GetSupportedCodeFixesResponse extends Response {
578         /**
579          * List of error codes supported by the server.
580          */
581         body?: string[];
582     }
583     /**
584      * Arguments in document highlight request; include: filesToSearch, file,
585      * line, offset.
586      */
587     interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
588         /**
589          * List of files to search for document highlights.
590          */
591         filesToSearch: string[];
592     }
593     /**
594      * Go to definition request; value of command field is
595      * "definition". Return response giving the file locations that
596      * define the symbol found in file at location line, col.
597      */
598     interface DefinitionRequest extends FileLocationRequest {
599         command: CommandTypes.Definition;
600     }
601     interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
602         readonly command: CommandTypes.DefinitionAndBoundSpan;
603     }
604     interface DefinitionAndBoundSpanResponse extends Response {
605         readonly body: DefinitionInfoAndBoundSpan;
606     }
607     /**
608      * Go to type request; value of command field is
609      * "typeDefinition". Return response giving the file locations that
610      * define the type for the symbol found in file at location line, col.
611      */
612     interface TypeDefinitionRequest extends FileLocationRequest {
613         command: CommandTypes.TypeDefinition;
614     }
615     /**
616      * Go to implementation request; value of command field is
617      * "implementation". Return response giving the file locations that
618      * implement the symbol found in file at location line, col.
619      */
620     interface ImplementationRequest extends FileLocationRequest {
621         command: CommandTypes.Implementation;
622     }
623     /**
624      * Location in source code expressed as (one-based) line and (one-based) column offset.
625      */
626     interface Location {
627         line: number;
628         offset: number;
629     }
630     /**
631      * Object found in response messages defining a span of text in source code.
632      */
633     interface TextSpan {
634         /**
635          * First character of the definition.
636          */
637         start: Location;
638         /**
639          * One character past last character of the definition.
640          */
641         end: Location;
642     }
643     /**
644      * Object found in response messages defining a span of text in a specific source file.
645      */
646     interface FileSpan extends TextSpan {
647         /**
648          * File containing text span.
649          */
650         file: string;
651     }
652     interface TextSpanWithContext extends TextSpan {
653         contextStart?: Location;
654         contextEnd?: Location;
655     }
656     interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
657     }
658     interface DefinitionInfoAndBoundSpan {
659         definitions: readonly FileSpanWithContext[];
660         textSpan: TextSpan;
661     }
662     /**
663      * Definition response message.  Gives text range for definition.
664      */
665     interface DefinitionResponse extends Response {
666         body?: FileSpanWithContext[];
667     }
668     interface DefinitionInfoAndBoundSpanResponse extends Response {
669         body?: DefinitionInfoAndBoundSpan;
670     }
671     /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
672     type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
673     /**
674      * Definition response message.  Gives text range for definition.
675      */
676     interface TypeDefinitionResponse extends Response {
677         body?: FileSpanWithContext[];
678     }
679     /**
680      * Implementation response message.  Gives text range for implementations.
681      */
682     interface ImplementationResponse extends Response {
683         body?: FileSpanWithContext[];
684     }
685     /**
686      * Request to get brace completion for a location in the file.
687      */
688     interface BraceCompletionRequest extends FileLocationRequest {
689         command: CommandTypes.BraceCompletion;
690         arguments: BraceCompletionRequestArgs;
691     }
692     /**
693      * Argument for BraceCompletionRequest request.
694      */
695     interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
696         /**
697          * Kind of opening brace
698          */
699         openingBrace: string;
700     }
701     interface JsxClosingTagRequest extends FileLocationRequest {
702         readonly command: CommandTypes.JsxClosingTag;
703         readonly arguments: JsxClosingTagRequestArgs;
704     }
705     interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
706     }
707     interface JsxClosingTagResponse extends Response {
708         readonly body: TextInsertion;
709     }
710     /**
711      * @deprecated
712      * Get occurrences request; value of command field is
713      * "occurrences". Return response giving spans that are relevant
714      * in the file at a given line and column.
715      */
716     interface OccurrencesRequest extends FileLocationRequest {
717         command: CommandTypes.Occurrences;
718     }
719     /** @deprecated */
720     interface OccurrencesResponseItem extends FileSpanWithContext {
721         /**
722          * True if the occurrence is a write location, false otherwise.
723          */
724         isWriteAccess: boolean;
725         /**
726          * True if the occurrence is in a string, undefined otherwise;
727          */
728         isInString?: true;
729     }
730     /** @deprecated */
731     interface OccurrencesResponse extends Response {
732         body?: OccurrencesResponseItem[];
733     }
734     /**
735      * Get document highlights request; value of command field is
736      * "documentHighlights". Return response giving spans that are relevant
737      * in the file at a given line and column.
738      */
739     interface DocumentHighlightsRequest extends FileLocationRequest {
740         command: CommandTypes.DocumentHighlights;
741         arguments: DocumentHighlightsRequestArgs;
742     }
743     /**
744      * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
745      */
746     interface HighlightSpan extends TextSpanWithContext {
747         kind: HighlightSpanKind;
748     }
749     /**
750      * Represents a set of highligh spans for a give name
751      */
752     interface DocumentHighlightsItem {
753         /**
754          * File containing highlight spans.
755          */
756         file: string;
757         /**
758          * Spans to highlight in file.
759          */
760         highlightSpans: HighlightSpan[];
761     }
762     /**
763      * Response for a DocumentHighlightsRequest request.
764      */
765     interface DocumentHighlightsResponse extends Response {
766         body?: DocumentHighlightsItem[];
767     }
768     /**
769      * Find references request; value of command field is
770      * "references". Return response giving the file locations that
771      * reference the symbol found in file at location line, col.
772      */
773     interface ReferencesRequest extends FileLocationRequest {
774         command: CommandTypes.References;
775     }
776     interface ReferencesResponseItem extends FileSpanWithContext {
777         /** Text of line containing the reference.  Including this
778          *  with the response avoids latency of editor loading files
779          * to show text of reference line (the server already has
780          * loaded the referencing files).
781          */
782         lineText: string;
783         /**
784          * True if reference is a write location, false otherwise.
785          */
786         isWriteAccess: boolean;
787         /**
788          * True if reference is a definition, false otherwise.
789          */
790         isDefinition: boolean;
791     }
792     /**
793      * The body of a "references" response message.
794      */
795     interface ReferencesResponseBody {
796         /**
797          * The file locations referencing the symbol.
798          */
799         refs: readonly ReferencesResponseItem[];
800         /**
801          * The name of the symbol.
802          */
803         symbolName: string;
804         /**
805          * The start character offset of the symbol (on the line provided by the references request).
806          */
807         symbolStartOffset: number;
808         /**
809          * The full display name of the symbol.
810          */
811         symbolDisplayString: string;
812     }
813     /**
814      * Response to "references" request.
815      */
816     interface ReferencesResponse extends Response {
817         body?: ReferencesResponseBody;
818     }
819     /**
820      * Argument for RenameRequest request.
821      */
822     interface RenameRequestArgs extends FileLocationRequestArgs {
823         /**
824          * Should text at specified location be found/changed in comments?
825          */
826         findInComments?: boolean;
827         /**
828          * Should text at specified location be found/changed in strings?
829          */
830         findInStrings?: boolean;
831     }
832     /**
833      * Rename request; value of command field is "rename". Return
834      * response giving the file locations that reference the symbol
835      * found in file at location line, col. Also return full display
836      * name of the symbol so that client can print it unambiguously.
837      */
838     interface RenameRequest extends FileLocationRequest {
839         command: CommandTypes.Rename;
840         arguments: RenameRequestArgs;
841     }
842     /**
843      * Information about the item to be renamed.
844      */
845     type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
846     interface RenameInfoSuccess {
847         /**
848          * True if item can be renamed.
849          */
850         canRename: true;
851         /**
852          * File or directory to rename.
853          * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
854          */
855         fileToRename?: string;
856         /**
857          * Display name of the item to be renamed.
858          */
859         displayName: string;
860         /**
861          * Full display name of item to be renamed.
862          */
863         fullDisplayName: string;
864         /**
865          * The items's kind (such as 'className' or 'parameterName' or plain 'text').
866          */
867         kind: ScriptElementKind;
868         /**
869          * Optional modifiers for the kind (such as 'public').
870          */
871         kindModifiers: string;
872         /** Span of text to rename. */
873         triggerSpan: TextSpan;
874     }
875     interface RenameInfoFailure {
876         canRename: false;
877         /**
878          * Error message if item can not be renamed.
879          */
880         localizedErrorMessage: string;
881     }
882     /**
883      *  A group of text spans, all in 'file'.
884      */
885     interface SpanGroup {
886         /** The file to which the spans apply */
887         file: string;
888         /** The text spans in this group */
889         locs: RenameTextSpan[];
890     }
891     interface RenameTextSpan extends TextSpanWithContext {
892         readonly prefixText?: string;
893         readonly suffixText?: string;
894     }
895     interface RenameResponseBody {
896         /**
897          * Information about the item to be renamed.
898          */
899         info: RenameInfo;
900         /**
901          * An array of span groups (one per file) that refer to the item to be renamed.
902          */
903         locs: readonly SpanGroup[];
904     }
905     /**
906      * Rename response message.
907      */
908     interface RenameResponse extends Response {
909         body?: RenameResponseBody;
910     }
911     /**
912      * Represents a file in external project.
913      * External project is project whose set of files, compilation options and open\close state
914      * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
915      * External project will exist even if all files in it are closed and should be closed explicitly.
916      * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
917      * create configured project for every config file but will maintain a link that these projects were created
918      * as a result of opening external project so they should be removed once external project is closed.
919      */
920     interface ExternalFile {
921         /**
922          * Name of file file
923          */
924         fileName: string;
925         /**
926          * Script kind of the file
927          */
928         scriptKind?: ScriptKindName | ts.ScriptKind;
929         /**
930          * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
931          */
932         hasMixedContent?: boolean;
933         /**
934          * Content of the file
935          */
936         content?: string;
937     }
938     /**
939      * Represent an external project
940      */
941     interface ExternalProject {
942         /**
943          * Project name
944          */
945         projectFileName: string;
946         /**
947          * List of root files in project
948          */
949         rootFiles: ExternalFile[];
950         /**
951          * Compiler options for the project
952          */
953         options: ExternalProjectCompilerOptions;
954         /**
955          * @deprecated typingOptions. Use typeAcquisition instead
956          */
957         typingOptions?: TypeAcquisition;
958         /**
959          * Explicitly specified type acquisition for the project
960          */
961         typeAcquisition?: TypeAcquisition;
962     }
963     interface CompileOnSaveMixin {
964         /**
965          * If compile on save is enabled for the project
966          */
967         compileOnSave?: boolean;
968     }
969     /**
970      * For external projects, some of the project settings are sent together with
971      * compiler settings.
972      */
973     type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
974     interface FileWithProjectReferenceRedirectInfo {
975         /**
976          * Name of file
977          */
978         fileName: string;
979         /**
980          * True if the file is primarily included in a referenced project
981          */
982         isSourceOfProjectReferenceRedirect: boolean;
983     }
984     /**
985      * Represents a set of changes that happen in project
986      */
987     interface ProjectChanges {
988         /**
989          * List of added files
990          */
991         added: string[] | FileWithProjectReferenceRedirectInfo[];
992         /**
993          * List of removed files
994          */
995         removed: string[] | FileWithProjectReferenceRedirectInfo[];
996         /**
997          * List of updated files
998          */
999         updated: string[] | FileWithProjectReferenceRedirectInfo[];
1000         /**
1001          * List of files that have had their project reference redirect status updated
1002          * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
1003          */
1004         updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
1005     }
1006     /**
1007      * Information found in a configure request.
1008      */
1009     interface ConfigureRequestArguments {
1010         /**
1011          * Information about the host, for example 'Emacs 24.4' or
1012          * 'Sublime Text version 3075'
1013          */
1014         hostInfo?: string;
1015         /**
1016          * If present, tab settings apply only to this file.
1017          */
1018         file?: string;
1019         /**
1020          * The format options to use during formatting and other code editing features.
1021          */
1022         formatOptions?: FormatCodeSettings;
1023         preferences?: UserPreferences;
1024         /**
1025          * The host's additional supported .js file extensions
1026          */
1027         extraFileExtensions?: FileExtensionInfo[];
1028         watchOptions?: WatchOptions;
1029     }
1030     const enum WatchFileKind {
1031         FixedPollingInterval = "FixedPollingInterval",
1032         PriorityPollingInterval = "PriorityPollingInterval",
1033         DynamicPriorityPolling = "DynamicPriorityPolling",
1034         UseFsEvents = "UseFsEvents",
1035         UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory"
1036     }
1037     const enum WatchDirectoryKind {
1038         UseFsEvents = "UseFsEvents",
1039         FixedPollingInterval = "FixedPollingInterval",
1040         DynamicPriorityPolling = "DynamicPriorityPolling"
1041     }
1042     const enum PollingWatchKind {
1043         FixedInterval = "FixedInterval",
1044         PriorityInterval = "PriorityInterval",
1045         DynamicPriority = "DynamicPriority"
1046     }
1047     interface WatchOptions {
1048         watchFile?: WatchFileKind | ts.WatchFileKind;
1049         watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
1050         fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
1051         synchronousWatchDirectory?: boolean;
1052         [option: string]: CompilerOptionsValue | undefined;
1053     }
1054     /**
1055      *  Configure request; value of command field is "configure".  Specifies
1056      *  host information, such as host type, tab size, and indent size.
1057      */
1058     interface ConfigureRequest extends Request {
1059         command: CommandTypes.Configure;
1060         arguments: ConfigureRequestArguments;
1061     }
1062     /**
1063      * Response to "configure" request.  This is just an acknowledgement, so
1064      * no body field is required.
1065      */
1066     interface ConfigureResponse extends Response {
1067     }
1068     interface ConfigurePluginRequestArguments {
1069         pluginName: string;
1070         configuration: any;
1071     }
1072     interface ConfigurePluginRequest extends Request {
1073         command: CommandTypes.ConfigurePlugin;
1074         arguments: ConfigurePluginRequestArguments;
1075     }
1076     interface ConfigurePluginResponse extends Response {
1077     }
1078     interface SelectionRangeRequest extends FileRequest {
1079         command: CommandTypes.SelectionRange;
1080         arguments: SelectionRangeRequestArgs;
1081     }
1082     interface SelectionRangeRequestArgs extends FileRequestArgs {
1083         locations: Location[];
1084     }
1085     interface SelectionRangeResponse extends Response {
1086         body?: SelectionRange[];
1087     }
1088     interface SelectionRange {
1089         textSpan: TextSpan;
1090         parent?: SelectionRange;
1091     }
1092     /**
1093      *  Information found in an "open" request.
1094      */
1095     interface OpenRequestArgs extends FileRequestArgs {
1096         /**
1097          * Used when a version of the file content is known to be more up to date than the one on disk.
1098          * Then the known content will be used upon opening instead of the disk copy
1099          */
1100         fileContent?: string;
1101         /**
1102          * Used to specify the script kind of the file explicitly. It could be one of the following:
1103          *      "TS", "JS", "TSX", "JSX"
1104          */
1105         scriptKindName?: ScriptKindName;
1106         /**
1107          * Used to limit the searching for project config file. If given the searching will stop at this
1108          * root path; otherwise it will go all the way up to the dist root path.
1109          */
1110         projectRootPath?: string;
1111     }
1112     type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
1113     /**
1114      * Open request; value of command field is "open". Notify the
1115      * server that the client has file open.  The server will not
1116      * monitor the filesystem for changes in this file and will assume
1117      * that the client is updating the server (using the change and/or
1118      * reload messages) when the file changes. Server does not currently
1119      * send a response to an open request.
1120      */
1121     interface OpenRequest extends Request {
1122         command: CommandTypes.Open;
1123         arguments: OpenRequestArgs;
1124     }
1125     /**
1126      * Request to open or update external project
1127      */
1128     interface OpenExternalProjectRequest extends Request {
1129         command: CommandTypes.OpenExternalProject;
1130         arguments: OpenExternalProjectArgs;
1131     }
1132     /**
1133      * Arguments to OpenExternalProjectRequest request
1134      */
1135     type OpenExternalProjectArgs = ExternalProject;
1136     /**
1137      * Request to open multiple external projects
1138      */
1139     interface OpenExternalProjectsRequest extends Request {
1140         command: CommandTypes.OpenExternalProjects;
1141         arguments: OpenExternalProjectsArgs;
1142     }
1143     /**
1144      * Arguments to OpenExternalProjectsRequest
1145      */
1146     interface OpenExternalProjectsArgs {
1147         /**
1148          * List of external projects to open or update
1149          */
1150         projects: ExternalProject[];
1151     }
1152     /**
1153      * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
1154      * no body field is required.
1155      */
1156     interface OpenExternalProjectResponse extends Response {
1157     }
1158     /**
1159      * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
1160      * no body field is required.
1161      */
1162     interface OpenExternalProjectsResponse extends Response {
1163     }
1164     /**
1165      * Request to close external project.
1166      */
1167     interface CloseExternalProjectRequest extends Request {
1168         command: CommandTypes.CloseExternalProject;
1169         arguments: CloseExternalProjectRequestArgs;
1170     }
1171     /**
1172      * Arguments to CloseExternalProjectRequest request
1173      */
1174     interface CloseExternalProjectRequestArgs {
1175         /**
1176          * Name of the project to close
1177          */
1178         projectFileName: string;
1179     }
1180     /**
1181      * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
1182      * no body field is required.
1183      */
1184     interface CloseExternalProjectResponse extends Response {
1185     }
1186     /**
1187      * Request to synchronize list of open files with the client
1188      */
1189     interface UpdateOpenRequest extends Request {
1190         command: CommandTypes.UpdateOpen;
1191         arguments: UpdateOpenRequestArgs;
1192     }
1193     /**
1194      * Arguments to UpdateOpenRequest
1195      */
1196     interface UpdateOpenRequestArgs {
1197         /**
1198          * List of newly open files
1199          */
1200         openFiles?: OpenRequestArgs[];
1201         /**
1202          * List of open files files that were changes
1203          */
1204         changedFiles?: FileCodeEdits[];
1205         /**
1206          * List of files that were closed
1207          */
1208         closedFiles?: string[];
1209     }
1210     /**
1211      * Request to set compiler options for inferred projects.
1212      * External projects are opened / closed explicitly.
1213      * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
1214      * This configuration file will be used to obtain a list of files and configuration settings for the project.
1215      * Inferred projects are created when user opens a loose file that is not the part of external project
1216      * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
1217      * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
1218      */
1219     interface SetCompilerOptionsForInferredProjectsRequest extends Request {
1220         command: CommandTypes.CompilerOptionsForInferredProjects;
1221         arguments: SetCompilerOptionsForInferredProjectsArgs;
1222     }
1223     /**
1224      * Argument for SetCompilerOptionsForInferredProjectsRequest request.
1225      */
1226     interface SetCompilerOptionsForInferredProjectsArgs {
1227         /**
1228          * Compiler options to be used with inferred projects.
1229          */
1230         options: ExternalProjectCompilerOptions;
1231         /**
1232          * Specifies the project root path used to scope compiler options.
1233          * It is an error to provide this property if the server has not been started with
1234          * `useInferredProjectPerProjectRoot` enabled.
1235          */
1236         projectRootPath?: string;
1237     }
1238     /**
1239      * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
1240      * no body field is required.
1241      */
1242     interface SetCompilerOptionsForInferredProjectsResponse extends Response {
1243     }
1244     /**
1245      *  Exit request; value of command field is "exit".  Ask the server process
1246      *  to exit.
1247      */
1248     interface ExitRequest extends Request {
1249         command: CommandTypes.Exit;
1250     }
1251     /**
1252      * Close request; value of command field is "close". Notify the
1253      * server that the client has closed a previously open file.  If
1254      * file is still referenced by open files, the server will resume
1255      * monitoring the filesystem for changes to file.  Server does not
1256      * currently send a response to a close request.
1257      */
1258     interface CloseRequest extends FileRequest {
1259         command: CommandTypes.Close;
1260     }
1261     /**
1262      * Request to obtain the list of files that should be regenerated if target file is recompiled.
1263      * NOTE: this us query-only operation and does not generate any output on disk.
1264      */
1265     interface CompileOnSaveAffectedFileListRequest extends FileRequest {
1266         command: CommandTypes.CompileOnSaveAffectedFileList;
1267     }
1268     /**
1269      * Contains a list of files that should be regenerated in a project
1270      */
1271     interface CompileOnSaveAffectedFileListSingleProject {
1272         /**
1273          * Project name
1274          */
1275         projectFileName: string;
1276         /**
1277          * List of files names that should be recompiled
1278          */
1279         fileNames: string[];
1280         /**
1281          * true if project uses outFile or out compiler option
1282          */
1283         projectUsesOutFile: boolean;
1284     }
1285     /**
1286      * Response for CompileOnSaveAffectedFileListRequest request;
1287      */
1288     interface CompileOnSaveAffectedFileListResponse extends Response {
1289         body: CompileOnSaveAffectedFileListSingleProject[];
1290     }
1291     /**
1292      * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
1293      */
1294     interface CompileOnSaveEmitFileRequest extends FileRequest {
1295         command: CommandTypes.CompileOnSaveEmitFile;
1296         arguments: CompileOnSaveEmitFileRequestArgs;
1297     }
1298     /**
1299      * Arguments for CompileOnSaveEmitFileRequest
1300      */
1301     interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
1302         /**
1303          * if true - then file should be recompiled even if it does not have any changes.
1304          */
1305         forced?: boolean;
1306         includeLinePosition?: boolean;
1307         /** if true - return response as object with emitSkipped and diagnostics */
1308         richResponse?: boolean;
1309     }
1310     interface CompileOnSaveEmitFileResponse extends Response {
1311         body: boolean | EmitResult;
1312     }
1313     interface EmitResult {
1314         emitSkipped: boolean;
1315         diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
1316     }
1317     /**
1318      * Quickinfo request; value of command field is
1319      * "quickinfo". Return response giving a quick type and
1320      * documentation string for the symbol found in file at location
1321      * line, col.
1322      */
1323     interface QuickInfoRequest extends FileLocationRequest {
1324         command: CommandTypes.Quickinfo;
1325     }
1326     /**
1327      * Body of QuickInfoResponse.
1328      */
1329     interface QuickInfoResponseBody {
1330         /**
1331          * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1332          */
1333         kind: ScriptElementKind;
1334         /**
1335          * Optional modifiers for the kind (such as 'public').
1336          */
1337         kindModifiers: string;
1338         /**
1339          * Starting file location of symbol.
1340          */
1341         start: Location;
1342         /**
1343          * One past last character of symbol.
1344          */
1345         end: Location;
1346         /**
1347          * Type and kind of symbol.
1348          */
1349         displayString: string;
1350         /**
1351          * Documentation associated with symbol.
1352          */
1353         documentation: string;
1354         /**
1355          * JSDoc tags associated with symbol.
1356          */
1357         tags: JSDocTagInfo[];
1358     }
1359     /**
1360      * Quickinfo response message.
1361      */
1362     interface QuickInfoResponse extends Response {
1363         body?: QuickInfoResponseBody;
1364     }
1365     /**
1366      * Arguments for format messages.
1367      */
1368     interface FormatRequestArgs extends FileLocationRequestArgs {
1369         /**
1370          * Last line of range for which to format text in file.
1371          */
1372         endLine: number;
1373         /**
1374          * Character offset on last line of range for which to format text in file.
1375          */
1376         endOffset: number;
1377         /**
1378          * Format options to be used.
1379          */
1380         options?: FormatCodeSettings;
1381     }
1382     /**
1383      * Format request; value of command field is "format".  Return
1384      * response giving zero or more edit instructions.  The edit
1385      * instructions will be sorted in file order.  Applying the edit
1386      * instructions in reverse to file will result in correctly
1387      * reformatted text.
1388      */
1389     interface FormatRequest extends FileLocationRequest {
1390         command: CommandTypes.Format;
1391         arguments: FormatRequestArgs;
1392     }
1393     /**
1394      * Object found in response messages defining an editing
1395      * instruction for a span of text in source code.  The effect of
1396      * this instruction is to replace the text starting at start and
1397      * ending one character before end with newText. For an insertion,
1398      * the text span is empty.  For a deletion, newText is empty.
1399      */
1400     interface CodeEdit {
1401         /**
1402          * First character of the text span to edit.
1403          */
1404         start: Location;
1405         /**
1406          * One character past last character of the text span to edit.
1407          */
1408         end: Location;
1409         /**
1410          * Replace the span defined above with this string (may be
1411          * the empty string).
1412          */
1413         newText: string;
1414     }
1415     interface FileCodeEdits {
1416         fileName: string;
1417         textChanges: CodeEdit[];
1418     }
1419     interface CodeFixResponse extends Response {
1420         /** The code actions that are available */
1421         body?: CodeFixAction[];
1422     }
1423     interface CodeAction {
1424         /** Description of the code action to display in the UI of the editor */
1425         description: string;
1426         /** Text changes to apply to each file as part of the code action */
1427         changes: FileCodeEdits[];
1428         /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification.  */
1429         commands?: {}[];
1430     }
1431     interface CombinedCodeActions {
1432         changes: readonly FileCodeEdits[];
1433         commands?: readonly {}[];
1434     }
1435     interface CodeFixAction extends CodeAction {
1436         /** Short name to identify the fix, for use by telemetry. */
1437         fixName: string;
1438         /**
1439          * If present, one may call 'getCombinedCodeFix' with this fixId.
1440          * This may be omitted to indicate that the code fix can't be applied in a group.
1441          */
1442         fixId?: {};
1443         /** Should be present if and only if 'fixId' is. */
1444         fixAllDescription?: string;
1445     }
1446     /**
1447      * Format and format on key response message.
1448      */
1449     interface FormatResponse extends Response {
1450         body?: CodeEdit[];
1451     }
1452     /**
1453      * Arguments for format on key messages.
1454      */
1455     interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
1456         /**
1457          * Key pressed (';', '\n', or '}').
1458          */
1459         key: string;
1460         options?: FormatCodeSettings;
1461     }
1462     /**
1463      * Format on key request; value of command field is
1464      * "formatonkey". Given file location and key typed (as string),
1465      * return response giving zero or more edit instructions.  The
1466      * edit instructions will be sorted in file order.  Applying the
1467      * edit instructions in reverse to file will result in correctly
1468      * reformatted text.
1469      */
1470     interface FormatOnKeyRequest extends FileLocationRequest {
1471         command: CommandTypes.Formatonkey;
1472         arguments: FormatOnKeyRequestArgs;
1473     }
1474     type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#";
1475     /**
1476      * Arguments for completions messages.
1477      */
1478     interface CompletionsRequestArgs extends FileLocationRequestArgs {
1479         /**
1480          * Optional prefix to apply to possible completions.
1481          */
1482         prefix?: string;
1483         /**
1484          * Character that was responsible for triggering completion.
1485          * Should be `undefined` if a user manually requested completion.
1486          */
1487         triggerCharacter?: CompletionsTriggerCharacter;
1488         /**
1489          * @deprecated Use UserPreferences.includeCompletionsForModuleExports
1490          */
1491         includeExternalModuleExports?: boolean;
1492         /**
1493          * @deprecated Use UserPreferences.includeCompletionsWithInsertText
1494          */
1495         includeInsertTextCompletions?: boolean;
1496     }
1497     /**
1498      * Completions request; value of command field is "completions".
1499      * Given a file location (file, line, col) and a prefix (which may
1500      * be the empty string), return the possible completions that
1501      * begin with prefix.
1502      */
1503     interface CompletionsRequest extends FileLocationRequest {
1504         command: CommandTypes.Completions | CommandTypes.CompletionInfo;
1505         arguments: CompletionsRequestArgs;
1506     }
1507     /**
1508      * Arguments for completion details request.
1509      */
1510     interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
1511         /**
1512          * Names of one or more entries for which to obtain details.
1513          */
1514         entryNames: (string | CompletionEntryIdentifier)[];
1515     }
1516     interface CompletionEntryIdentifier {
1517         name: string;
1518         source?: string;
1519     }
1520     /**
1521      * Completion entry details request; value of command field is
1522      * "completionEntryDetails".  Given a file location (file, line,
1523      * col) and an array of completion entry names return more
1524      * detailed information for each completion entry.
1525      */
1526     interface CompletionDetailsRequest extends FileLocationRequest {
1527         command: CommandTypes.CompletionDetails;
1528         arguments: CompletionDetailsRequestArgs;
1529     }
1530     /**
1531      * Part of a symbol description.
1532      */
1533     interface SymbolDisplayPart {
1534         /**
1535          * Text of an item describing the symbol.
1536          */
1537         text: string;
1538         /**
1539          * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1540          */
1541         kind: string;
1542     }
1543     /**
1544      * An item found in a completion response.
1545      */
1546     interface CompletionEntry {
1547         /**
1548          * The symbol's name.
1549          */
1550         name: string;
1551         /**
1552          * The symbol's kind (such as 'className' or 'parameterName').
1553          */
1554         kind: ScriptElementKind;
1555         /**
1556          * Optional modifiers for the kind (such as 'public').
1557          */
1558         kindModifiers?: string;
1559         /**
1560          * A string that is used for comparing completion items so that they can be ordered.  This
1561          * is often the same as the name but may be different in certain circumstances.
1562          */
1563         sortText: string;
1564         /**
1565          * Text to insert instead of `name`.
1566          * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
1567          * coupled with `replacementSpan` to replace a dotted access with a bracket access.
1568          */
1569         insertText?: string;
1570         /**
1571          * An optional span that indicates the text to be replaced by this completion item.
1572          * If present, this span should be used instead of the default one.
1573          * It will be set if the required span differs from the one generated by the default replacement behavior.
1574          */
1575         replacementSpan?: TextSpan;
1576         /**
1577          * Indicates whether commiting this completion entry will require additional code actions to be
1578          * made to avoid errors. The CompletionEntryDetails will have these actions.
1579          */
1580         hasAction?: true;
1581         /**
1582          * Identifier (not necessarily human-readable) identifying where this completion came from.
1583          */
1584         source?: string;
1585         /**
1586          * If true, this completion should be highlighted as recommended. There will only be one of these.
1587          * 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.
1588          * Then either that enum/class or a namespace containing it will be the recommended symbol.
1589          */
1590         isRecommended?: true;
1591         /**
1592          * If true, this completion was generated from traversing the name table of an unchecked JS file,
1593          * and therefore may not be accurate.
1594          */
1595         isFromUncheckedFile?: true;
1596     }
1597     /**
1598      * Additional completion entry details, available on demand
1599      */
1600     interface CompletionEntryDetails {
1601         /**
1602          * The symbol's name.
1603          */
1604         name: string;
1605         /**
1606          * The symbol's kind (such as 'className' or 'parameterName').
1607          */
1608         kind: ScriptElementKind;
1609         /**
1610          * Optional modifiers for the kind (such as 'public').
1611          */
1612         kindModifiers: string;
1613         /**
1614          * Display parts of the symbol (similar to quick info).
1615          */
1616         displayParts: SymbolDisplayPart[];
1617         /**
1618          * Documentation strings for the symbol.
1619          */
1620         documentation?: SymbolDisplayPart[];
1621         /**
1622          * JSDoc tags for the symbol.
1623          */
1624         tags?: JSDocTagInfo[];
1625         /**
1626          * The associated code actions for this entry
1627          */
1628         codeActions?: CodeAction[];
1629         /**
1630          * Human-readable description of the `source` from the CompletionEntry.
1631          */
1632         source?: SymbolDisplayPart[];
1633     }
1634     /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
1635     interface CompletionsResponse extends Response {
1636         body?: CompletionEntry[];
1637     }
1638     interface CompletionInfoResponse extends Response {
1639         body?: CompletionInfo;
1640     }
1641     interface CompletionInfo {
1642         readonly isGlobalCompletion: boolean;
1643         readonly isMemberCompletion: boolean;
1644         readonly isNewIdentifierLocation: boolean;
1645         readonly entries: readonly CompletionEntry[];
1646     }
1647     interface CompletionDetailsResponse extends Response {
1648         body?: CompletionEntryDetails[];
1649     }
1650     /**
1651      * Signature help information for a single parameter
1652      */
1653     interface SignatureHelpParameter {
1654         /**
1655          * The parameter's name
1656          */
1657         name: string;
1658         /**
1659          * Documentation of the parameter.
1660          */
1661         documentation: SymbolDisplayPart[];
1662         /**
1663          * Display parts of the parameter.
1664          */
1665         displayParts: SymbolDisplayPart[];
1666         /**
1667          * Whether the parameter is optional or not.
1668          */
1669         isOptional: boolean;
1670     }
1671     /**
1672      * Represents a single signature to show in signature help.
1673      */
1674     interface SignatureHelpItem {
1675         /**
1676          * Whether the signature accepts a variable number of arguments.
1677          */
1678         isVariadic: boolean;
1679         /**
1680          * The prefix display parts.
1681          */
1682         prefixDisplayParts: SymbolDisplayPart[];
1683         /**
1684          * The suffix display parts.
1685          */
1686         suffixDisplayParts: SymbolDisplayPart[];
1687         /**
1688          * The separator display parts.
1689          */
1690         separatorDisplayParts: SymbolDisplayPart[];
1691         /**
1692          * The signature helps items for the parameters.
1693          */
1694         parameters: SignatureHelpParameter[];
1695         /**
1696          * The signature's documentation
1697          */
1698         documentation: SymbolDisplayPart[];
1699         /**
1700          * The signature's JSDoc tags
1701          */
1702         tags: JSDocTagInfo[];
1703     }
1704     /**
1705      * Signature help items found in the response of a signature help request.
1706      */
1707     interface SignatureHelpItems {
1708         /**
1709          * The signature help items.
1710          */
1711         items: SignatureHelpItem[];
1712         /**
1713          * The span for which signature help should appear on a signature
1714          */
1715         applicableSpan: TextSpan;
1716         /**
1717          * The item selected in the set of available help items.
1718          */
1719         selectedItemIndex: number;
1720         /**
1721          * The argument selected in the set of parameters.
1722          */
1723         argumentIndex: number;
1724         /**
1725          * The argument count
1726          */
1727         argumentCount: number;
1728     }
1729     type SignatureHelpTriggerCharacter = "," | "(" | "<";
1730     type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
1731     /**
1732      * Arguments of a signature help request.
1733      */
1734     interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
1735         /**
1736          * Reason why signature help was invoked.
1737          * See each individual possible
1738          */
1739         triggerReason?: SignatureHelpTriggerReason;
1740     }
1741     type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
1742     /**
1743      * Signals that the user manually requested signature help.
1744      * The language service will unconditionally attempt to provide a result.
1745      */
1746     interface SignatureHelpInvokedReason {
1747         kind: "invoked";
1748         triggerCharacter?: undefined;
1749     }
1750     /**
1751      * Signals that the signature help request came from a user typing a character.
1752      * Depending on the character and the syntactic context, the request may or may not be served a result.
1753      */
1754     interface SignatureHelpCharacterTypedReason {
1755         kind: "characterTyped";
1756         /**
1757          * Character that was responsible for triggering signature help.
1758          */
1759         triggerCharacter: SignatureHelpTriggerCharacter;
1760     }
1761     /**
1762      * Signals that this signature help request came from typing a character or moving the cursor.
1763      * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
1764      * The language service will unconditionally attempt to provide a result.
1765      * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
1766      */
1767     interface SignatureHelpRetriggeredReason {
1768         kind: "retrigger";
1769         /**
1770          * Character that was responsible for triggering signature help.
1771          */
1772         triggerCharacter?: SignatureHelpRetriggerCharacter;
1773     }
1774     /**
1775      * Signature help request; value of command field is "signatureHelp".
1776      * Given a file location (file, line, col), return the signature
1777      * help.
1778      */
1779     interface SignatureHelpRequest extends FileLocationRequest {
1780         command: CommandTypes.SignatureHelp;
1781         arguments: SignatureHelpRequestArgs;
1782     }
1783     /**
1784      * Response object for a SignatureHelpRequest.
1785      */
1786     interface SignatureHelpResponse extends Response {
1787         body?: SignatureHelpItems;
1788     }
1789     /**
1790      * Synchronous request for semantic diagnostics of one file.
1791      */
1792     interface SemanticDiagnosticsSyncRequest extends FileRequest {
1793         command: CommandTypes.SemanticDiagnosticsSync;
1794         arguments: SemanticDiagnosticsSyncRequestArgs;
1795     }
1796     interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
1797         includeLinePosition?: boolean;
1798     }
1799     /**
1800      * Response object for synchronous sematic diagnostics request.
1801      */
1802     interface SemanticDiagnosticsSyncResponse extends Response {
1803         body?: Diagnostic[] | DiagnosticWithLinePosition[];
1804     }
1805     interface SuggestionDiagnosticsSyncRequest extends FileRequest {
1806         command: CommandTypes.SuggestionDiagnosticsSync;
1807         arguments: SuggestionDiagnosticsSyncRequestArgs;
1808     }
1809     type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
1810     type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
1811     /**
1812      * Synchronous request for syntactic diagnostics of one file.
1813      */
1814     interface SyntacticDiagnosticsSyncRequest extends FileRequest {
1815         command: CommandTypes.SyntacticDiagnosticsSync;
1816         arguments: SyntacticDiagnosticsSyncRequestArgs;
1817     }
1818     interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
1819         includeLinePosition?: boolean;
1820     }
1821     /**
1822      * Response object for synchronous syntactic diagnostics request.
1823      */
1824     interface SyntacticDiagnosticsSyncResponse extends Response {
1825         body?: Diagnostic[] | DiagnosticWithLinePosition[];
1826     }
1827     /**
1828      * Arguments for GeterrForProject request.
1829      */
1830     interface GeterrForProjectRequestArgs {
1831         /**
1832          * the file requesting project error list
1833          */
1834         file: string;
1835         /**
1836          * Delay in milliseconds to wait before starting to compute
1837          * errors for the files in the file list
1838          */
1839         delay: number;
1840     }
1841     /**
1842      * GeterrForProjectRequest request; value of command field is
1843      * "geterrForProject". It works similarly with 'Geterr', only
1844      * it request for every file in this project.
1845      */
1846     interface GeterrForProjectRequest extends Request {
1847         command: CommandTypes.GeterrForProject;
1848         arguments: GeterrForProjectRequestArgs;
1849     }
1850     /**
1851      * Arguments for geterr messages.
1852      */
1853     interface GeterrRequestArgs {
1854         /**
1855          * List of file names for which to compute compiler errors.
1856          * The files will be checked in list order.
1857          */
1858         files: string[];
1859         /**
1860          * Delay in milliseconds to wait before starting to compute
1861          * errors for the files in the file list
1862          */
1863         delay: number;
1864     }
1865     /**
1866      * Geterr request; value of command field is "geterr". Wait for
1867      * delay milliseconds and then, if during the wait no change or
1868      * reload messages have arrived for the first file in the files
1869      * list, get the syntactic errors for the file, field requests,
1870      * and then get the semantic errors for the file.  Repeat with a
1871      * smaller delay for each subsequent file on the files list.  Best
1872      * practice for an editor is to send a file list containing each
1873      * file that is currently visible, in most-recently-used order.
1874      */
1875     interface GeterrRequest extends Request {
1876         command: CommandTypes.Geterr;
1877         arguments: GeterrRequestArgs;
1878     }
1879     type RequestCompletedEventName = "requestCompleted";
1880     /**
1881      * Event that is sent when server have finished processing request with specified id.
1882      */
1883     interface RequestCompletedEvent extends Event {
1884         event: RequestCompletedEventName;
1885         body: RequestCompletedEventBody;
1886     }
1887     interface RequestCompletedEventBody {
1888         request_seq: number;
1889     }
1890     /**
1891      * Item of diagnostic information found in a DiagnosticEvent message.
1892      */
1893     interface Diagnostic {
1894         /**
1895          * Starting file location at which text applies.
1896          */
1897         start: Location;
1898         /**
1899          * The last file location at which the text applies.
1900          */
1901         end: Location;
1902         /**
1903          * Text of diagnostic message.
1904          */
1905         text: string;
1906         /**
1907          * The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
1908          */
1909         category: string;
1910         reportsUnnecessary?: {};
1911         /**
1912          * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
1913          */
1914         relatedInformation?: DiagnosticRelatedInformation[];
1915         /**
1916          * The error code of the diagnostic message.
1917          */
1918         code?: number;
1919         /**
1920          * The name of the plugin reporting the message.
1921          */
1922         source?: string;
1923     }
1924     interface DiagnosticWithFileName extends Diagnostic {
1925         /**
1926          * Name of the file the diagnostic is in
1927          */
1928         fileName: string;
1929     }
1930     /**
1931      * Represents additional spans returned with a diagnostic which are relevant to it
1932      */
1933     interface DiagnosticRelatedInformation {
1934         /**
1935          * The category of the related information message, e.g. "error", "warning", or "suggestion".
1936          */
1937         category: string;
1938         /**
1939          * The code used ot identify the related information
1940          */
1941         code: number;
1942         /**
1943          * Text of related or additional information.
1944          */
1945         message: string;
1946         /**
1947          * Associated location
1948          */
1949         span?: FileSpan;
1950     }
1951     interface DiagnosticEventBody {
1952         /**
1953          * The file for which diagnostic information is reported.
1954          */
1955         file: string;
1956         /**
1957          * An array of diagnostic information items.
1958          */
1959         diagnostics: Diagnostic[];
1960     }
1961     type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
1962     /**
1963      * Event message for DiagnosticEventKind event types.
1964      * These events provide syntactic and semantic errors for a file.
1965      */
1966     interface DiagnosticEvent extends Event {
1967         body?: DiagnosticEventBody;
1968         event: DiagnosticEventKind;
1969     }
1970     interface ConfigFileDiagnosticEventBody {
1971         /**
1972          * The file which trigged the searching and error-checking of the config file
1973          */
1974         triggerFile: string;
1975         /**
1976          * The name of the found config file.
1977          */
1978         configFile: string;
1979         /**
1980          * An arry of diagnostic information items for the found config file.
1981          */
1982         diagnostics: DiagnosticWithFileName[];
1983     }
1984     /**
1985      * Event message for "configFileDiag" event type.
1986      * This event provides errors for a found config file.
1987      */
1988     interface ConfigFileDiagnosticEvent extends Event {
1989         body?: ConfigFileDiagnosticEventBody;
1990         event: "configFileDiag";
1991     }
1992     type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
1993     interface ProjectLanguageServiceStateEvent extends Event {
1994         event: ProjectLanguageServiceStateEventName;
1995         body?: ProjectLanguageServiceStateEventBody;
1996     }
1997     interface ProjectLanguageServiceStateEventBody {
1998         /**
1999          * Project name that has changes in the state of language service.
2000          * For configured projects this will be the config file path.
2001          * For external projects this will be the name of the projects specified when project was open.
2002          * For inferred projects this event is not raised.
2003          */
2004         projectName: string;
2005         /**
2006          * True if language service state switched from disabled to enabled
2007          * and false otherwise.
2008          */
2009         languageServiceEnabled: boolean;
2010     }
2011     type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
2012     interface ProjectsUpdatedInBackgroundEvent extends Event {
2013         event: ProjectsUpdatedInBackgroundEventName;
2014         body: ProjectsUpdatedInBackgroundEventBody;
2015     }
2016     interface ProjectsUpdatedInBackgroundEventBody {
2017         /**
2018          * Current set of open files
2019          */
2020         openFiles: string[];
2021     }
2022     type ProjectLoadingStartEventName = "projectLoadingStart";
2023     interface ProjectLoadingStartEvent extends Event {
2024         event: ProjectLoadingStartEventName;
2025         body: ProjectLoadingStartEventBody;
2026     }
2027     interface ProjectLoadingStartEventBody {
2028         /** name of the project */
2029         projectName: string;
2030         /** reason for loading */
2031         reason: string;
2032     }
2033     type ProjectLoadingFinishEventName = "projectLoadingFinish";
2034     interface ProjectLoadingFinishEvent extends Event {
2035         event: ProjectLoadingFinishEventName;
2036         body: ProjectLoadingFinishEventBody;
2037     }
2038     interface ProjectLoadingFinishEventBody {
2039         /** name of the project */
2040         projectName: string;
2041     }
2042     type SurveyReadyEventName = "surveyReady";
2043     interface SurveyReadyEvent extends Event {
2044         event: SurveyReadyEventName;
2045         body: SurveyReadyEventBody;
2046     }
2047     interface SurveyReadyEventBody {
2048         /** Name of the survey. This is an internal machine- and programmer-friendly name */
2049         surveyId: string;
2050     }
2051     type LargeFileReferencedEventName = "largeFileReferenced";
2052     interface LargeFileReferencedEvent extends Event {
2053         event: LargeFileReferencedEventName;
2054         body: LargeFileReferencedEventBody;
2055     }
2056     interface LargeFileReferencedEventBody {
2057         /**
2058          * name of the large file being loaded
2059          */
2060         file: string;
2061         /**
2062          * size of the file
2063          */
2064         fileSize: number;
2065         /**
2066          * max file size allowed on the server
2067          */
2068         maxFileSize: number;
2069     }
2070     /**
2071      * Arguments for reload request.
2072      */
2073     interface ReloadRequestArgs extends FileRequestArgs {
2074         /**
2075          * Name of temporary file from which to reload file
2076          * contents. May be same as file.
2077          */
2078         tmpfile: string;
2079     }
2080     /**
2081      * Reload request message; value of command field is "reload".
2082      * Reload contents of file with name given by the 'file' argument
2083      * from temporary file with name given by the 'tmpfile' argument.
2084      * The two names can be identical.
2085      */
2086     interface ReloadRequest extends FileRequest {
2087         command: CommandTypes.Reload;
2088         arguments: ReloadRequestArgs;
2089     }
2090     /**
2091      * Response to "reload" request. This is just an acknowledgement, so
2092      * no body field is required.
2093      */
2094     interface ReloadResponse extends Response {
2095     }
2096     /**
2097      * Arguments for saveto request.
2098      */
2099     interface SavetoRequestArgs extends FileRequestArgs {
2100         /**
2101          * Name of temporary file into which to save server's view of
2102          * file contents.
2103          */
2104         tmpfile: string;
2105     }
2106     /**
2107      * Saveto request message; value of command field is "saveto".
2108      * For debugging purposes, save to a temporaryfile (named by
2109      * argument 'tmpfile') the contents of file named by argument
2110      * 'file'.  The server does not currently send a response to a
2111      * "saveto" request.
2112      */
2113     interface SavetoRequest extends FileRequest {
2114         command: CommandTypes.Saveto;
2115         arguments: SavetoRequestArgs;
2116     }
2117     /**
2118      * Arguments for navto request message.
2119      */
2120     interface NavtoRequestArgs {
2121         /**
2122          * Search term to navigate to from current location; term can
2123          * be '.*' or an identifier prefix.
2124          */
2125         searchValue: string;
2126         /**
2127          *  Optional limit on the number of items to return.
2128          */
2129         maxResultCount?: number;
2130         /**
2131          * The file for the request (absolute pathname required).
2132          */
2133         file?: string;
2134         /**
2135          * Optional flag to indicate we want results for just the current file
2136          * or the entire project.
2137          */
2138         currentFileOnly?: boolean;
2139         projectFileName?: string;
2140     }
2141     /**
2142      * Navto request message; value of command field is "navto".
2143      * Return list of objects giving file locations and symbols that
2144      * match the search term given in argument 'searchTerm'.  The
2145      * context for the search is given by the named file.
2146      */
2147     interface NavtoRequest extends Request {
2148         command: CommandTypes.Navto;
2149         arguments: NavtoRequestArgs;
2150     }
2151     /**
2152      * An item found in a navto response.
2153      */
2154     interface NavtoItem extends FileSpan {
2155         /**
2156          * The symbol's name.
2157          */
2158         name: string;
2159         /**
2160          * The symbol's kind (such as 'className' or 'parameterName').
2161          */
2162         kind: ScriptElementKind;
2163         /**
2164          * exact, substring, or prefix.
2165          */
2166         matchKind: string;
2167         /**
2168          * If this was a case sensitive or insensitive match.
2169          */
2170         isCaseSensitive: boolean;
2171         /**
2172          * Optional modifiers for the kind (such as 'public').
2173          */
2174         kindModifiers?: string;
2175         /**
2176          * Name of symbol's container symbol (if any); for example,
2177          * the class name if symbol is a class member.
2178          */
2179         containerName?: string;
2180         /**
2181          * Kind of symbol's container symbol (if any).
2182          */
2183         containerKind?: ScriptElementKind;
2184     }
2185     /**
2186      * Navto response message. Body is an array of navto items.  Each
2187      * item gives a symbol that matched the search term.
2188      */
2189     interface NavtoResponse extends Response {
2190         body?: NavtoItem[];
2191     }
2192     /**
2193      * Arguments for change request message.
2194      */
2195     interface ChangeRequestArgs extends FormatRequestArgs {
2196         /**
2197          * Optional string to insert at location (file, line, offset).
2198          */
2199         insertString?: string;
2200     }
2201     /**
2202      * Change request message; value of command field is "change".
2203      * Update the server's view of the file named by argument 'file'.
2204      * Server does not currently send a response to a change request.
2205      */
2206     interface ChangeRequest extends FileLocationRequest {
2207         command: CommandTypes.Change;
2208         arguments: ChangeRequestArgs;
2209     }
2210     /**
2211      * Response to "brace" request.
2212      */
2213     interface BraceResponse extends Response {
2214         body?: TextSpan[];
2215     }
2216     /**
2217      * Brace matching request; value of command field is "brace".
2218      * Return response giving the file locations of matching braces
2219      * found in file at location line, offset.
2220      */
2221     interface BraceRequest extends FileLocationRequest {
2222         command: CommandTypes.Brace;
2223     }
2224     /**
2225      * NavBar items request; value of command field is "navbar".
2226      * Return response giving the list of navigation bar entries
2227      * extracted from the requested file.
2228      */
2229     interface NavBarRequest extends FileRequest {
2230         command: CommandTypes.NavBar;
2231     }
2232     /**
2233      * NavTree request; value of command field is "navtree".
2234      * Return response giving the navigation tree of the requested file.
2235      */
2236     interface NavTreeRequest extends FileRequest {
2237         command: CommandTypes.NavTree;
2238     }
2239     interface NavigationBarItem {
2240         /**
2241          * The item's display text.
2242          */
2243         text: string;
2244         /**
2245          * The symbol's kind (such as 'className' or 'parameterName').
2246          */
2247         kind: ScriptElementKind;
2248         /**
2249          * Optional modifiers for the kind (such as 'public').
2250          */
2251         kindModifiers?: string;
2252         /**
2253          * The definition locations of the item.
2254          */
2255         spans: TextSpan[];
2256         /**
2257          * Optional children.
2258          */
2259         childItems?: NavigationBarItem[];
2260         /**
2261          * Number of levels deep this item should appear.
2262          */
2263         indent: number;
2264     }
2265     /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
2266     interface NavigationTree {
2267         text: string;
2268         kind: ScriptElementKind;
2269         kindModifiers: string;
2270         spans: TextSpan[];
2271         nameSpan: TextSpan | undefined;
2272         childItems?: NavigationTree[];
2273     }
2274     type TelemetryEventName = "telemetry";
2275     interface TelemetryEvent extends Event {
2276         event: TelemetryEventName;
2277         body: TelemetryEventBody;
2278     }
2279     interface TelemetryEventBody {
2280         telemetryEventName: string;
2281         payload: any;
2282     }
2283     type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
2284     interface TypesInstallerInitializationFailedEvent extends Event {
2285         event: TypesInstallerInitializationFailedEventName;
2286         body: TypesInstallerInitializationFailedEventBody;
2287     }
2288     interface TypesInstallerInitializationFailedEventBody {
2289         message: string;
2290     }
2291     type TypingsInstalledTelemetryEventName = "typingsInstalled";
2292     interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
2293         telemetryEventName: TypingsInstalledTelemetryEventName;
2294         payload: TypingsInstalledTelemetryEventPayload;
2295     }
2296     interface TypingsInstalledTelemetryEventPayload {
2297         /**
2298          * Comma separated list of installed typing packages
2299          */
2300         installedPackages: string;
2301         /**
2302          * true if install request succeeded, otherwise - false
2303          */
2304         installSuccess: boolean;
2305         /**
2306          * version of typings installer
2307          */
2308         typingsInstallerVersion: string;
2309     }
2310     type BeginInstallTypesEventName = "beginInstallTypes";
2311     type EndInstallTypesEventName = "endInstallTypes";
2312     interface BeginInstallTypesEvent extends Event {
2313         event: BeginInstallTypesEventName;
2314         body: BeginInstallTypesEventBody;
2315     }
2316     interface EndInstallTypesEvent extends Event {
2317         event: EndInstallTypesEventName;
2318         body: EndInstallTypesEventBody;
2319     }
2320     interface InstallTypesEventBody {
2321         /**
2322          * correlation id to match begin and end events
2323          */
2324         eventId: number;
2325         /**
2326          * list of packages to install
2327          */
2328         packages: readonly string[];
2329     }
2330     interface BeginInstallTypesEventBody extends InstallTypesEventBody {
2331     }
2332     interface EndInstallTypesEventBody extends InstallTypesEventBody {
2333         /**
2334          * true if installation succeeded, otherwise false
2335          */
2336         success: boolean;
2337     }
2338     interface NavBarResponse extends Response {
2339         body?: NavigationBarItem[];
2340     }
2341     interface NavTreeResponse extends Response {
2342         body?: NavigationTree;
2343     }
2344     interface CallHierarchyItem {
2345         name: string;
2346         kind: ScriptElementKind;
2347         file: string;
2348         span: TextSpan;
2349         selectionSpan: TextSpan;
2350     }
2351     interface CallHierarchyIncomingCall {
2352         from: CallHierarchyItem;
2353         fromSpans: TextSpan[];
2354     }
2355     interface CallHierarchyOutgoingCall {
2356         to: CallHierarchyItem;
2357         fromSpans: TextSpan[];
2358     }
2359     interface PrepareCallHierarchyRequest extends FileLocationRequest {
2360         command: CommandTypes.PrepareCallHierarchy;
2361     }
2362     interface PrepareCallHierarchyResponse extends Response {
2363         readonly body: CallHierarchyItem | CallHierarchyItem[];
2364     }
2365     interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
2366         command: CommandTypes.ProvideCallHierarchyIncomingCalls;
2367     }
2368     interface ProvideCallHierarchyIncomingCallsResponse extends Response {
2369         readonly body: CallHierarchyIncomingCall[];
2370     }
2371     interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
2372         command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
2373     }
2374     interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
2375         readonly body: CallHierarchyOutgoingCall[];
2376     }
2377     const enum IndentStyle {
2378         None = "None",
2379         Block = "Block",
2380         Smart = "Smart"
2381     }
2382     enum SemicolonPreference {
2383         Ignore = "ignore",
2384         Insert = "insert",
2385         Remove = "remove"
2386     }
2387     interface EditorSettings {
2388         baseIndentSize?: number;
2389         indentSize?: number;
2390         tabSize?: number;
2391         newLineCharacter?: string;
2392         convertTabsToSpaces?: boolean;
2393         indentStyle?: IndentStyle | ts.IndentStyle;
2394         trimTrailingWhitespace?: boolean;
2395     }
2396     interface FormatCodeSettings extends EditorSettings {
2397         insertSpaceAfterCommaDelimiter?: boolean;
2398         insertSpaceAfterSemicolonInForStatements?: boolean;
2399         insertSpaceBeforeAndAfterBinaryOperators?: boolean;
2400         insertSpaceAfterConstructor?: boolean;
2401         insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
2402         insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
2403         insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
2404         insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
2405         insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
2406         insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
2407         insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
2408         insertSpaceAfterTypeAssertion?: boolean;
2409         insertSpaceBeforeFunctionParenthesis?: boolean;
2410         placeOpenBraceOnNewLineForFunctions?: boolean;
2411         placeOpenBraceOnNewLineForControlBlocks?: boolean;
2412         insertSpaceBeforeTypeAnnotation?: boolean;
2413         semicolons?: SemicolonPreference;
2414     }
2415     interface UserPreferences {
2416         readonly disableSuggestions?: boolean;
2417         readonly quotePreference?: "auto" | "double" | "single";
2418         /**
2419          * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
2420          * This affects lone identifier completions but not completions on the right hand side of `obj.`.
2421          */
2422         readonly includeCompletionsForModuleExports?: boolean;
2423         /**
2424          * If enabled, the completion list will include completions with invalid identifier names.
2425          * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
2426          */
2427         readonly includeCompletionsWithInsertText?: boolean;
2428         /**
2429          * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
2430          * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
2431          * values, with insertion text to replace preceding `.` tokens with `?.`.
2432          */
2433         readonly includeAutomaticOptionalChainCompletions?: boolean;
2434         readonly importModuleSpecifierPreference?: "auto" | "relative" | "non-relative";
2435         /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
2436         readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
2437         readonly allowTextChangesInNewFiles?: boolean;
2438         readonly lazyConfiguredProjectsFromExternalProject?: boolean;
2439         readonly providePrefixAndSuffixTextForRename?: boolean;
2440         readonly allowRenameOfImportPath?: boolean;
2441     }
2442     interface CompilerOptions {
2443         allowJs?: boolean;
2444         allowSyntheticDefaultImports?: boolean;
2445         allowUnreachableCode?: boolean;
2446         allowUnusedLabels?: boolean;
2447         alwaysStrict?: boolean;
2448         baseUrl?: string;
2449         charset?: string;
2450         checkJs?: boolean;
2451         declaration?: boolean;
2452         declarationDir?: string;
2453         disableSizeLimit?: boolean;
2454         downlevelIteration?: boolean;
2455         emitBOM?: boolean;
2456         emitDecoratorMetadata?: boolean;
2457         experimentalDecorators?: boolean;
2458         forceConsistentCasingInFileNames?: boolean;
2459         importHelpers?: boolean;
2460         inlineSourceMap?: boolean;
2461         inlineSources?: boolean;
2462         isolatedModules?: boolean;
2463         jsx?: JsxEmit | ts.JsxEmit;
2464         lib?: string[];
2465         locale?: string;
2466         mapRoot?: string;
2467         maxNodeModuleJsDepth?: number;
2468         module?: ModuleKind | ts.ModuleKind;
2469         moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
2470         newLine?: NewLineKind | ts.NewLineKind;
2471         noEmit?: boolean;
2472         noEmitHelpers?: boolean;
2473         noEmitOnError?: boolean;
2474         noErrorTruncation?: boolean;
2475         noFallthroughCasesInSwitch?: boolean;
2476         noImplicitAny?: boolean;
2477         noImplicitReturns?: boolean;
2478         noImplicitThis?: boolean;
2479         noUnusedLocals?: boolean;
2480         noUnusedParameters?: boolean;
2481         noImplicitUseStrict?: boolean;
2482         noLib?: boolean;
2483         noResolve?: boolean;
2484         out?: string;
2485         outDir?: string;
2486         outFile?: string;
2487         paths?: MapLike<string[]>;
2488         plugins?: PluginImport[];
2489         preserveConstEnums?: boolean;
2490         preserveSymlinks?: boolean;
2491         project?: string;
2492         reactNamespace?: string;
2493         removeComments?: boolean;
2494         references?: ProjectReference[];
2495         rootDir?: string;
2496         rootDirs?: string[];
2497         skipLibCheck?: boolean;
2498         skipDefaultLibCheck?: boolean;
2499         sourceMap?: boolean;
2500         sourceRoot?: string;
2501         strict?: boolean;
2502         strictNullChecks?: boolean;
2503         suppressExcessPropertyErrors?: boolean;
2504         suppressImplicitAnyIndexErrors?: boolean;
2505         useDefineForClassFields?: boolean;
2506         target?: ScriptTarget | ts.ScriptTarget;
2507         traceResolution?: boolean;
2508         resolveJsonModule?: boolean;
2509         types?: string[];
2510         /** Paths used to used to compute primary types search locations */
2511         typeRoots?: string[];
2512         [option: string]: CompilerOptionsValue | undefined;
2513     }
2514     const enum JsxEmit {
2515         None = "None",
2516         Preserve = "Preserve",
2517         ReactNative = "ReactNative",
2518         React = "React"
2519     }
2520     const enum ModuleKind {
2521         None = "None",
2522         CommonJS = "CommonJS",
2523         AMD = "AMD",
2524         UMD = "UMD",
2525         System = "System",
2526         ES6 = "ES6",
2527         ES2015 = "ES2015",
2528         ESNext = "ESNext"
2529     }
2530     const enum ModuleResolutionKind {
2531         Classic = "Classic",
2532         Node = "Node"
2533     }
2534     const enum NewLineKind {
2535         Crlf = "Crlf",
2536         Lf = "Lf"
2537     }
2538     const enum ScriptTarget {
2539         ES3 = "ES3",
2540         ES5 = "ES5",
2541         ES6 = "ES6",
2542         ES2015 = "ES2015",
2543         ES2016 = "ES2016",
2544         ES2017 = "ES2017",
2545         ES2018 = "ES2018",
2546         ES2019 = "ES2019",
2547         ES2020 = "ES2020",
2548         ESNext = "ESNext"
2549     }
2550 }
2551 declare namespace ts.server.protocol {
2552
2553     interface TextInsertion {
2554         newText: string;
2555         /** The position in newText the caret should point to after the insertion. */
2556         caretOffset: number;
2557     }
2558
2559     interface TodoCommentDescriptor {
2560         text: string;
2561         priority: number;
2562     }
2563
2564     interface TodoComment {
2565         descriptor: TodoCommentDescriptor;
2566         message: string;
2567         position: number;
2568     }
2569
2570     enum OutliningSpanKind {
2571         /** Single or multi-line comments */
2572         Comment = "comment",
2573         /** Sections marked by '// #region' and '// #endregion' comments */
2574         Region = "region",
2575         /** Declarations and expressions */
2576         Code = "code",
2577         /** Contiguous blocks of import declarations */
2578         Imports = "imports"
2579     }
2580
2581     enum HighlightSpanKind {
2582         none = "none",
2583         definition = "definition",
2584         reference = "reference",
2585         writtenReference = "writtenReference"
2586     }
2587
2588     enum ScriptElementKind {
2589         unknown = "",
2590         warning = "warning",
2591         /** predefined type (void) or keyword (class) */
2592         keyword = "keyword",
2593         /** top level script node */
2594         scriptElement = "script",
2595         /** module foo {} */
2596         moduleElement = "module",
2597         /** class X {} */
2598         classElement = "class",
2599         /** var x = class X {} */
2600         localClassElement = "local class",
2601         /** interface Y {} */
2602         interfaceElement = "interface",
2603         /** type T = ... */
2604         typeElement = "type",
2605         /** enum E */
2606         enumElement = "enum",
2607         enumMemberElement = "enum member",
2608         /**
2609          * Inside module and script only
2610          * const v = ..
2611          */
2612         variableElement = "var",
2613         /** Inside function */
2614         localVariableElement = "local var",
2615         /**
2616          * Inside module and script only
2617          * function f() { }
2618          */
2619         functionElement = "function",
2620         /** Inside function */
2621         localFunctionElement = "local function",
2622         /** class X { [public|private]* foo() {} } */
2623         memberFunctionElement = "method",
2624         /** class X { [public|private]* [get|set] foo:number; } */
2625         memberGetAccessorElement = "getter",
2626         memberSetAccessorElement = "setter",
2627         /**
2628          * class X { [public|private]* foo:number; }
2629          * interface Y { foo:number; }
2630          */
2631         memberVariableElement = "property",
2632         /** class X { constructor() { } } */
2633         constructorImplementationElement = "constructor",
2634         /** interface Y { ():number; } */
2635         callSignatureElement = "call",
2636         /** interface Y { []:number; } */
2637         indexSignatureElement = "index",
2638         /** interface Y { new():Y; } */
2639         constructSignatureElement = "construct",
2640         /** function foo(*Y*: string) */
2641         parameterElement = "parameter",
2642         typeParameterElement = "type parameter",
2643         primitiveType = "primitive type",
2644         label = "label",
2645         alias = "alias",
2646         constElement = "const",
2647         letElement = "let",
2648         directory = "directory",
2649         externalModuleName = "external module name",
2650         /**
2651          * <JsxTagName attribute1 attribute2={0} />
2652          */
2653         jsxAttribute = "JSX attribute",
2654         /** String literal */
2655         string = "string"
2656     }
2657
2658     export interface TypeAcquisition {
2659         /**
2660          * @deprecated typingOptions.enableAutoDiscovery
2661          * Use typeAcquisition.enable instead.
2662          */
2663         enableAutoDiscovery?: boolean;
2664         enable?: boolean;
2665         include?: string[];
2666         exclude?: string[];
2667         [option: string]: string[] | boolean | undefined;
2668     }
2669
2670     export interface FileExtensionInfo {
2671         extension: string;
2672         isMixedContent: boolean;
2673         scriptKind?: ScriptKind;
2674     }
2675
2676     export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
2677
2678     interface JSDocTagInfo {
2679         name: string;
2680         text?: string;
2681     }
2682
2683     /**
2684      * Type of objects whose values are all of the same type.
2685      * The `in` and `for-in` operators can *not* be safely used,
2686      * since `Object.prototype` may be modified by outside code.
2687      */
2688     interface MapLike<T> {
2689         [index: string]: T;
2690     }
2691
2692     export interface PluginImport {
2693         name: string;
2694     }
2695
2696     export interface ProjectReference {
2697         /** A normalized path on disk */
2698         path: string;
2699         /** The path as the user originally wrote it */
2700         originalPath?: string;
2701         /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
2702         prepend?: boolean;
2703         /** True if it is intended that this reference form a circularity */
2704         circular?: boolean;
2705     }
2706 }
2707 declare namespace ts {
2708     // these types are empty stubs for types from services and should not be used directly
2709     export type ScriptKind = never;
2710     export type WatchFileKind = never;
2711     export type WatchDirectoryKind = never;
2712     export type PollingWatchKind = never;
2713     export type IndentStyle = never;
2714     export type JsxEmit = never;
2715     export type ModuleKind = never;
2716     export type ModuleResolutionKind = never;
2717     export type NewLineKind = never;
2718     export type ScriptTarget = never;
2719 }
2720 import protocol = ts.server.protocol;
2721 export = protocol;
2722 export as namespace protocol;