• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* eslint-disable @typescript-eslint/no-unnecessary-qualifier */
2
3/**
4 * Declaration module describing the TypeScript Server protocol
5 */
6namespace ts.server.protocol {
7    // NOTE: If updating this, be sure to also update `allCommandNames` in `testRunner/unittests/tsserver/session.ts`.
8    export const enum CommandTypes {
9        JsxClosingTag = "jsxClosingTag",
10        Brace = "brace",
11        /* @internal */
12        BraceFull = "brace-full",
13        BraceCompletion = "braceCompletion",
14        GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
15        Change = "change",
16        Close = "close",
17        /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
18        Completions = "completions",
19        CompletionInfo = "completionInfo",
20        /* @internal */
21        CompletionsFull = "completions-full",
22        CompletionDetails = "completionEntryDetails",
23        /* @internal */
24        CompletionDetailsFull = "completionEntryDetails-full",
25        CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
26        CompileOnSaveEmitFile = "compileOnSaveEmitFile",
27        Configure = "configure",
28        Definition = "definition",
29        /* @internal */
30        DefinitionFull = "definition-full",
31        DefinitionAndBoundSpan = "definitionAndBoundSpan",
32        /* @internal */
33        DefinitionAndBoundSpanFull = "definitionAndBoundSpan-full",
34        Implementation = "implementation",
35        /* @internal */
36        ImplementationFull = "implementation-full",
37        /* @internal */
38        EmitOutput = "emit-output",
39        Exit = "exit",
40        FileReferences = "fileReferences",
41        /* @internal */
42        FileReferencesFull = "fileReferences-full",
43        Format = "format",
44        Formatonkey = "formatonkey",
45        /* @internal */
46        FormatFull = "format-full",
47        /* @internal */
48        FormatonkeyFull = "formatonkey-full",
49        /* @internal */
50        FormatRangeFull = "formatRange-full",
51        Geterr = "geterr",
52        GeterrForProject = "geterrForProject",
53        SemanticDiagnosticsSync = "semanticDiagnosticsSync",
54        SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",
55        SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",
56        NavBar = "navbar",
57        /* @internal */
58        NavBarFull = "navbar-full",
59        Navto = "navto",
60        /* @internal */
61        NavtoFull = "navto-full",
62        NavTree = "navtree",
63        NavTreeFull = "navtree-full",
64        /** @deprecated */
65        Occurrences = "occurrences",
66        DocumentHighlights = "documentHighlights",
67        /* @internal */
68        DocumentHighlightsFull = "documentHighlights-full",
69        Open = "open",
70        Quickinfo = "quickinfo",
71        /* @internal */
72        QuickinfoFull = "quickinfo-full",
73        References = "references",
74        /* @internal */
75        ReferencesFull = "references-full",
76        Reload = "reload",
77        Rename = "rename",
78        /* @internal */
79        RenameInfoFull = "rename-full",
80        /* @internal */
81        RenameLocationsFull = "renameLocations-full",
82        Saveto = "saveto",
83        SignatureHelp = "signatureHelp",
84        /* @internal */
85        SignatureHelpFull = "signatureHelp-full",
86        FindSourceDefinition = "findSourceDefinition",
87        Status = "status",
88        TypeDefinition = "typeDefinition",
89        ProjectInfo = "projectInfo",
90        ReloadProjects = "reloadProjects",
91        Unknown = "unknown",
92        OpenExternalProject = "openExternalProject",
93        OpenExternalProjects = "openExternalProjects",
94        CloseExternalProject = "closeExternalProject",
95        /* @internal */
96        SynchronizeProjectList = "synchronizeProjectList",
97        /* @internal */
98        ApplyChangedToOpenFiles = "applyChangedToOpenFiles",
99        UpdateOpen = "updateOpen",
100        /* @internal */
101        EncodedSyntacticClassificationsFull = "encodedSyntacticClassifications-full",
102        /* @internal */
103        EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full",
104        /* @internal */
105        Cleanup = "cleanup",
106        GetOutliningSpans = "getOutliningSpans",
107        /* @internal */
108        GetOutliningSpansFull = "outliningSpans", // Full command name is different for backward compatibility purposes
109        TodoComments = "todoComments",
110        Indentation = "indentation",
111        DocCommentTemplate = "docCommentTemplate",
112        /* @internal */
113        CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full",
114        /* @internal */
115        NameOrDottedNameSpan = "nameOrDottedNameSpan",
116        /* @internal */
117        BreakpointStatement = "breakpointStatement",
118        CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
119        GetCodeFixes = "getCodeFixes",
120        /* @internal */
121        GetCodeFixesFull = "getCodeFixes-full",
122        GetCombinedCodeFix = "getCombinedCodeFix",
123        /* @internal */
124        GetCombinedCodeFixFull = "getCombinedCodeFix-full",
125        ApplyCodeActionCommand = "applyCodeActionCommand",
126        GetSupportedCodeFixes = "getSupportedCodeFixes",
127
128        GetApplicableRefactors = "getApplicableRefactors",
129        GetEditsForRefactor = "getEditsForRefactor",
130        /* @internal */
131        GetEditsForRefactorFull = "getEditsForRefactor-full",
132
133        OrganizeImports = "organizeImports",
134        /* @internal */
135        OrganizeImportsFull = "organizeImports-full",
136        GetEditsForFileRename = "getEditsForFileRename",
137        /* @internal */
138        GetEditsForFileRenameFull = "getEditsForFileRename-full",
139        ConfigurePlugin = "configurePlugin",
140        SelectionRange = "selectionRange",
141        /* @internal */
142        SelectionRangeFull = "selectionRange-full",
143        ToggleLineComment = "toggleLineComment",
144        /* @internal */
145        ToggleLineCommentFull = "toggleLineComment-full",
146        ToggleMultilineComment = "toggleMultilineComment",
147        /* @internal */
148        ToggleMultilineCommentFull = "toggleMultilineComment-full",
149        CommentSelection = "commentSelection",
150        /* @internal */
151        CommentSelectionFull = "commentSelection-full",
152        UncommentSelection = "uncommentSelection",
153        /* @internal */
154        UncommentSelectionFull = "uncommentSelection-full",
155        PrepareCallHierarchy = "prepareCallHierarchy",
156        ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
157        ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
158        ProvideInlayHints = "provideInlayHints"
159
160        // NOTE: If updating this, be sure to also update `allCommandNames` in `testRunner/unittests/tsserver/session.ts`.
161    }
162
163    /**
164     * A TypeScript Server message
165     */
166    export interface Message {
167        /**
168         * Sequence number of the message
169         */
170        seq: number;
171
172        /**
173         * One of "request", "response", or "event"
174         */
175        type: "request" | "response" | "event";
176    }
177
178    /**
179     * Client-initiated request message
180     */
181    export interface Request extends Message {
182        type: "request";
183
184        /**
185         * The command to execute
186         */
187        command: string;
188
189        /**
190         * Object containing arguments for the command
191         */
192        arguments?: any;
193    }
194
195    /**
196     * Request to reload the project structure for all the opened files
197     */
198    export interface ReloadProjectsRequest extends Message {
199        command: CommandTypes.ReloadProjects;
200    }
201
202    /**
203     * Server-initiated event message
204     */
205    export interface Event extends Message {
206        type: "event";
207
208        /**
209         * Name of event
210         */
211        event: string;
212
213        /**
214         * Event-specific information
215         */
216        body?: any;
217    }
218
219    /**
220     * Response by server to client request message.
221     */
222    export interface Response extends Message {
223        type: "response";
224
225        /**
226         * Sequence number of the request message.
227         */
228        request_seq: number;
229
230        /**
231         * Outcome of the request.
232         */
233        success: boolean;
234
235        /**
236         * The command requested.
237         */
238        command: string;
239
240        /**
241         * If success === false, this should always be provided.
242         * Otherwise, may (or may not) contain a success message.
243         */
244        message?: string;
245
246        /**
247         * Contains message body if success === true.
248         */
249        body?: any;
250
251        /**
252         * Contains extra information that plugin can include to be passed on
253         */
254        metadata?: unknown;
255
256        /**
257         * Exposes information about the performance of this request-response pair.
258         */
259        performanceData?: PerformanceData;
260    }
261
262    export interface PerformanceData {
263        /**
264         * Time spent updating the program graph, in milliseconds.
265         */
266        updateGraphDurationMs?: number;
267        /**
268         * The time spent creating or updating the auto-import program, in milliseconds.
269         */
270        createAutoImportProviderProgramDurationMs?: number;
271    }
272
273    /**
274     * Arguments for FileRequest messages.
275     */
276    export interface FileRequestArgs {
277        /**
278         * The file for the request (absolute pathname required).
279         */
280        file: string;
281
282        /*
283        * Optional name of project that contains file
284        */
285        projectFileName?: string;
286    }
287
288    export interface StatusRequest extends Request {
289        command: CommandTypes.Status;
290    }
291
292    export interface StatusResponseBody {
293        /**
294         * The TypeScript version (`ts.version`).
295         */
296        version: string;
297    }
298
299    /**
300     * Response to StatusRequest
301     */
302    export interface StatusResponse extends Response {
303        body: StatusResponseBody;
304    }
305
306    /**
307     * Requests a JS Doc comment template for a given position
308     */
309    export interface DocCommentTemplateRequest extends FileLocationRequest {
310        command: CommandTypes.DocCommentTemplate;
311    }
312
313    /**
314     * Response to DocCommentTemplateRequest
315     */
316    export interface DocCommandTemplateResponse extends Response {
317        body?: TextInsertion;
318    }
319
320    /**
321     * A request to get TODO comments from the file
322     */
323    export interface TodoCommentRequest extends FileRequest {
324        command: CommandTypes.TodoComments;
325        arguments: TodoCommentRequestArgs;
326    }
327
328    /**
329     * Arguments for TodoCommentRequest request.
330     */
331    export interface TodoCommentRequestArgs extends FileRequestArgs {
332        /**
333         * Array of target TodoCommentDescriptors that describes TODO comments to be found
334         */
335        descriptors: TodoCommentDescriptor[];
336    }
337
338    /**
339     * Response for TodoCommentRequest request.
340     */
341    export interface TodoCommentsResponse extends Response {
342        body?: TodoComment[];
343    }
344
345    /**
346     * A request to determine if the caret is inside a comment.
347     */
348    export interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
349        command: CommandTypes.GetSpanOfEnclosingComment;
350        arguments: SpanOfEnclosingCommentRequestArgs;
351    }
352
353    export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
354        /**
355         * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
356         */
357        onlyMultiLine: boolean;
358    }
359
360    /**
361     * Request to obtain outlining spans in file.
362     */
363    export interface OutliningSpansRequest extends FileRequest {
364        command: CommandTypes.GetOutliningSpans;
365    }
366
367    export interface OutliningSpan {
368        /** The span of the document to actually collapse. */
369        textSpan: TextSpan;
370
371        /** The span of the document to display when the user hovers over the collapsed span. */
372        hintSpan: TextSpan;
373
374        /** The text to display in the editor for the collapsed region. */
375        bannerText: string;
376
377        /**
378         * Whether or not this region should be automatically collapsed when
379         * the 'Collapse to Definitions' command is invoked.
380         */
381        autoCollapse: boolean;
382
383        /**
384         * Classification of the contents of the span
385         */
386        kind: OutliningSpanKind;
387    }
388
389    /**
390     * Response to OutliningSpansRequest request.
391     */
392    export interface OutliningSpansResponse extends Response {
393        body?: OutliningSpan[];
394    }
395
396    /**
397     * Request to obtain outlining spans in file.
398     */
399    /* @internal */
400    export interface OutliningSpansRequestFull extends FileRequest {
401        command: CommandTypes.GetOutliningSpansFull;
402    }
403
404    /**
405     * Response to OutliningSpansRequest request.
406     */
407    /* @internal */
408    export interface OutliningSpansResponseFull extends Response {
409        body?: ts.OutliningSpan[];
410    }
411
412    /**
413     * A request to get indentation for a location in file
414     */
415    export interface IndentationRequest extends FileLocationRequest {
416        command: CommandTypes.Indentation;
417        arguments: IndentationRequestArgs;
418    }
419
420    /**
421     * Response for IndentationRequest request.
422     */
423    export interface IndentationResponse extends Response {
424        body?: IndentationResult;
425    }
426
427    /**
428     * Indentation result representing where indentation should be placed
429     */
430    export interface IndentationResult {
431        /**
432         * The base position in the document that the indent should be relative to
433         */
434        position: number;
435        /**
436         * The number of columns the indent should be at relative to the position's column.
437         */
438        indentation: number;
439    }
440
441    /**
442     * Arguments for IndentationRequest request.
443     */
444    export interface IndentationRequestArgs extends FileLocationRequestArgs {
445        /**
446         * An optional set of settings to be used when computing indentation.
447         * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
448         */
449        options?: EditorSettings;
450    }
451
452    /**
453     * Arguments for ProjectInfoRequest request.
454     */
455    export interface ProjectInfoRequestArgs extends FileRequestArgs {
456        /**
457         * Indicate if the file name list of the project is needed
458         */
459        needFileNameList: boolean;
460    }
461
462    /**
463     * A request to get the project information of the current file.
464     */
465    export interface ProjectInfoRequest extends Request {
466        command: CommandTypes.ProjectInfo;
467        arguments: ProjectInfoRequestArgs;
468    }
469
470    /**
471     * A request to retrieve compiler options diagnostics for a project
472     */
473    export interface CompilerOptionsDiagnosticsRequest extends Request {
474        arguments: CompilerOptionsDiagnosticsRequestArgs;
475    }
476
477    /**
478     * Arguments for CompilerOptionsDiagnosticsRequest request.
479     */
480    export interface CompilerOptionsDiagnosticsRequestArgs {
481        /**
482         * Name of the project to retrieve compiler options diagnostics.
483         */
484        projectFileName: string;
485    }
486
487    /**
488     * Response message body for "projectInfo" request
489     */
490    export interface ProjectInfo {
491        /**
492         * For configured project, this is the normalized path of the 'tsconfig.json' file
493         * For inferred project, this is undefined
494         */
495        configFileName: string;
496        /**
497         * The list of normalized file name in the project, including 'lib.d.ts'
498         */
499        fileNames?: string[];
500        /**
501         * Indicates if the project has a active language service instance
502         */
503        languageServiceDisabled?: boolean;
504    }
505
506    /**
507     * Represents diagnostic info that includes location of diagnostic in two forms
508     * - start position and length of the error span
509     * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
510     */
511    export interface DiagnosticWithLinePosition {
512        message: string;
513        start: number;
514        length: number;
515        startLocation: Location;
516        endLocation: Location;
517        category: string;
518        code: number;
519        /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
520        reportsUnnecessary?: {};
521        reportsDeprecated?: {};
522        relatedInformation?: DiagnosticRelatedInformation[];
523    }
524
525    /**
526     * Response message for "projectInfo" request
527     */
528    export interface ProjectInfoResponse extends Response {
529        body?: ProjectInfo;
530    }
531
532    /**
533     * Request whose sole parameter is a file name.
534     */
535    export interface FileRequest extends Request {
536        arguments: FileRequestArgs;
537    }
538
539    /**
540     * Instances of this interface specify a location in a source file:
541     * (file, line, character offset), where line and character offset are 1-based.
542     */
543    export interface FileLocationRequestArgs extends FileRequestArgs {
544        /**
545         * The line number for the request (1-based).
546         */
547        line: number;
548
549        /**
550         * The character offset (on the line) for the request (1-based).
551         */
552        offset: number;
553
554        /**
555         * Position (can be specified instead of line/offset pair)
556         */
557        /* @internal */
558        position?: number;
559    }
560
561    export type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
562
563    /**
564     * Request refactorings at a given position or selection area.
565     */
566    export interface GetApplicableRefactorsRequest extends Request {
567        command: CommandTypes.GetApplicableRefactors;
568        arguments: GetApplicableRefactorsRequestArgs;
569    }
570    export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
571        triggerReason?: RefactorTriggerReason;
572        kind?: string;
573    };
574
575    export type RefactorTriggerReason = "implicit" | "invoked";
576
577    /**
578     * Response is a list of available refactorings.
579     * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
580     */
581    export interface GetApplicableRefactorsResponse extends Response {
582        body?: ApplicableRefactorInfo[];
583    }
584
585    /**
586     * A set of one or more available refactoring actions, grouped under a parent refactoring.
587     */
588    export interface ApplicableRefactorInfo {
589        /**
590         * The programmatic name of the refactoring
591         */
592        name: string;
593        /**
594         * A description of this refactoring category to show to the user.
595         * If the refactoring gets inlined (see below), this text will not be visible.
596         */
597        description: string;
598        /**
599         * Inlineable refactorings can have their actions hoisted out to the top level
600         * of a context menu. Non-inlineanable refactorings should always be shown inside
601         * their parent grouping.
602         *
603         * If not specified, this value is assumed to be 'true'
604         */
605        inlineable?: boolean;
606
607        actions: RefactorActionInfo[];
608    }
609
610    /**
611     * Represents a single refactoring action - for example, the "Extract Method..." refactor might
612     * offer several actions, each corresponding to a surround class or closure to extract into.
613     */
614    export interface RefactorActionInfo {
615        /**
616         * The programmatic name of the refactoring action
617         */
618        name: string;
619
620        /**
621         * A description of this refactoring action to show to the user.
622         * If the parent refactoring is inlined away, this will be the only text shown,
623         * so this description should make sense by itself if the parent is inlineable=true
624         */
625        description: string;
626
627        /**
628         * A message to show to the user if the refactoring cannot be applied in
629         * the current context.
630         */
631        notApplicableReason?: string;
632
633        /**
634         * The hierarchical dotted name of the refactor action.
635         */
636        kind?: string;
637    }
638
639    export interface GetEditsForRefactorRequest extends Request {
640        command: CommandTypes.GetEditsForRefactor;
641        arguments: GetEditsForRefactorRequestArgs;
642    }
643
644    /**
645     * Request the edits that a particular refactoring action produces.
646     * Callers must specify the name of the refactor and the name of the action.
647     */
648    export type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
649        /* The 'name' property from the refactoring that offered this action */
650        refactor: string;
651        /* The 'name' property from the refactoring action */
652        action: string;
653    };
654
655
656    export interface GetEditsForRefactorResponse extends Response {
657        body?: RefactorEditInfo;
658    }
659
660    export interface RefactorEditInfo {
661        edits: FileCodeEdits[];
662
663        /**
664         * An optional location where the editor should start a rename operation once
665         * the refactoring edits have been applied
666         */
667        renameLocation?: Location;
668        renameFilename?: string;
669    }
670
671    /**
672     * Organize imports by:
673     *   1) Removing unused imports
674     *   2) Coalescing imports from the same module
675     *   3) Sorting imports
676     */
677    export interface OrganizeImportsRequest extends Request {
678        command: CommandTypes.OrganizeImports;
679        arguments: OrganizeImportsRequestArgs;
680    }
681
682    export type OrganizeImportsScope = GetCombinedCodeFixScope;
683
684    export const enum OrganizeImportsMode {
685        All = "All",
686        SortAndCombine = "SortAndCombine",
687        RemoveUnused = "RemoveUnused",
688    }
689
690    export interface OrganizeImportsRequestArgs {
691        scope: OrganizeImportsScope;
692        /** @deprecated Use `mode` instead */
693        skipDestructiveCodeActions?: boolean;
694        mode?: OrganizeImportsMode;
695    }
696
697    export interface OrganizeImportsResponse extends Response {
698        body: readonly FileCodeEdits[];
699    }
700
701    export interface GetEditsForFileRenameRequest extends Request {
702        command: CommandTypes.GetEditsForFileRename;
703        arguments: GetEditsForFileRenameRequestArgs;
704    }
705
706    /** Note: Paths may also be directories. */
707    export interface GetEditsForFileRenameRequestArgs {
708        readonly oldFilePath: string;
709        readonly newFilePath: string;
710    }
711
712    export interface GetEditsForFileRenameResponse extends Response {
713        body: readonly FileCodeEdits[];
714    }
715
716    /**
717     * Request for the available codefixes at a specific position.
718     */
719    export interface CodeFixRequest extends Request {
720        command: CommandTypes.GetCodeFixes;
721        arguments: CodeFixRequestArgs;
722    }
723
724    export interface GetCombinedCodeFixRequest extends Request {
725        command: CommandTypes.GetCombinedCodeFix;
726        arguments: GetCombinedCodeFixRequestArgs;
727    }
728
729    export interface GetCombinedCodeFixResponse extends Response {
730        body: CombinedCodeActions;
731    }
732
733    export interface ApplyCodeActionCommandRequest extends Request {
734        command: CommandTypes.ApplyCodeActionCommand;
735        arguments: ApplyCodeActionCommandRequestArgs;
736    }
737
738    // All we need is the `success` and `message` fields of Response.
739    export interface ApplyCodeActionCommandResponse extends Response { }
740
741    export interface FileRangeRequestArgs extends FileRequestArgs {
742        /**
743         * The line number for the request (1-based).
744         */
745        startLine: number;
746
747        /**
748         * The character offset (on the line) for the request (1-based).
749         */
750        startOffset: number;
751
752        /**
753         * Position (can be specified instead of line/offset pair)
754         */
755        /* @internal */
756        startPosition?: number;
757
758        /**
759         * The line number for the request (1-based).
760         */
761        endLine: number;
762
763        /**
764         * The character offset (on the line) for the request (1-based).
765         */
766        endOffset: number;
767
768        /**
769         * Position (can be specified instead of line/offset pair)
770         */
771        /* @internal */
772        endPosition?: number;
773    }
774
775    /**
776     * Instances of this interface specify errorcodes on a specific location in a sourcefile.
777     */
778    export interface CodeFixRequestArgs extends FileRangeRequestArgs {
779        /**
780         * Errorcodes we want to get the fixes for.
781         */
782        errorCodes: readonly number[];
783    }
784
785    export interface GetCombinedCodeFixRequestArgs {
786        scope: GetCombinedCodeFixScope;
787        fixId: {};
788    }
789
790    export interface GetCombinedCodeFixScope {
791        type: "file";
792        args: FileRequestArgs;
793    }
794
795    export interface ApplyCodeActionCommandRequestArgs {
796        /** May also be an array of commands. */
797        command: {};
798    }
799
800    /**
801     * Response for GetCodeFixes request.
802     */
803    export interface GetCodeFixesResponse extends Response {
804        body?: CodeAction[];
805    }
806
807    /**
808     * A request whose arguments specify a file location (file, line, col).
809     */
810    export interface FileLocationRequest extends FileRequest {
811        arguments: FileLocationRequestArgs;
812    }
813
814    /**
815     * A request to get codes of supported code fixes.
816     */
817    export interface GetSupportedCodeFixesRequest extends Request {
818        command: CommandTypes.GetSupportedCodeFixes;
819    }
820
821    /**
822     * A response for GetSupportedCodeFixesRequest request.
823     */
824    export interface GetSupportedCodeFixesResponse extends Response {
825        /**
826         * List of error codes supported by the server.
827         */
828        body?: string[];
829    }
830
831    /**
832     * A request to get encoded Syntactic classifications for a span in the file
833     */
834    /** @internal */
835    export interface EncodedSyntacticClassificationsRequest extends FileRequest {
836        arguments: EncodedSyntacticClassificationsRequestArgs;
837    }
838
839    /**
840     * Arguments for EncodedSyntacticClassificationsRequest request.
841     */
842    /** @internal */
843    export interface EncodedSyntacticClassificationsRequestArgs extends FileRequestArgs {
844        /**
845         * Start position of the span.
846         */
847        start: number;
848        /**
849         * Length of the span.
850         */
851        length: number;
852    }
853
854    /**
855     * A request to get encoded semantic classifications for a span in the file
856     */
857    export interface EncodedSemanticClassificationsRequest extends FileRequest {
858        arguments: EncodedSemanticClassificationsRequestArgs;
859    }
860
861    /**
862     * Arguments for EncodedSemanticClassificationsRequest request.
863     */
864    export interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
865        /**
866         * Start position of the span.
867         */
868        start: number;
869        /**
870         * Length of the span.
871         */
872        length: number;
873        /**
874         * Optional parameter for the semantic highlighting response, if absent it
875         * defaults to "original".
876         */
877        format?: "original" | "2020"
878    }
879
880    /** The response for a EncodedSemanticClassificationsRequest */
881    export interface EncodedSemanticClassificationsResponse extends Response {
882        body?: EncodedSemanticClassificationsResponseBody
883    }
884
885    /**
886     * Implementation response message. Gives series of text spans depending on the format ar.
887     */
888    export interface EncodedSemanticClassificationsResponseBody {
889        endOfLineState: EndOfLineState;
890        spans: number[];
891    }
892    /**
893     * Arguments in document highlight request; include: filesToSearch, file,
894     * line, offset.
895     */
896    export interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
897        /**
898         * List of files to search for document highlights.
899         */
900        filesToSearch: string[];
901    }
902
903    /**
904     * Go to definition request; value of command field is
905     * "definition". Return response giving the file locations that
906     * define the symbol found in file at location line, col.
907     */
908    export interface DefinitionRequest extends FileLocationRequest {
909        command: CommandTypes.Definition;
910    }
911
912    export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
913        readonly command: CommandTypes.DefinitionAndBoundSpan;
914    }
915
916    export interface FindSourceDefinitionRequest extends FileLocationRequest {
917        readonly command: CommandTypes.FindSourceDefinition;
918    }
919
920    export interface DefinitionAndBoundSpanResponse extends Response {
921        readonly body: DefinitionInfoAndBoundSpan;
922    }
923
924    /** @internal */
925    export interface EmitOutputRequest extends FileRequest {
926        command: CommandTypes.EmitOutput;
927        arguments: EmitOutputRequestArgs;
928    }
929    /** @internal */
930    export interface EmitOutputRequestArgs extends FileRequestArgs {
931        includeLinePosition?: boolean;
932        /** if true - return response as object with emitSkipped and diagnostics */
933        richResponse?: boolean;
934    }
935    /** @internal */
936    export interface EmitOutputResponse extends Response {
937        readonly body: EmitOutput | ts.EmitOutput;
938    }
939    /** @internal */
940    export interface EmitOutput {
941        outputFiles: OutputFile[];
942        emitSkipped: boolean;
943        diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
944    }
945
946    /**
947     * Go to type request; value of command field is
948     * "typeDefinition". Return response giving the file locations that
949     * define the type for the symbol found in file at location line, col.
950     */
951    export interface TypeDefinitionRequest extends FileLocationRequest {
952        command: CommandTypes.TypeDefinition;
953    }
954
955    /**
956     * Go to implementation request; value of command field is
957     * "implementation". Return response giving the file locations that
958     * implement the symbol found in file at location line, col.
959     */
960    export interface ImplementationRequest extends FileLocationRequest {
961        command: CommandTypes.Implementation;
962    }
963
964    /**
965     * Location in source code expressed as (one-based) line and (one-based) column offset.
966     */
967    export interface Location {
968        line: number;
969        offset: number;
970    }
971
972    /**
973     * Object found in response messages defining a span of text in source code.
974     */
975    export interface TextSpan {
976        /**
977         * First character of the definition.
978         */
979        start: Location;
980
981        /**
982         * One character past last character of the definition.
983         */
984        end: Location;
985    }
986
987    /**
988     * Object found in response messages defining a span of text in a specific source file.
989     */
990    export interface FileSpan extends TextSpan {
991        /**
992         * File containing text span.
993         */
994        file: string;
995    }
996
997    export interface JSDocTagInfo {
998        /** Name of the JSDoc tag */
999        name: string;
1000        /**
1001         * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment
1002         * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
1003         */
1004        text?: string | SymbolDisplayPart[];
1005    }
1006
1007    export interface TextSpanWithContext extends TextSpan {
1008        contextStart?: Location;
1009        contextEnd?: Location;
1010    }
1011
1012    export interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
1013    }
1014
1015    export interface DefinitionInfo extends FileSpanWithContext {
1016        /**
1017         * When true, the file may or may not exist.
1018         */
1019        unverified?: boolean;
1020    }
1021
1022    export interface DefinitionInfoAndBoundSpan {
1023        definitions: readonly DefinitionInfo[];
1024        textSpan: TextSpan;
1025    }
1026
1027    /**
1028     * Definition response message.  Gives text range for definition.
1029     */
1030    export interface DefinitionResponse extends Response {
1031        body?: DefinitionInfo[];
1032    }
1033
1034    export interface DefinitionInfoAndBoundSpanResponse extends Response {
1035        body?: DefinitionInfoAndBoundSpan;
1036    }
1037
1038    /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
1039    export type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
1040
1041    /**
1042     * Definition response message.  Gives text range for definition.
1043     */
1044    export interface TypeDefinitionResponse extends Response {
1045        body?: FileSpanWithContext[];
1046    }
1047
1048    /**
1049     * Implementation response message.  Gives text range for implementations.
1050     */
1051    export interface ImplementationResponse extends Response {
1052        body?: FileSpanWithContext[];
1053    }
1054
1055    /**
1056     * Request to get brace completion for a location in the file.
1057     */
1058    export interface BraceCompletionRequest extends FileLocationRequest {
1059        command: CommandTypes.BraceCompletion;
1060        arguments: BraceCompletionRequestArgs;
1061    }
1062
1063    /**
1064     * Argument for BraceCompletionRequest request.
1065     */
1066    export interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
1067        /**
1068         * Kind of opening brace
1069         */
1070        openingBrace: string;
1071    }
1072
1073    export interface JsxClosingTagRequest extends FileLocationRequest {
1074        readonly command: CommandTypes.JsxClosingTag;
1075        readonly arguments: JsxClosingTagRequestArgs;
1076    }
1077
1078    export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs { }
1079
1080    export interface JsxClosingTagResponse extends Response {
1081        readonly body: TextInsertion;
1082    }
1083
1084    /**
1085     * @deprecated
1086     * Get occurrences request; value of command field is
1087     * "occurrences". Return response giving spans that are relevant
1088     * in the file at a given line and column.
1089     */
1090    export interface OccurrencesRequest extends FileLocationRequest {
1091        command: CommandTypes.Occurrences;
1092    }
1093
1094    /** @deprecated */
1095    export interface OccurrencesResponseItem extends FileSpanWithContext {
1096        /**
1097         * True if the occurrence is a write location, false otherwise.
1098         */
1099        isWriteAccess: boolean;
1100
1101        /**
1102         * True if the occurrence is in a string, undefined otherwise;
1103         */
1104        isInString?: true;
1105    }
1106
1107    /** @deprecated */
1108    export interface OccurrencesResponse extends Response {
1109        body?: OccurrencesResponseItem[];
1110    }
1111
1112    /**
1113     * Get document highlights request; value of command field is
1114     * "documentHighlights". Return response giving spans that are relevant
1115     * in the file at a given line and column.
1116     */
1117    export interface DocumentHighlightsRequest extends FileLocationRequest {
1118        command: CommandTypes.DocumentHighlights;
1119        arguments: DocumentHighlightsRequestArgs;
1120    }
1121
1122    /**
1123     * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
1124     */
1125    export interface HighlightSpan extends TextSpanWithContext {
1126        kind: HighlightSpanKind;
1127    }
1128
1129    /**
1130     * Represents a set of highligh spans for a give name
1131     */
1132    export interface DocumentHighlightsItem {
1133        /**
1134         * File containing highlight spans.
1135         */
1136        file: string;
1137
1138        /**
1139         * Spans to highlight in file.
1140         */
1141        highlightSpans: HighlightSpan[];
1142    }
1143
1144    /**
1145     * Response for a DocumentHighlightsRequest request.
1146     */
1147    export interface DocumentHighlightsResponse extends Response {
1148        body?: DocumentHighlightsItem[];
1149    }
1150
1151    /**
1152     * Find references request; value of command field is
1153     * "references". Return response giving the file locations that
1154     * reference the symbol found in file at location line, col.
1155     */
1156    export interface ReferencesRequest extends FileLocationRequest {
1157        command: CommandTypes.References;
1158    }
1159
1160    export interface ReferencesResponseItem extends FileSpanWithContext {
1161        /**
1162         * Text of line containing the reference. Including this
1163         * with the response avoids latency of editor loading files
1164         * to show text of reference line (the server already has loaded the referencing files).
1165         *
1166         * If {@link UserPreferences.disableLineTextInReferences} is enabled, the property won't be filled
1167         */
1168        lineText?: string;
1169
1170        /**
1171         * True if reference is a write location, false otherwise.
1172         */
1173        isWriteAccess: boolean;
1174
1175        /**
1176         * Present only if the search was triggered from a declaration.
1177         * True indicates that the references refers to the same symbol
1178         * (i.e. has the same meaning) as the declaration that began the
1179         * search.
1180         */
1181        isDefinition?: boolean;
1182    }
1183
1184    /**
1185     * The body of a "references" response message.
1186     */
1187    export interface ReferencesResponseBody {
1188        /**
1189         * The file locations referencing the symbol.
1190         */
1191        refs: readonly ReferencesResponseItem[];
1192
1193        /**
1194         * The name of the symbol.
1195         */
1196        symbolName: string;
1197
1198        /**
1199         * The start character offset of the symbol (on the line provided by the references request).
1200         */
1201        symbolStartOffset: number;
1202
1203        /**
1204         * The full display name of the symbol.
1205         */
1206        symbolDisplayString: string;
1207    }
1208
1209    /**
1210     * Response to "references" request.
1211     */
1212    export interface ReferencesResponse extends Response {
1213        body?: ReferencesResponseBody;
1214    }
1215
1216    export interface FileReferencesRequest extends FileRequest {
1217        command: CommandTypes.FileReferences;
1218    }
1219
1220    export interface FileReferencesResponseBody {
1221        /**
1222         * The file locations referencing the symbol.
1223         */
1224        refs: readonly ReferencesResponseItem[];
1225        /**
1226         * The name of the symbol.
1227         */
1228        symbolName: string;
1229    }
1230
1231    export interface FileReferencesResponse extends Response {
1232        body?: FileReferencesResponseBody;
1233    }
1234
1235    /**
1236     * Argument for RenameRequest request.
1237     */
1238    export interface RenameRequestArgs extends FileLocationRequestArgs {
1239        /**
1240         * Should text at specified location be found/changed in comments?
1241         */
1242        findInComments?: boolean;
1243        /**
1244         * Should text at specified location be found/changed in strings?
1245         */
1246        findInStrings?: boolean;
1247    }
1248
1249    /**
1250     * Rename request; value of command field is "rename". Return
1251     * response giving the file locations that reference the symbol
1252     * found in file at location line, col. Also return full display
1253     * name of the symbol so that client can print it unambiguously.
1254     */
1255    export interface RenameRequest extends FileLocationRequest {
1256        command: CommandTypes.Rename;
1257        arguments: RenameRequestArgs;
1258    }
1259
1260    /* @internal */
1261    export interface RenameFullRequest extends FileLocationRequest {
1262        readonly command: CommandTypes.RenameLocationsFull;
1263        readonly arguments: RenameRequestArgs;
1264    }
1265
1266    /* @internal */
1267    export interface RenameFullResponse extends Response {
1268        readonly body: readonly RenameLocation[];
1269    }
1270
1271    /**
1272     * Information about the item to be renamed.
1273     */
1274    export type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
1275    export interface RenameInfoSuccess {
1276        /**
1277         * True if item can be renamed.
1278         */
1279        canRename: true;
1280        /**
1281         * File or directory to rename.
1282         * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
1283         */
1284        fileToRename?: string;
1285
1286        /**
1287         * Display name of the item to be renamed.
1288         */
1289        displayName: string;
1290
1291        /**
1292         * Full display name of item to be renamed.
1293         */
1294        fullDisplayName: string;
1295
1296        /**
1297         * The items's kind (such as 'className' or 'parameterName' or plain 'text').
1298         */
1299        kind: ScriptElementKind;
1300
1301        /**
1302         * Optional modifiers for the kind (such as 'public').
1303         */
1304        kindModifiers: string;
1305
1306        /** Span of text to rename. */
1307        triggerSpan: TextSpan;
1308    }
1309    export interface RenameInfoFailure {
1310        canRename: false;
1311        /**
1312         * Error message if item can not be renamed.
1313         */
1314        localizedErrorMessage: string;
1315    }
1316
1317    /**
1318     *  A group of text spans, all in 'file'.
1319     */
1320    export interface SpanGroup {
1321        /** The file to which the spans apply */
1322        file: string;
1323        /** The text spans in this group */
1324        locs: RenameTextSpan[];
1325    }
1326
1327    export interface RenameTextSpan extends TextSpanWithContext {
1328        readonly prefixText?: string;
1329        readonly suffixText?: string;
1330    }
1331
1332    export interface RenameResponseBody {
1333        /**
1334         * Information about the item to be renamed.
1335         */
1336        info: RenameInfo;
1337
1338        /**
1339         * An array of span groups (one per file) that refer to the item to be renamed.
1340         */
1341        locs: readonly SpanGroup[];
1342    }
1343
1344    /**
1345     * Rename response message.
1346     */
1347    export interface RenameResponse extends Response {
1348        body?: RenameResponseBody;
1349    }
1350
1351    /**
1352     * Represents a file in external project.
1353     * External project is project whose set of files, compilation options and open\close state
1354     * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
1355     * External project will exist even if all files in it are closed and should be closed explicitly.
1356     * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
1357     * create configured project for every config file but will maintain a link that these projects were created
1358     * as a result of opening external project so they should be removed once external project is closed.
1359     */
1360    export interface ExternalFile {
1361        /**
1362         * Name of file file
1363         */
1364        fileName: string;
1365        /**
1366         * Script kind of the file
1367         */
1368        scriptKind?: ScriptKindName | ts.ScriptKind;
1369        /**
1370         * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)
1371         */
1372        hasMixedContent?: boolean;
1373        /**
1374         * Content of the file
1375         */
1376        content?: string;
1377    }
1378
1379    /**
1380     * Represent an external project
1381     */
1382    export interface ExternalProject {
1383        /**
1384         * Project name
1385         */
1386        projectFileName: string;
1387        /**
1388         * List of root files in project
1389         */
1390        rootFiles: ExternalFile[];
1391        /**
1392         * Compiler options for the project
1393         */
1394        options: ExternalProjectCompilerOptions;
1395        /**
1396         * @deprecated typingOptions. Use typeAcquisition instead
1397         */
1398        typingOptions?: TypeAcquisition;
1399        /**
1400         * Explicitly specified type acquisition for the project
1401         */
1402        typeAcquisition?: TypeAcquisition;
1403    }
1404
1405    export interface CompileOnSaveMixin {
1406        /**
1407         * If compile on save is enabled for the project
1408         */
1409        compileOnSave?: boolean;
1410    }
1411
1412    /**
1413     * For external projects, some of the project settings are sent together with
1414     * compiler settings.
1415     */
1416    export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
1417
1418    /**
1419     * Contains information about current project version
1420     */
1421    /* @internal */
1422    export interface ProjectVersionInfo {
1423        /**
1424         * Project name
1425         */
1426        projectName: string;
1427        /**
1428         * true if project is inferred or false if project is external or configured
1429         */
1430        isInferred: boolean;
1431        /**
1432         * Project version
1433         */
1434        version: number;
1435        /**
1436         * Current set of compiler options for project
1437         */
1438        options: ts.CompilerOptions;
1439        /**
1440         * true if project language service is disabled
1441         */
1442        languageServiceDisabled: boolean;
1443        /**
1444         * Filename of the last file analyzed before disabling the language service. undefined, if the language service is enabled.
1445         */
1446        lastFileExceededProgramSize?: string;
1447    }
1448
1449    export interface FileWithProjectReferenceRedirectInfo {
1450        /**
1451         * Name of file
1452         */
1453        fileName: string;
1454
1455        /**
1456         * True if the file is primarily included in a referenced project
1457         */
1458        isSourceOfProjectReferenceRedirect: boolean;
1459    }
1460
1461    /**
1462     * Represents a set of changes that happen in project
1463     */
1464    export interface ProjectChanges {
1465        /**
1466         * List of added files
1467         */
1468        added: string[] | FileWithProjectReferenceRedirectInfo[];
1469        /**
1470         * List of removed files
1471         */
1472        removed: string[] | FileWithProjectReferenceRedirectInfo[];
1473        /**
1474         * List of updated files
1475         */
1476        updated: string[] | FileWithProjectReferenceRedirectInfo[];
1477        /**
1478         * List of files that have had their project reference redirect status updated
1479         * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true
1480         */
1481        updatedRedirects?: FileWithProjectReferenceRedirectInfo[];
1482    }
1483
1484    /**
1485     * Describes set of files in the project.
1486     * info might be omitted in case of inferred projects
1487     * if files is set - then this is the entire set of files in the project
1488     * if changes is set - then this is the set of changes that should be applied to existing project
1489     * otherwise - assume that nothing is changed
1490     */
1491    /* @internal */
1492    export interface ProjectFiles {
1493        /**
1494         * Information about project verison
1495         */
1496        info?: ProjectVersionInfo;
1497        /**
1498         * List of files in project (might be omitted if current state of project can be computed using only information from 'changes')
1499         * This property will have type FileWithProjectReferenceRedirectInfo[] if includeProjectReferenceRedirectInfo is set to true in
1500         * the corresponding SynchronizeProjectList request; otherwise, it will have type string[].
1501         */
1502        files?: string[] | FileWithProjectReferenceRedirectInfo[];
1503        /**
1504         * Set of changes in project (omitted if the entire set of files in project should be replaced)
1505         */
1506        changes?: ProjectChanges;
1507    }
1508
1509    /**
1510     * Combines project information with project level errors.
1511     */
1512    /* @internal */
1513    export interface ProjectFilesWithDiagnostics extends ProjectFiles {
1514        /**
1515         * List of errors in project
1516         */
1517        projectErrors: DiagnosticWithLinePosition[];
1518    }
1519
1520    /**
1521     * Represents set of changes in open file
1522     */
1523    /* @internal */
1524    export interface ChangedOpenFile {
1525        /**
1526         * Name of file
1527         */
1528        fileName: string;
1529        /**
1530         * List of changes that should be applied to known open file
1531         */
1532        changes: ts.TextChange[];
1533    }
1534
1535
1536    /**
1537     * Information found in a configure request.
1538     */
1539    export interface ConfigureRequestArguments {
1540
1541        /**
1542         * Information about the host, for example 'Emacs 24.4' or
1543         * 'Sublime Text version 3075'
1544         */
1545        hostInfo?: string;
1546
1547        /**
1548         * If present, tab settings apply only to this file.
1549         */
1550        file?: string;
1551
1552        /**
1553         * The format options to use during formatting and other code editing features.
1554         */
1555        formatOptions?: FormatCodeSettings;
1556
1557        preferences?: UserPreferences;
1558
1559        /**
1560         * The host's additional supported .js file extensions
1561         */
1562        extraFileExtensions?: FileExtensionInfo[];
1563
1564        watchOptions?: WatchOptions;
1565    }
1566
1567    export const enum WatchFileKind {
1568        FixedPollingInterval = "FixedPollingInterval",
1569        PriorityPollingInterval = "PriorityPollingInterval",
1570        DynamicPriorityPolling = "DynamicPriorityPolling",
1571        FixedChunkSizePolling = "FixedChunkSizePolling",
1572        UseFsEvents = "UseFsEvents",
1573        UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory",
1574    }
1575
1576    export const enum WatchDirectoryKind {
1577        UseFsEvents = "UseFsEvents",
1578        FixedPollingInterval = "FixedPollingInterval",
1579        DynamicPriorityPolling = "DynamicPriorityPolling",
1580        FixedChunkSizePolling = "FixedChunkSizePolling",
1581    }
1582
1583    export const enum PollingWatchKind {
1584        FixedInterval = "FixedInterval",
1585        PriorityInterval = "PriorityInterval",
1586        DynamicPriority = "DynamicPriority",
1587        FixedChunkSize = "FixedChunkSize",
1588    }
1589
1590    export interface WatchOptions {
1591        watchFile?: WatchFileKind | ts.WatchFileKind;
1592        watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
1593        fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
1594        synchronousWatchDirectory?: boolean;
1595        excludeDirectories?: string[];
1596        excludeFiles?: string[];
1597        [option: string]: CompilerOptionsValue | undefined;
1598    }
1599
1600    /**
1601     *  Configure request; value of command field is "configure".  Specifies
1602     *  host information, such as host type, tab size, and indent size.
1603     */
1604    export interface ConfigureRequest extends Request {
1605        command: CommandTypes.Configure;
1606        arguments: ConfigureRequestArguments;
1607    }
1608
1609    /**
1610     * Response to "configure" request.  This is just an acknowledgement, so
1611     * no body field is required.
1612     */
1613    export interface ConfigureResponse extends Response {
1614    }
1615
1616    export interface ConfigurePluginRequestArguments {
1617        pluginName: string;
1618        configuration: any;
1619    }
1620
1621    export interface ConfigurePluginRequest extends Request {
1622        command: CommandTypes.ConfigurePlugin;
1623        arguments: ConfigurePluginRequestArguments;
1624    }
1625
1626    export interface ConfigurePluginResponse extends Response {
1627    }
1628
1629    export interface SelectionRangeRequest extends FileRequest {
1630        command: CommandTypes.SelectionRange;
1631        arguments: SelectionRangeRequestArgs;
1632    }
1633
1634    export interface SelectionRangeRequestArgs extends FileRequestArgs {
1635        locations: Location[];
1636    }
1637
1638    export interface SelectionRangeResponse extends Response {
1639        body?: SelectionRange[];
1640    }
1641
1642    export interface SelectionRange {
1643        textSpan: TextSpan;
1644        parent?: SelectionRange;
1645    }
1646
1647    export interface ToggleLineCommentRequest extends FileRequest {
1648        command: CommandTypes.ToggleLineComment;
1649        arguments: FileRangeRequestArgs;
1650    }
1651
1652    export interface ToggleMultilineCommentRequest extends FileRequest {
1653        command: CommandTypes.ToggleMultilineComment;
1654        arguments: FileRangeRequestArgs;
1655    }
1656
1657    export interface CommentSelectionRequest extends FileRequest {
1658        command: CommandTypes.CommentSelection;
1659        arguments: FileRangeRequestArgs;
1660    }
1661
1662    export interface UncommentSelectionRequest extends FileRequest {
1663        command: CommandTypes.UncommentSelection;
1664        arguments: FileRangeRequestArgs;
1665    }
1666
1667    /**
1668     *  Information found in an "open" request.
1669     */
1670    export interface OpenRequestArgs extends FileRequestArgs {
1671        /**
1672         * Used when a version of the file content is known to be more up to date than the one on disk.
1673         * Then the known content will be used upon opening instead of the disk copy
1674         */
1675        fileContent?: string;
1676        /**
1677         * Used to specify the script kind of the file explicitly. It could be one of the following:
1678         *      "TS", "JS", "TSX", "JSX"
1679         */
1680        scriptKindName?: ScriptKindName;
1681        /**
1682         * Used to limit the searching for project config file. If given the searching will stop at this
1683         * root path; otherwise it will go all the way up to the dist root path.
1684         */
1685        projectRootPath?: string;
1686    }
1687
1688    export type ScriptKindName = "TS" | "JS" | "TSX" | "JSX" | "ETS";
1689
1690    /**
1691     * Open request; value of command field is "open". Notify the
1692     * server that the client has file open.  The server will not
1693     * monitor the filesystem for changes in this file and will assume
1694     * that the client is updating the server (using the change and/or
1695     * reload messages) when the file changes. Server does not currently
1696     * send a response to an open request.
1697     */
1698    export interface OpenRequest extends Request {
1699        command: CommandTypes.Open;
1700        arguments: OpenRequestArgs;
1701    }
1702
1703    /**
1704     * Request to open or update external project
1705     */
1706    export interface OpenExternalProjectRequest extends Request {
1707        command: CommandTypes.OpenExternalProject;
1708        arguments: OpenExternalProjectArgs;
1709    }
1710
1711    /**
1712     * Arguments to OpenExternalProjectRequest request
1713     */
1714    export type OpenExternalProjectArgs = ExternalProject;
1715
1716    /**
1717     * Request to open multiple external projects
1718     */
1719    export interface OpenExternalProjectsRequest extends Request {
1720        command: CommandTypes.OpenExternalProjects;
1721        arguments: OpenExternalProjectsArgs;
1722    }
1723
1724    /**
1725     * Arguments to OpenExternalProjectsRequest
1726     */
1727    export interface OpenExternalProjectsArgs {
1728        /**
1729         * List of external projects to open or update
1730         */
1731        projects: ExternalProject[];
1732    }
1733
1734    /**
1735     * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
1736     * no body field is required.
1737     */
1738    export interface OpenExternalProjectResponse extends Response {
1739    }
1740
1741    /**
1742     * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
1743     * no body field is required.
1744     */
1745    export interface OpenExternalProjectsResponse extends Response {
1746    }
1747
1748    /**
1749     * Request to close external project.
1750     */
1751    export interface CloseExternalProjectRequest extends Request {
1752        command: CommandTypes.CloseExternalProject;
1753        arguments: CloseExternalProjectRequestArgs;
1754    }
1755
1756    /**
1757     * Arguments to CloseExternalProjectRequest request
1758     */
1759    export interface CloseExternalProjectRequestArgs {
1760        /**
1761         * Name of the project to close
1762         */
1763        projectFileName: string;
1764    }
1765
1766    /**
1767     * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
1768     * no body field is required.
1769     */
1770    export interface CloseExternalProjectResponse extends Response {
1771    }
1772
1773    /**
1774     * Request to check if given list of projects is up-to-date and synchronize them if necessary
1775     */
1776    /* @internal */
1777    export interface SynchronizeProjectListRequest extends Request {
1778        arguments: SynchronizeProjectListRequestArgs;
1779    }
1780
1781    /**
1782     * Arguments to SynchronizeProjectListRequest
1783     */
1784    /* @internal */
1785    export interface SynchronizeProjectListRequestArgs {
1786        /**
1787         * List of last known projects
1788         */
1789        knownProjects: ProjectVersionInfo[];
1790        /**
1791         * If true, response specifies whether or not each file in each project
1792         * is a source from a project reference redirect
1793         */
1794        includeProjectReferenceRedirectInfo?: boolean;
1795    }
1796
1797    /**
1798     * Request to synchronize list of open files with the client
1799     */
1800    /* @internal */
1801    export interface ApplyChangedToOpenFilesRequest extends Request {
1802        arguments: ApplyChangedToOpenFilesRequestArgs;
1803    }
1804
1805    /**
1806     * Arguments to ApplyChangedToOpenFilesRequest
1807     */
1808    /* @internal */
1809    export interface ApplyChangedToOpenFilesRequestArgs {
1810        /**
1811         * List of newly open files
1812         */
1813        openFiles?: ExternalFile[];
1814        /**
1815         * List of open files files that were changes
1816         */
1817        changedFiles?: ChangedOpenFile[];
1818        /**
1819         * List of files that were closed
1820         */
1821        closedFiles?: string[];
1822    }
1823
1824    /**
1825     * Request to synchronize list of open files with the client
1826     */
1827    export interface UpdateOpenRequest extends Request {
1828        command: CommandTypes.UpdateOpen;
1829        arguments: UpdateOpenRequestArgs;
1830    }
1831
1832    /**
1833     * Arguments to UpdateOpenRequest
1834     */
1835    export interface UpdateOpenRequestArgs {
1836        /**
1837         * List of newly open files
1838         */
1839        openFiles?: OpenRequestArgs[];
1840        /**
1841         * List of open files files that were changes
1842         */
1843        changedFiles?: FileCodeEdits[];
1844        /**
1845         * List of files that were closed
1846         */
1847        closedFiles?: string[];
1848    }
1849
1850    /**
1851     * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
1852     */
1853    export type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
1854
1855    /**
1856     * Request to set compiler options for inferred projects.
1857     * External projects are opened / closed explicitly.
1858     * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.
1859     * This configuration file will be used to obtain a list of files and configuration settings for the project.
1860     * Inferred projects are created when user opens a loose file that is not the part of external project
1861     * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
1862     * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
1863     */
1864    export interface SetCompilerOptionsForInferredProjectsRequest extends Request {
1865        command: CommandTypes.CompilerOptionsForInferredProjects;
1866        arguments: SetCompilerOptionsForInferredProjectsArgs;
1867    }
1868
1869    /**
1870     * Argument for SetCompilerOptionsForInferredProjectsRequest request.
1871     */
1872    export interface SetCompilerOptionsForInferredProjectsArgs {
1873        /**
1874         * Compiler options to be used with inferred projects.
1875         */
1876        options: InferredProjectCompilerOptions;
1877
1878        /**
1879         * Specifies the project root path used to scope compiler options.
1880         * It is an error to provide this property if the server has not been started with
1881         * `useInferredProjectPerProjectRoot` enabled.
1882         */
1883        projectRootPath?: string;
1884    }
1885
1886    /**
1887     * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
1888     * no body field is required.
1889     */
1890    export interface SetCompilerOptionsForInferredProjectsResponse extends Response {
1891    }
1892
1893    /**
1894     *  Exit request; value of command field is "exit".  Ask the server process
1895     *  to exit.
1896     */
1897    export interface ExitRequest extends Request {
1898        command: CommandTypes.Exit;
1899    }
1900
1901    /**
1902     * Close request; value of command field is "close". Notify the
1903     * server that the client has closed a previously open file.  If
1904     * file is still referenced by open files, the server will resume
1905     * monitoring the filesystem for changes to file.  Server does not
1906     * currently send a response to a close request.
1907     */
1908    export interface CloseRequest extends FileRequest {
1909        command: CommandTypes.Close;
1910    }
1911
1912    /**
1913     * Request to obtain the list of files that should be regenerated if target file is recompiled.
1914     * NOTE: this us query-only operation and does not generate any output on disk.
1915     */
1916    export interface CompileOnSaveAffectedFileListRequest extends FileRequest {
1917        command: CommandTypes.CompileOnSaveAffectedFileList;
1918    }
1919
1920    /**
1921     * Contains a list of files that should be regenerated in a project
1922     */
1923    export interface CompileOnSaveAffectedFileListSingleProject {
1924        /**
1925         * Project name
1926         */
1927        projectFileName: string;
1928        /**
1929         * List of files names that should be recompiled
1930         */
1931        fileNames: string[];
1932
1933        /**
1934         * true if project uses outFile or out compiler option
1935         */
1936        projectUsesOutFile: boolean;
1937    }
1938
1939    /**
1940     * Response for CompileOnSaveAffectedFileListRequest request;
1941     */
1942    export interface CompileOnSaveAffectedFileListResponse extends Response {
1943        body: CompileOnSaveAffectedFileListSingleProject[];
1944    }
1945
1946    /**
1947     * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
1948     */
1949    export interface CompileOnSaveEmitFileRequest extends FileRequest {
1950        command: CommandTypes.CompileOnSaveEmitFile;
1951        arguments: CompileOnSaveEmitFileRequestArgs;
1952    }
1953
1954    /**
1955     * Arguments for CompileOnSaveEmitFileRequest
1956     */
1957    export interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
1958        /**
1959         * if true - then file should be recompiled even if it does not have any changes.
1960         */
1961        forced?: boolean;
1962        includeLinePosition?: boolean;
1963        /** if true - return response as object with emitSkipped and diagnostics */
1964        richResponse?: boolean;
1965    }
1966
1967    export interface CompileOnSaveEmitFileResponse extends Response {
1968        body: boolean | EmitResult;
1969    }
1970
1971    export interface EmitResult {
1972        emitSkipped: boolean;
1973        diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
1974    }
1975
1976    /**
1977     * Quickinfo request; value of command field is
1978     * "quickinfo". Return response giving a quick type and
1979     * documentation string for the symbol found in file at location
1980     * line, col.
1981     */
1982    export interface QuickInfoRequest extends FileLocationRequest {
1983        command: CommandTypes.Quickinfo;
1984        arguments: FileLocationRequestArgs;
1985    }
1986
1987    /**
1988     * Body of QuickInfoResponse.
1989     */
1990    export interface QuickInfoResponseBody {
1991        /**
1992         * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1993         */
1994        kind: ScriptElementKind;
1995
1996        /**
1997         * Optional modifiers for the kind (such as 'public').
1998         */
1999        kindModifiers: string;
2000
2001        /**
2002         * Starting file location of symbol.
2003         */
2004        start: Location;
2005
2006        /**
2007         * One past last character of symbol.
2008         */
2009        end: Location;
2010
2011        /**
2012         * Type and kind of symbol.
2013         */
2014        displayString: string;
2015
2016        /**
2017         * Documentation associated with symbol.
2018         * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.
2019         */
2020        documentation: string | SymbolDisplayPart[];
2021
2022        /**
2023         * JSDoc tags associated with symbol.
2024         */
2025        tags: JSDocTagInfo[];
2026    }
2027
2028    /**
2029     * Quickinfo response message.
2030     */
2031    export interface QuickInfoResponse extends Response {
2032        body?: QuickInfoResponseBody;
2033    }
2034
2035    /**
2036     * Arguments for format messages.
2037     */
2038    export interface FormatRequestArgs extends FileLocationRequestArgs {
2039        /**
2040         * Last line of range for which to format text in file.
2041         */
2042        endLine: number;
2043
2044        /**
2045         * Character offset on last line of range for which to format text in file.
2046         */
2047        endOffset: number;
2048
2049        /**
2050         * End position of the range for which to format text in file.
2051         */
2052        /* @internal */
2053        endPosition?: number;
2054        /**
2055         * Format options to be used.
2056         */
2057        options?: FormatCodeSettings;
2058    }
2059
2060    /**
2061     * Format request; value of command field is "format".  Return
2062     * response giving zero or more edit instructions.  The edit
2063     * instructions will be sorted in file order.  Applying the edit
2064     * instructions in reverse to file will result in correctly
2065     * reformatted text.
2066     */
2067    export interface FormatRequest extends FileLocationRequest {
2068        command: CommandTypes.Format;
2069        arguments: FormatRequestArgs;
2070    }
2071
2072    /**
2073     * Object found in response messages defining an editing
2074     * instruction for a span of text in source code.  The effect of
2075     * this instruction is to replace the text starting at start and
2076     * ending one character before end with newText. For an insertion,
2077     * the text span is empty.  For a deletion, newText is empty.
2078     */
2079    export interface CodeEdit {
2080        /**
2081         * First character of the text span to edit.
2082         */
2083        start: Location;
2084
2085        /**
2086         * One character past last character of the text span to edit.
2087         */
2088        end: Location;
2089
2090        /**
2091         * Replace the span defined above with this string (may be
2092         * the empty string).
2093         */
2094        newText: string;
2095    }
2096
2097    export interface FileCodeEdits {
2098        fileName: string;
2099        textChanges: CodeEdit[];
2100    }
2101
2102    export interface CodeFixResponse extends Response {
2103        /** The code actions that are available */
2104        body?: CodeFixAction[];
2105    }
2106
2107    export interface CodeAction {
2108        /** Description of the code action to display in the UI of the editor */
2109        description: string;
2110        /** Text changes to apply to each file as part of the code action */
2111        changes: FileCodeEdits[];
2112        /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification.  */
2113        commands?: {}[];
2114    }
2115
2116    export interface CombinedCodeActions {
2117        changes: readonly FileCodeEdits[];
2118        commands?: readonly {}[];
2119    }
2120
2121    export interface CodeFixAction extends CodeAction {
2122        /** Short name to identify the fix, for use by telemetry. */
2123        fixName: string;
2124        /**
2125         * If present, one may call 'getCombinedCodeFix' with this fixId.
2126         * This may be omitted to indicate that the code fix can't be applied in a group.
2127         */
2128        fixId?: {};
2129        /** Should be present if and only if 'fixId' is. */
2130        fixAllDescription?: string;
2131    }
2132
2133    /**
2134     * Format and format on key response message.
2135     */
2136    export interface FormatResponse extends Response {
2137        body?: CodeEdit[];
2138    }
2139
2140    /**
2141     * Arguments for format on key messages.
2142     */
2143    export interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
2144        /**
2145         * Key pressed (';', '\n', or '}').
2146         */
2147        key: string;
2148
2149        options?: FormatCodeSettings;
2150    }
2151
2152    /**
2153     * Format on key request; value of command field is
2154     * "formatonkey". Given file location and key typed (as string),
2155     * return response giving zero or more edit instructions.  The
2156     * edit instructions will be sorted in file order.  Applying the
2157     * edit instructions in reverse to file will result in correctly
2158     * reformatted text.
2159     */
2160    export interface FormatOnKeyRequest extends FileLocationRequest {
2161        command: CommandTypes.Formatonkey;
2162        arguments: FormatOnKeyRequestArgs;
2163    }
2164
2165    export type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
2166
2167    export const enum CompletionTriggerKind {
2168        /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
2169        Invoked = 1,
2170
2171        /** Completion was triggered by a trigger character. */
2172        TriggerCharacter = 2,
2173
2174        /** Completion was re-triggered as the current completion list is incomplete. */
2175        TriggerForIncompleteCompletions = 3,
2176    }
2177
2178    /**
2179     * Arguments for completions messages.
2180     */
2181    export interface CompletionsRequestArgs extends FileLocationRequestArgs {
2182        /**
2183         * Optional prefix to apply to possible completions.
2184         */
2185        prefix?: string;
2186        /**
2187         * Character that was responsible for triggering completion.
2188         * Should be `undefined` if a user manually requested completion.
2189         */
2190        triggerCharacter?: CompletionsTriggerCharacter;
2191        triggerKind?: CompletionTriggerKind;
2192        /**
2193         * @deprecated Use UserPreferences.includeCompletionsForModuleExports
2194         */
2195        includeExternalModuleExports?: boolean;
2196        /**
2197         * @deprecated Use UserPreferences.includeCompletionsWithInsertText
2198         */
2199        includeInsertTextCompletions?: boolean;
2200    }
2201
2202    export interface EtsOptions {
2203        render: { method: string[]; decorator: string[] };
2204        components: string[];
2205        libs: string[];
2206        extend: {
2207            decorator: string[];
2208            components: { name: string; type: string; instance: string }[];
2209        };
2210        styles: {
2211            decorator: string;
2212            component: { name: string; type: string; instance: string };
2213            property: string;
2214        };
2215        concurrent: {
2216            decorator: string;
2217        };
2218        customComponent?: string;
2219        propertyDecorators: {
2220            name: string;
2221            needInitialization: boolean;
2222        }[];
2223        emitDecorators: {
2224            name: string,
2225            emitParameters: boolean
2226        }[];
2227        syntaxComponents: {
2228            paramsUICallback: string[];
2229            attrUICallback: {
2230                name: string;
2231                attributes: string[];
2232            }[];
2233        };
2234    }
2235
2236    /**
2237     * Completions request; value of command field is "completions".
2238     * Given a file location (file, line, col) and a prefix (which may
2239     * be the empty string), return the possible completions that
2240     * begin with prefix.
2241     */
2242    export interface CompletionsRequest extends FileLocationRequest {
2243        command: CommandTypes.Completions | CommandTypes.CompletionInfo;
2244        arguments: CompletionsRequestArgs;
2245    }
2246
2247    /**
2248     * Arguments for completion details request.
2249     */
2250    export interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
2251        /**
2252         * Names of one or more entries for which to obtain details.
2253         */
2254        entryNames: (string | CompletionEntryIdentifier)[];
2255    }
2256
2257    export interface CompletionEntryIdentifier {
2258        name: string;
2259        source?: string;
2260        data?: unknown;
2261    }
2262
2263    /**
2264     * Completion entry details request; value of command field is
2265     * "completionEntryDetails".  Given a file location (file, line,
2266     * col) and an array of completion entry names return more
2267     * detailed information for each completion entry.
2268     */
2269    export interface CompletionDetailsRequest extends FileLocationRequest {
2270        command: CommandTypes.CompletionDetails;
2271        arguments: CompletionDetailsRequestArgs;
2272    }
2273
2274    /**
2275     * Part of a symbol description.
2276     */
2277    export interface SymbolDisplayPart {
2278        /**
2279         * Text of an item describing the symbol.
2280         */
2281        text: string;
2282
2283        /**
2284         * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
2285         */
2286        kind: string;
2287    }
2288
2289    /** A part of a symbol description that links from a jsdoc @link tag to a declaration */
2290    export interface JSDocLinkDisplayPart extends SymbolDisplayPart {
2291        /** The location of the declaration that the @link tag links to. */
2292        target: FileSpan;
2293    }
2294
2295    /**
2296     * An item found in a completion response.
2297     */
2298    export interface CompletionEntry {
2299        /**
2300         * The symbol's name.
2301         */
2302        name: string;
2303        /**
2304         * The symbol's kind (such as 'className' or 'parameterName').
2305         */
2306        kind: ScriptElementKind;
2307        /**
2308         * Optional modifiers for the kind (such as 'public').
2309         */
2310        kindModifiers?: string;
2311        /**
2312         * A string that is used for comparing completion items so that they can be ordered.  This
2313         * is often the same as the name but may be different in certain circumstances.
2314         */
2315        sortText: string;
2316        /**
2317         * Text to insert instead of `name`.
2318         * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
2319         * coupled with `replacementSpan` to replace a dotted access with a bracket access.
2320         */
2321        insertText?: string;
2322        /**
2323         * `insertText` should be interpreted as a snippet if true.
2324         */
2325        isSnippet?: true;
2326        /**
2327         * An optional span that indicates the text to be replaced by this completion item.
2328         * If present, this span should be used instead of the default one.
2329         * It will be set if the required span differs from the one generated by the default replacement behavior.
2330         */
2331        replacementSpan?: TextSpan;
2332        /**
2333         * Indicates whether commiting this completion entry will require additional code actions to be
2334         * made to avoid errors. The CompletionEntryDetails will have these actions.
2335         */
2336        hasAction?: true;
2337        /**
2338         * Identifier (not necessarily human-readable) identifying where this completion came from.
2339         */
2340        source?: string;
2341        /**
2342         * Human-readable description of the `source`.
2343         */
2344        sourceDisplay?: SymbolDisplayPart[];
2345        /**
2346         * Additional details for the label.
2347         */
2348        labelDetails?: CompletionEntryLabelDetails;
2349        /**
2350         * If true, this completion should be highlighted as recommended. There will only be one of these.
2351         * 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.
2352         * Then either that enum/class or a namespace containing it will be the recommended symbol.
2353         */
2354        isRecommended?: true;
2355        /**
2356         * If true, this completion was generated from traversing the name table of an unchecked JS file,
2357         * and therefore may not be accurate.
2358         */
2359        isFromUncheckedFile?: true;
2360        /**
2361         * If true, this completion was for an auto-import of a module not yet in the program, but listed
2362         * in the project package.json. Used for telemetry reporting.
2363         */
2364        isPackageJsonImport?: true;
2365        /**
2366         * If true, this completion was an auto-import-style completion of an import statement (i.e., the
2367         * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
2368         */
2369        isImportStatementCompletion?: true;
2370        /**
2371         * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
2372         * that allows TS Server to look up the symbol represented by the completion item, disambiguating
2373         * items with the same name.
2374         */
2375        data?: unknown;
2376        /**
2377         * Js Doc info with symbol.
2378         */
2379        jsDoc?: JsDocTagInfo[];
2380        /**
2381         * Displayparts info with symbol.
2382         */
2383        displayParts?: SymbolDisplayPart[];
2384    }
2385
2386    export interface CompletionEntryLabelDetails {
2387        /**
2388         * An optional string which is rendered less prominently directly after
2389         * {@link CompletionEntry.name name}, without any spacing. Should be
2390         * used for function signatures or type annotations.
2391         */
2392        detail?: string;
2393        /**
2394         * An optional string which is rendered less prominently after
2395         * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
2396         * names or file path.
2397         */
2398        description?: string;
2399    }
2400
2401    /**
2402     * Additional completion entry details, available on demand
2403     */
2404    export interface CompletionEntryDetails {
2405        /**
2406         * The symbol's name.
2407         */
2408        name: string;
2409        /**
2410         * The symbol's kind (such as 'className' or 'parameterName').
2411         */
2412        kind: ScriptElementKind;
2413        /**
2414         * Optional modifiers for the kind (such as 'public').
2415         */
2416        kindModifiers: string;
2417        /**
2418         * Display parts of the symbol (similar to quick info).
2419         */
2420        displayParts: SymbolDisplayPart[];
2421
2422        /**
2423         * Documentation strings for the symbol.
2424         */
2425        documentation?: SymbolDisplayPart[];
2426
2427        /**
2428         * JSDoc tags for the symbol.
2429         */
2430        tags?: JSDocTagInfo[];
2431
2432        /**
2433         * The associated code actions for this entry
2434         */
2435        codeActions?: CodeAction[];
2436
2437        /**
2438         * @deprecated Use `sourceDisplay` instead.
2439         */
2440        source?: SymbolDisplayPart[];
2441
2442        /**
2443         * Human-readable description of the `source` from the CompletionEntry.
2444         */
2445        sourceDisplay?: SymbolDisplayPart[];
2446    }
2447
2448    /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
2449    export interface CompletionsResponse extends Response {
2450        body?: CompletionEntry[];
2451    }
2452
2453    export interface CompletionInfoResponse extends Response {
2454        body?: CompletionInfo;
2455    }
2456
2457    export interface CompletionInfo {
2458        readonly flags?: number;
2459        readonly isGlobalCompletion: boolean;
2460        readonly isMemberCompletion: boolean;
2461        readonly isNewIdentifierLocation: boolean;
2462        /**
2463         * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
2464         * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
2465         * must be used to commit that completion entry.
2466         */
2467        readonly optionalReplacementSpan?: TextSpan;
2468        readonly isIncomplete?: boolean;
2469        readonly entries: readonly CompletionEntry[];
2470    }
2471
2472    export interface CompletionDetailsResponse extends Response {
2473        body?: CompletionEntryDetails[];
2474    }
2475
2476    /**
2477     * Signature help information for a single parameter
2478     */
2479    export interface SignatureHelpParameter {
2480
2481        /**
2482         * The parameter's name
2483         */
2484        name: string;
2485
2486        /**
2487         * Documentation of the parameter.
2488         */
2489        documentation: SymbolDisplayPart[];
2490
2491        /**
2492         * Display parts of the parameter.
2493         */
2494        displayParts: SymbolDisplayPart[];
2495
2496        /**
2497         * Whether the parameter is optional or not.
2498         */
2499        isOptional: boolean;
2500    }
2501
2502    /**
2503     * Represents a single signature to show in signature help.
2504     */
2505    export interface SignatureHelpItem {
2506
2507        /**
2508         * Whether the signature accepts a variable number of arguments.
2509         */
2510        isVariadic: boolean;
2511
2512        /**
2513         * The prefix display parts.
2514         */
2515        prefixDisplayParts: SymbolDisplayPart[];
2516
2517        /**
2518         * The suffix display parts.
2519         */
2520        suffixDisplayParts: SymbolDisplayPart[];
2521
2522        /**
2523         * The separator display parts.
2524         */
2525        separatorDisplayParts: SymbolDisplayPart[];
2526
2527        /**
2528         * The signature helps items for the parameters.
2529         */
2530        parameters: SignatureHelpParameter[];
2531
2532        /**
2533         * The signature's documentation
2534         */
2535        documentation: SymbolDisplayPart[];
2536
2537        /**
2538         * The signature's JSDoc tags
2539         */
2540        tags: JSDocTagInfo[];
2541    }
2542
2543    /**
2544     * Signature help items found in the response of a signature help request.
2545     */
2546    export interface SignatureHelpItems {
2547
2548        /**
2549         * The signature help items.
2550         */
2551        items: SignatureHelpItem[];
2552
2553        /**
2554         * The span for which signature help should appear on a signature
2555         */
2556        applicableSpan: TextSpan;
2557
2558        /**
2559         * The item selected in the set of available help items.
2560         */
2561        selectedItemIndex: number;
2562
2563        /**
2564         * The argument selected in the set of parameters.
2565         */
2566        argumentIndex: number;
2567
2568        /**
2569         * The argument count
2570         */
2571        argumentCount: number;
2572    }
2573
2574    export type SignatureHelpTriggerCharacter = "," | "(" | "<";
2575    export type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
2576
2577    /**
2578     * Arguments of a signature help request.
2579     */
2580    export interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
2581        /**
2582         * Reason why signature help was invoked.
2583         * See each individual possible
2584         */
2585        triggerReason?: SignatureHelpTriggerReason;
2586    }
2587
2588    export type SignatureHelpTriggerReason =
2589        | SignatureHelpInvokedReason
2590        | SignatureHelpCharacterTypedReason
2591        | SignatureHelpRetriggeredReason;
2592
2593    /**
2594     * Signals that the user manually requested signature help.
2595     * The language service will unconditionally attempt to provide a result.
2596     */
2597    export interface SignatureHelpInvokedReason {
2598        kind: "invoked";
2599        triggerCharacter?: undefined;
2600    }
2601
2602    /**
2603     * Signals that the signature help request came from a user typing a character.
2604     * Depending on the character and the syntactic context, the request may or may not be served a result.
2605     */
2606    export interface SignatureHelpCharacterTypedReason {
2607        kind: "characterTyped";
2608        /**
2609         * Character that was responsible for triggering signature help.
2610         */
2611        triggerCharacter: SignatureHelpTriggerCharacter;
2612    }
2613
2614    /**
2615     * Signals that this signature help request came from typing a character or moving the cursor.
2616     * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
2617     * The language service will unconditionally attempt to provide a result.
2618     * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
2619     */
2620    export interface SignatureHelpRetriggeredReason {
2621        kind: "retrigger";
2622        /**
2623         * Character that was responsible for triggering signature help.
2624         */
2625        triggerCharacter?: SignatureHelpRetriggerCharacter;
2626    }
2627
2628    /**
2629     * Signature help request; value of command field is "signatureHelp".
2630     * Given a file location (file, line, col), return the signature
2631     * help.
2632     */
2633    export interface SignatureHelpRequest extends FileLocationRequest {
2634        command: CommandTypes.SignatureHelp;
2635        arguments: SignatureHelpRequestArgs;
2636    }
2637
2638    /**
2639     * Response object for a SignatureHelpRequest.
2640     */
2641    export interface SignatureHelpResponse extends Response {
2642        body?: SignatureHelpItems;
2643    }
2644
2645    export type InlayHintKind = "Type" | "Parameter" | "Enum";
2646
2647    export interface InlayHintsRequestArgs extends FileRequestArgs {
2648        /**
2649         * Start position of the span.
2650         */
2651        start: number;
2652        /**
2653         * Length of the span.
2654         */
2655        length: number;
2656    }
2657
2658    export interface InlayHintsRequest extends Request {
2659        command: CommandTypes.ProvideInlayHints;
2660        arguments: InlayHintsRequestArgs;
2661    }
2662
2663    export interface InlayHintItem {
2664        text: string;
2665        position: Location;
2666        kind: InlayHintKind;
2667        whitespaceBefore?: boolean;
2668        whitespaceAfter?: boolean;
2669    }
2670
2671    export interface InlayHintsResponse extends Response {
2672        body?: InlayHintItem[];
2673    }
2674
2675    /**
2676     * Synchronous request for semantic diagnostics of one file.
2677     */
2678    export interface SemanticDiagnosticsSyncRequest extends FileRequest {
2679        command: CommandTypes.SemanticDiagnosticsSync;
2680        arguments: SemanticDiagnosticsSyncRequestArgs;
2681    }
2682
2683    export interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
2684        includeLinePosition?: boolean;
2685    }
2686
2687    /**
2688     * Response object for synchronous sematic diagnostics request.
2689     */
2690    export interface SemanticDiagnosticsSyncResponse extends Response {
2691        body?: Diagnostic[] | DiagnosticWithLinePosition[];
2692    }
2693
2694    export interface SuggestionDiagnosticsSyncRequest extends FileRequest {
2695        command: CommandTypes.SuggestionDiagnosticsSync;
2696        arguments: SuggestionDiagnosticsSyncRequestArgs;
2697    }
2698
2699    export type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
2700    export type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
2701
2702    /**
2703     * Synchronous request for syntactic diagnostics of one file.
2704     */
2705    export interface SyntacticDiagnosticsSyncRequest extends FileRequest {
2706        command: CommandTypes.SyntacticDiagnosticsSync;
2707        arguments: SyntacticDiagnosticsSyncRequestArgs;
2708    }
2709
2710    export interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
2711        includeLinePosition?: boolean;
2712    }
2713
2714    /**
2715     * Response object for synchronous syntactic diagnostics request.
2716     */
2717    export interface SyntacticDiagnosticsSyncResponse extends Response {
2718        body?: Diagnostic[] | DiagnosticWithLinePosition[];
2719    }
2720
2721    /**
2722     * Arguments for GeterrForProject request.
2723     */
2724    export interface GeterrForProjectRequestArgs {
2725        /**
2726         * the file requesting project error list
2727         */
2728        file: string;
2729
2730        /**
2731         * Delay in milliseconds to wait before starting to compute
2732         * errors for the files in the file list
2733         */
2734        delay: number;
2735    }
2736
2737    /**
2738     * GeterrForProjectRequest request; value of command field is
2739     * "geterrForProject". It works similarly with 'Geterr', only
2740     * it request for every file in this project.
2741     */
2742    export interface GeterrForProjectRequest extends Request {
2743        command: CommandTypes.GeterrForProject;
2744        arguments: GeterrForProjectRequestArgs;
2745    }
2746
2747    /**
2748     * Arguments for geterr messages.
2749     */
2750    export interface GeterrRequestArgs {
2751        /**
2752         * List of file names for which to compute compiler errors.
2753         * The files will be checked in list order.
2754         */
2755        files: string[];
2756
2757        /**
2758         * Delay in milliseconds to wait before starting to compute
2759         * errors for the files in the file list
2760         */
2761        delay: number;
2762    }
2763
2764    /**
2765     * Geterr request; value of command field is "geterr". Wait for
2766     * delay milliseconds and then, if during the wait no change or
2767     * reload messages have arrived for the first file in the files
2768     * list, get the syntactic errors for the file, field requests,
2769     * and then get the semantic errors for the file.  Repeat with a
2770     * smaller delay for each subsequent file on the files list.  Best
2771     * practice for an editor is to send a file list containing each
2772     * file that is currently visible, in most-recently-used order.
2773     */
2774    export interface GeterrRequest extends Request {
2775        command: CommandTypes.Geterr;
2776        arguments: GeterrRequestArgs;
2777    }
2778
2779    export type RequestCompletedEventName = "requestCompleted";
2780
2781    /**
2782     * Event that is sent when server have finished processing request with specified id.
2783     */
2784    export interface RequestCompletedEvent extends Event {
2785        event: RequestCompletedEventName;
2786        body: RequestCompletedEventBody;
2787    }
2788
2789    export interface RequestCompletedEventBody {
2790        request_seq: number;
2791    }
2792
2793    /**
2794     * Item of diagnostic information found in a DiagnosticEvent message.
2795     */
2796    export interface Diagnostic {
2797        /**
2798         * Starting file location at which text applies.
2799         */
2800        start: Location;
2801
2802        /**
2803         * The last file location at which the text applies.
2804         */
2805        end: Location;
2806
2807        /**
2808         * Text of diagnostic message.
2809         */
2810        text: string;
2811
2812        /**
2813         * The category of the diagnostic message, e.g. "error", "warning", or "suggestion".
2814         */
2815        category: string;
2816
2817        reportsUnnecessary?: {};
2818
2819        reportsDeprecated?: {};
2820
2821        /**
2822         * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
2823         */
2824        relatedInformation?: DiagnosticRelatedInformation[];
2825
2826        /**
2827         * The error code of the diagnostic message.
2828         */
2829        code?: number;
2830
2831        /**
2832         * The name of the plugin reporting the message.
2833         */
2834        source?: string;
2835    }
2836
2837    export interface DiagnosticWithFileName extends Diagnostic {
2838        /**
2839         * Name of the file the diagnostic is in
2840         */
2841        fileName: string;
2842    }
2843
2844    /**
2845     * Represents additional spans returned with a diagnostic which are relevant to it
2846     */
2847    export interface DiagnosticRelatedInformation {
2848        /**
2849         * The category of the related information message, e.g. "error", "warning", or "suggestion".
2850         */
2851        category: string;
2852        /**
2853         * The code used ot identify the related information
2854         */
2855        code: number;
2856        /**
2857         * Text of related or additional information.
2858         */
2859        message: string;
2860        /**
2861         * Associated location
2862         */
2863        span?: FileSpan;
2864    }
2865
2866    export interface DiagnosticEventBody {
2867        /**
2868         * The file for which diagnostic information is reported.
2869         */
2870        file: string;
2871
2872        /**
2873         * An array of diagnostic information items.
2874         */
2875        diagnostics: Diagnostic[];
2876    }
2877
2878    export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
2879
2880    /**
2881     * Event message for DiagnosticEventKind event types.
2882     * These events provide syntactic and semantic errors for a file.
2883     */
2884    export interface DiagnosticEvent extends Event {
2885        body?: DiagnosticEventBody;
2886        event: DiagnosticEventKind;
2887    }
2888
2889    export interface ConfigFileDiagnosticEventBody {
2890        /**
2891         * The file which trigged the searching and error-checking of the config file
2892         */
2893        triggerFile: string;
2894
2895        /**
2896         * The name of the found config file.
2897         */
2898        configFile: string;
2899
2900        /**
2901         * An arry of diagnostic information items for the found config file.
2902         */
2903        diagnostics: DiagnosticWithFileName[];
2904    }
2905
2906    /**
2907     * Event message for "configFileDiag" event type.
2908     * This event provides errors for a found config file.
2909     */
2910    export interface ConfigFileDiagnosticEvent extends Event {
2911        body?: ConfigFileDiagnosticEventBody;
2912        event: "configFileDiag";
2913    }
2914
2915    export type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
2916    export interface ProjectLanguageServiceStateEvent extends Event {
2917        event: ProjectLanguageServiceStateEventName;
2918        body?: ProjectLanguageServiceStateEventBody;
2919    }
2920
2921    export interface ProjectLanguageServiceStateEventBody {
2922        /**
2923         * Project name that has changes in the state of language service.
2924         * For configured projects this will be the config file path.
2925         * For external projects this will be the name of the projects specified when project was open.
2926         * For inferred projects this event is not raised.
2927         */
2928        projectName: string;
2929        /**
2930         * True if language service state switched from disabled to enabled
2931         * and false otherwise.
2932         */
2933        languageServiceEnabled: boolean;
2934    }
2935
2936    export type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
2937    export interface ProjectsUpdatedInBackgroundEvent extends Event {
2938        event: ProjectsUpdatedInBackgroundEventName;
2939        body: ProjectsUpdatedInBackgroundEventBody;
2940    }
2941
2942    export interface ProjectsUpdatedInBackgroundEventBody {
2943        /**
2944         * Current set of open files
2945         */
2946        openFiles: string[];
2947    }
2948
2949    export type ProjectLoadingStartEventName = "projectLoadingStart";
2950    export interface ProjectLoadingStartEvent extends Event {
2951        event: ProjectLoadingStartEventName;
2952        body: ProjectLoadingStartEventBody;
2953    }
2954
2955    export interface ProjectLoadingStartEventBody {
2956        /** name of the project */
2957        projectName: string;
2958        /** reason for loading */
2959        reason: string;
2960    }
2961
2962    export type ProjectLoadingFinishEventName = "projectLoadingFinish";
2963    export interface ProjectLoadingFinishEvent extends Event {
2964        event: ProjectLoadingFinishEventName;
2965        body: ProjectLoadingFinishEventBody;
2966    }
2967
2968    export interface ProjectLoadingFinishEventBody {
2969        /** name of the project */
2970        projectName: string;
2971    }
2972
2973    export type SurveyReadyEventName = "surveyReady";
2974
2975    export interface SurveyReadyEvent extends Event {
2976        event: SurveyReadyEventName;
2977        body: SurveyReadyEventBody;
2978    }
2979
2980    export interface SurveyReadyEventBody {
2981        /** Name of the survey. This is an internal machine- and programmer-friendly name */
2982        surveyId: string;
2983    }
2984
2985    export type LargeFileReferencedEventName = "largeFileReferenced";
2986    export interface LargeFileReferencedEvent extends Event {
2987        event: LargeFileReferencedEventName;
2988        body: LargeFileReferencedEventBody;
2989    }
2990
2991    export interface LargeFileReferencedEventBody {
2992        /**
2993         * name of the large file being loaded
2994         */
2995        file: string;
2996        /**
2997         * size of the file
2998         */
2999        fileSize: number;
3000        /**
3001         * max file size allowed on the server
3002         */
3003        maxFileSize: number;
3004    }
3005
3006    /*@internal*/
3007    export type AnyEvent =
3008        RequestCompletedEvent
3009        | DiagnosticEvent
3010        | ConfigFileDiagnosticEvent
3011        | ProjectLanguageServiceStateEvent
3012        | TelemetryEvent
3013        | ProjectsUpdatedInBackgroundEvent
3014        | ProjectLoadingStartEvent
3015        | ProjectLoadingFinishEvent
3016        | SurveyReadyEvent
3017        | LargeFileReferencedEvent;
3018
3019    /**
3020     * Arguments for reload request.
3021     */
3022    export interface ReloadRequestArgs extends FileRequestArgs {
3023        /**
3024         * Name of temporary file from which to reload file
3025         * contents. May be same as file.
3026         */
3027        tmpfile: string;
3028    }
3029
3030    /**
3031     * Reload request message; value of command field is "reload".
3032     * Reload contents of file with name given by the 'file' argument
3033     * from temporary file with name given by the 'tmpfile' argument.
3034     * The two names can be identical.
3035     */
3036    export interface ReloadRequest extends FileRequest {
3037        command: CommandTypes.Reload;
3038        arguments: ReloadRequestArgs;
3039    }
3040
3041    /**
3042     * Response to "reload" request. This is just an acknowledgement, so
3043     * no body field is required.
3044     */
3045    export interface ReloadResponse extends Response {
3046    }
3047
3048    /**
3049     * Arguments for saveto request.
3050     */
3051    export interface SavetoRequestArgs extends FileRequestArgs {
3052        /**
3053         * Name of temporary file into which to save server's view of
3054         * file contents.
3055         */
3056        tmpfile: string;
3057    }
3058
3059    /**
3060     * Saveto request message; value of command field is "saveto".
3061     * For debugging purposes, save to a temporaryfile (named by
3062     * argument 'tmpfile') the contents of file named by argument
3063     * 'file'.  The server does not currently send a response to a
3064     * "saveto" request.
3065     */
3066    export interface SavetoRequest extends FileRequest {
3067        command: CommandTypes.Saveto;
3068        arguments: SavetoRequestArgs;
3069    }
3070
3071    /**
3072     * Arguments for navto request message.
3073     */
3074    export interface NavtoRequestArgs {
3075        /**
3076         * Search term to navigate to from current location; term can
3077         * be '.*' or an identifier prefix.
3078         */
3079        searchValue: string;
3080        /**
3081         *  Optional limit on the number of items to return.
3082         */
3083        maxResultCount?: number;
3084        /**
3085         * The file for the request (absolute pathname required).
3086         */
3087        file?: string;
3088        /**
3089         * Optional flag to indicate we want results for just the current file
3090         * or the entire project.
3091         */
3092        currentFileOnly?: boolean;
3093
3094        projectFileName?: string;
3095    }
3096
3097    /**
3098     * Navto request message; value of command field is "navto".
3099     * Return list of objects giving file locations and symbols that
3100     * match the search term given in argument 'searchTerm'.  The
3101     * context for the search is given by the named file.
3102     */
3103    export interface NavtoRequest extends Request {
3104        command: CommandTypes.Navto;
3105        arguments: NavtoRequestArgs;
3106    }
3107
3108    /**
3109     * An item found in a navto response.
3110     */
3111    export interface NavtoItem extends FileSpan {
3112        /**
3113         * The symbol's name.
3114         */
3115        name: string;
3116
3117        /**
3118         * The symbol's kind (such as 'className' or 'parameterName').
3119         */
3120        kind: ScriptElementKind;
3121
3122        /**
3123         * exact, substring, or prefix.
3124         */
3125        matchKind: string;
3126
3127        /**
3128         * If this was a case sensitive or insensitive match.
3129         */
3130        isCaseSensitive: boolean;
3131
3132        /**
3133         * Optional modifiers for the kind (such as 'public').
3134         */
3135        kindModifiers?: string;
3136
3137        /**
3138         * Name of symbol's container symbol (if any); for example,
3139         * the class name if symbol is a class member.
3140         */
3141        containerName?: string;
3142
3143        /**
3144         * Kind of symbol's container symbol (if any).
3145         */
3146        containerKind?: ScriptElementKind;
3147    }
3148
3149    /**
3150     * Navto response message. Body is an array of navto items.  Each
3151     * item gives a symbol that matched the search term.
3152     */
3153    export interface NavtoResponse extends Response {
3154        body?: NavtoItem[];
3155    }
3156
3157    /**
3158     * Arguments for change request message.
3159     */
3160    export interface ChangeRequestArgs extends FormatRequestArgs {
3161        /**
3162         * Optional string to insert at location (file, line, offset).
3163         */
3164        insertString?: string;
3165    }
3166
3167    /**
3168     * Change request message; value of command field is "change".
3169     * Update the server's view of the file named by argument 'file'.
3170     * Server does not currently send a response to a change request.
3171     */
3172    export interface ChangeRequest extends FileLocationRequest {
3173        command: CommandTypes.Change;
3174        arguments: ChangeRequestArgs;
3175    }
3176
3177    /**
3178     * Response to "brace" request.
3179     */
3180    export interface BraceResponse extends Response {
3181        body?: TextSpan[];
3182    }
3183
3184    /**
3185     * Brace matching request; value of command field is "brace".
3186     * Return response giving the file locations of matching braces
3187     * found in file at location line, offset.
3188     */
3189    export interface BraceRequest extends FileLocationRequest {
3190        command: CommandTypes.Brace;
3191    }
3192
3193    /**
3194     * NavBar items request; value of command field is "navbar".
3195     * Return response giving the list of navigation bar entries
3196     * extracted from the requested file.
3197     */
3198    export interface NavBarRequest extends FileRequest {
3199        command: CommandTypes.NavBar;
3200    }
3201
3202    /**
3203     * NavTree request; value of command field is "navtree".
3204     * Return response giving the navigation tree of the requested file.
3205     */
3206    export interface NavTreeRequest extends FileRequest {
3207        command: CommandTypes.NavTree;
3208    }
3209
3210    export interface NavigationBarItem {
3211        /**
3212         * The item's display text.
3213         */
3214        text: string;
3215
3216        /**
3217         * The symbol's kind (such as 'className' or 'parameterName').
3218         */
3219        kind: ScriptElementKind;
3220
3221        /**
3222         * Optional modifiers for the kind (such as 'public').
3223         */
3224        kindModifiers?: string;
3225
3226        /**
3227         * The definition locations of the item.
3228         */
3229        spans: TextSpan[];
3230
3231        /**
3232         * Optional children.
3233         */
3234        childItems?: NavigationBarItem[];
3235
3236        /**
3237         * Number of levels deep this item should appear.
3238         */
3239        indent: number;
3240    }
3241
3242    /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
3243    export interface NavigationTree {
3244        text: string;
3245        kind: ScriptElementKind;
3246        kindModifiers: string;
3247        spans: TextSpan[];
3248        nameSpan: TextSpan | undefined;
3249        childItems?: NavigationTree[];
3250    }
3251
3252    export type TelemetryEventName = "telemetry";
3253
3254    export interface TelemetryEvent extends Event {
3255        event: TelemetryEventName;
3256        body: TelemetryEventBody;
3257    }
3258
3259    export interface TelemetryEventBody {
3260        telemetryEventName: string;
3261        payload: any;
3262    }
3263
3264    export type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
3265
3266    export interface TypesInstallerInitializationFailedEvent extends Event {
3267        event: TypesInstallerInitializationFailedEventName;
3268        body: TypesInstallerInitializationFailedEventBody;
3269    }
3270
3271    export interface TypesInstallerInitializationFailedEventBody {
3272        message: string;
3273    }
3274
3275    export type TypingsInstalledTelemetryEventName = "typingsInstalled";
3276
3277    export interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
3278        telemetryEventName: TypingsInstalledTelemetryEventName;
3279        payload: TypingsInstalledTelemetryEventPayload;
3280    }
3281
3282    // A __GDPR__FRAGMENT__ has no meaning until it is ${include}d by a __GDPR__ comment, at which point
3283    // the included properties are effectively inlined into the __GDPR__ declaration.  In this case, for
3284    // example, any __GDPR__ comment including the TypeScriptCommonProperties will be updated with an
3285    // additional version property with the classification below.  Obviously, the purpose of such a construct
3286    // is to reduce duplication and keep multiple use sites consistent (e.g. by making sure that all reflect
3287    // any newly added TypeScriptCommonProperties).  Unfortunately, the system has limits - in particular,
3288    // these reusable __GDPR__FRAGMENT__s are not accessible across repo boundaries.  Therefore, even though
3289    // the code for adding the common properties (i.e. version), along with the corresponding __GDPR__FRAGMENT__,
3290    // lives in the VS Code repo (see https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/utils/telemetry.ts)
3291    // we have to duplicate it here.  It would be nice to keep them in sync, but the only likely failure mode
3292    // is adding a property to the VS Code repro but not here and the only consequence would be having that
3293    // property suppressed on the events (i.e. __GDPT__ comments) in this repo that reference the out-of-date
3294    // local __GDPR__FRAGMENT__.
3295    /* __GDPR__FRAGMENT__
3296        "TypeScriptCommonProperties" : {
3297            "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
3298        }
3299    */
3300
3301    /* __GDPR__
3302        "typingsinstalled" : {
3303            "${include}": ["${TypeScriptCommonProperties}"],
3304            "installedPackages": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" },
3305            "installSuccess": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
3306            "typingsInstallerVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
3307        }
3308     */
3309    export interface TypingsInstalledTelemetryEventPayload {
3310        /**
3311         * Comma separated list of installed typing packages
3312         */
3313        installedPackages: string;
3314        /**
3315         * true if install request succeeded, otherwise - false
3316         */
3317        installSuccess: boolean;
3318
3319        /**
3320         * version of typings installer
3321         */
3322        typingsInstallerVersion: string;
3323    }
3324
3325    export type BeginInstallTypesEventName = "beginInstallTypes";
3326    export type EndInstallTypesEventName = "endInstallTypes";
3327
3328    export interface BeginInstallTypesEvent extends Event {
3329        event: BeginInstallTypesEventName;
3330        body: BeginInstallTypesEventBody;
3331    }
3332
3333    export interface EndInstallTypesEvent extends Event {
3334        event: EndInstallTypesEventName;
3335        body: EndInstallTypesEventBody;
3336    }
3337
3338    export interface InstallTypesEventBody {
3339        /**
3340         * correlation id to match begin and end events
3341         */
3342        eventId: number;
3343        /**
3344         * list of packages to install
3345         */
3346        packages: readonly string[];
3347    }
3348
3349    export interface BeginInstallTypesEventBody extends InstallTypesEventBody {
3350    }
3351
3352    export interface EndInstallTypesEventBody extends InstallTypesEventBody {
3353        /**
3354         * true if installation succeeded, otherwise false
3355         */
3356        success: boolean;
3357    }
3358
3359    export interface NavBarResponse extends Response {
3360        body?: NavigationBarItem[];
3361    }
3362
3363    export interface NavTreeResponse extends Response {
3364        body?: NavigationTree;
3365    }
3366
3367    export interface CallHierarchyItem {
3368        name: string;
3369        kind: ScriptElementKind;
3370        kindModifiers?: string
3371        file: string;
3372        span: TextSpan;
3373        selectionSpan: TextSpan;
3374        containerName?: string;
3375    }
3376
3377    export interface CallHierarchyIncomingCall {
3378        from: CallHierarchyItem;
3379        fromSpans: TextSpan[];
3380    }
3381
3382    export interface CallHierarchyOutgoingCall {
3383        to: CallHierarchyItem;
3384        fromSpans: TextSpan[];
3385    }
3386
3387    export interface PrepareCallHierarchyRequest extends FileLocationRequest {
3388        command: CommandTypes.PrepareCallHierarchy;
3389    }
3390
3391    export interface PrepareCallHierarchyResponse extends Response {
3392        readonly body: CallHierarchyItem | CallHierarchyItem[];
3393    }
3394
3395    export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
3396        command: CommandTypes.ProvideCallHierarchyIncomingCalls;
3397    }
3398
3399    export interface ProvideCallHierarchyIncomingCallsResponse extends Response {
3400        readonly body: CallHierarchyIncomingCall[];
3401    }
3402
3403    export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
3404        command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
3405    }
3406
3407    export interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
3408        readonly body: CallHierarchyOutgoingCall[];
3409    }
3410
3411    export const enum IndentStyle {
3412        None = "None",
3413        Block = "Block",
3414        Smart = "Smart",
3415    }
3416
3417    export enum SemicolonPreference {
3418        Ignore = "ignore",
3419        Insert = "insert",
3420        Remove = "remove",
3421    }
3422
3423    export interface EditorSettings {
3424        baseIndentSize?: number;
3425        indentSize?: number;
3426        tabSize?: number;
3427        newLineCharacter?: string;
3428        convertTabsToSpaces?: boolean;
3429        indentStyle?: IndentStyle | ts.IndentStyle;
3430        trimTrailingWhitespace?: boolean;
3431    }
3432
3433    export interface FormatCodeSettings extends EditorSettings {
3434        insertSpaceAfterCommaDelimiter?: boolean;
3435        insertSpaceAfterSemicolonInForStatements?: boolean;
3436        insertSpaceBeforeAndAfterBinaryOperators?: boolean;
3437        insertSpaceAfterConstructor?: boolean;
3438        insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
3439        insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
3440        insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
3441        insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
3442        insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
3443        insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
3444        insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
3445        insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
3446        insertSpaceAfterTypeAssertion?: boolean;
3447        insertSpaceBeforeFunctionParenthesis?: boolean;
3448        placeOpenBraceOnNewLineForFunctions?: boolean;
3449        placeOpenBraceOnNewLineForControlBlocks?: boolean;
3450        insertSpaceBeforeTypeAnnotation?: boolean;
3451        semicolons?: SemicolonPreference;
3452    }
3453
3454    export interface UserPreferences {
3455        readonly disableSuggestions?: boolean;
3456        readonly quotePreference?: "auto" | "double" | "single";
3457        /**
3458         * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
3459         * This affects lone identifier completions but not completions on the right hand side of `obj.`.
3460         */
3461        readonly includeCompletionsForModuleExports?: boolean;
3462        /**
3463         * Enables auto-import-style completions on partially-typed import statements. E.g., allows
3464         * `import write|` to be completed to `import { writeFile } from "fs"`.
3465         */
3466        readonly includeCompletionsForImportStatements?: boolean;
3467        /**
3468         * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
3469         */
3470        readonly includeCompletionsWithSnippetText?: boolean;
3471        /**
3472         * If enabled, the completion list will include completions with invalid identifier names.
3473         * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
3474         */
3475        readonly includeCompletionsWithInsertText?: boolean;
3476        /**
3477         * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
3478         * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
3479         * values, with insertion text to replace preceding `.` tokens with `?.`.
3480         */
3481        readonly includeAutomaticOptionalChainCompletions?: boolean;
3482        /**
3483         * If enabled, completions for class members (e.g. methods and properties) will include
3484         * a whole declaration for the member.
3485         * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
3486         * `class A { foo }`.
3487         */
3488        readonly includeCompletionsWithClassMemberSnippets?: boolean;
3489        /**
3490         * If enabled, object literal methods will have a method declaration completion entry in addition
3491         * to the regular completion entry containing just the method name.
3492         * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
3493         * in addition to `const objectLiteral: T = { foo }`.
3494         */
3495        readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
3496        /**
3497         * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
3498         * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
3499         */
3500        readonly useLabelDetailsInCompletionEntries?: boolean;
3501        readonly allowIncompleteCompletions?: boolean;
3502        readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
3503        /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
3504        readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
3505        readonly allowTextChangesInNewFiles?: boolean;
3506        readonly lazyConfiguredProjectsFromExternalProject?: boolean;
3507        readonly providePrefixAndSuffixTextForRename?: boolean;
3508        readonly provideRefactorNotApplicableReason?: boolean;
3509        readonly allowRenameOfImportPath?: boolean;
3510        readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
3511        readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
3512
3513        readonly displayPartsForJSDoc?: boolean;
3514        readonly generateReturnInDocTemplate?: boolean;
3515
3516        readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
3517        readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
3518        readonly includeInlayFunctionParameterTypeHints?: boolean,
3519        readonly includeInlayVariableTypeHints?: boolean;
3520        readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
3521        readonly includeInlayPropertyDeclarationTypeHints?: boolean;
3522        readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
3523        readonly includeInlayEnumMemberValueHints?: boolean;
3524        readonly autoImportFileExcludePatterns?: string[];
3525
3526        /**
3527         * Indicates whether {@link ReferencesResponseItem.lineText} is supported.
3528         */
3529        readonly disableLineTextInReferences?: boolean;
3530    }
3531
3532    export interface CompilerOptions {
3533        allowJs?: boolean;
3534        allowSyntheticDefaultImports?: boolean;
3535        allowUnreachableCode?: boolean;
3536        allowUnusedLabels?: boolean;
3537        alwaysStrict?: boolean;
3538        baseUrl?: string;
3539        charset?: string;
3540        checkJs?: boolean;
3541        declaration?: boolean;
3542        declarationDir?: string;
3543        disableSizeLimit?: boolean;
3544        downlevelIteration?: boolean;
3545        emitBOM?: boolean;
3546        emitDecoratorMetadata?: boolean;
3547        experimentalDecorators?: boolean;
3548        forceConsistentCasingInFileNames?: boolean;
3549        importHelpers?: boolean;
3550        inlineSourceMap?: boolean;
3551        inlineSources?: boolean;
3552        isolatedModules?: boolean;
3553        jsx?: JsxEmit | ts.JsxEmit;
3554        lib?: string[];
3555        locale?: string;
3556        mapRoot?: string;
3557        maxNodeModuleJsDepth?: number;
3558        module?: ModuleKind | ts.ModuleKind;
3559        moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
3560        newLine?: NewLineKind | ts.NewLineKind;
3561        noEmit?: boolean;
3562        noEmitHelpers?: boolean;
3563        noEmitOnError?: boolean;
3564        noErrorTruncation?: boolean;
3565        noFallthroughCasesInSwitch?: boolean;
3566        noImplicitAny?: boolean;
3567        noImplicitReturns?: boolean;
3568        noImplicitThis?: boolean;
3569        noUnusedLocals?: boolean;
3570        noUnusedParameters?: boolean;
3571        noImplicitUseStrict?: boolean;
3572        noLib?: boolean;
3573        noResolve?: boolean;
3574        out?: string;
3575        outDir?: string;
3576        outFile?: string;
3577        paths?: MapLike<string[]>;
3578        plugins?: PluginImport[];
3579        preserveConstEnums?: boolean;
3580        preserveSymlinks?: boolean;
3581        project?: string;
3582        reactNamespace?: string;
3583        removeComments?: boolean;
3584        references?: ProjectReference[];
3585        rootDir?: string;
3586        rootDirs?: string[];
3587        skipLibCheck?: boolean;
3588        skipDefaultLibCheck?: boolean;
3589        sourceMap?: boolean;
3590        sourceRoot?: string;
3591        strict?: boolean;
3592        strictNullChecks?: boolean;
3593        suppressExcessPropertyErrors?: boolean;
3594        suppressImplicitAnyIndexErrors?: boolean;
3595        useDefineForClassFields?: boolean;
3596        target?: ScriptTarget | ts.ScriptTarget;
3597        traceResolution?: boolean;
3598        resolveJsonModule?: boolean;
3599        types?: string[];
3600        /** Paths used to used to compute primary types search locations */
3601        typeRoots?: string[];
3602        ets?: EtsOptions;
3603        packageManagerType?: string;
3604        emitNodeModulesFiles?: boolean;
3605        [option: string]: CompilerOptionsValue | undefined;
3606    }
3607
3608    export const enum JsxEmit {
3609        None = "None",
3610        Preserve = "Preserve",
3611        ReactNative = "ReactNative",
3612        React = "React",
3613    }
3614
3615    export const enum ModuleKind {
3616        None = "None",
3617        CommonJS = "CommonJS",
3618        AMD = "AMD",
3619        UMD = "UMD",
3620        System = "System",
3621        ES6 = "ES6",
3622        ES2015 = "ES2015",
3623        ESNext = "ESNext"
3624    }
3625
3626    export const enum ModuleResolutionKind {
3627        Classic = "Classic",
3628        Node = "Node",
3629    }
3630
3631    export const enum NewLineKind {
3632        Crlf = "Crlf",
3633        Lf = "Lf",
3634    }
3635
3636    export const enum ScriptTarget {
3637        ES3 = "ES3",
3638        ES5 = "ES5",
3639        ES6 = "ES6",
3640        ES2015 = "ES2015",
3641        ES2016 = "ES2016",
3642        ES2017 = "ES2017",
3643        ES2018 = "ES2018",
3644        ES2019 = "ES2019",
3645        ES2020 = "ES2020",
3646        ES2021 = "ES2021",
3647        ES2022 = "ES2022",
3648        ESNext = "ESNext"
3649    }
3650
3651    export const enum ClassificationType {
3652        comment = 1,
3653        identifier = 2,
3654        keyword = 3,
3655        numericLiteral = 4,
3656        operator = 5,
3657        stringLiteral = 6,
3658        regularExpressionLiteral = 7,
3659        whiteSpace = 8,
3660        text = 9,
3661        punctuation = 10,
3662        className = 11,
3663        enumName = 12,
3664        interfaceName = 13,
3665        moduleName = 14,
3666        typeParameterName = 15,
3667        typeAliasName = 16,
3668        parameterName = 17,
3669        docCommentTagName = 18,
3670        jsxOpenTagName = 19,
3671        jsxCloseTagName = 20,
3672        jsxSelfClosingTagName = 21,
3673        jsxAttribute = 22,
3674        jsxText = 23,
3675        jsxAttributeStringLiteralValue = 24,
3676        bigintLiteral = 25,
3677    }
3678}
3679