22 * Declaration module describing the TypeScript Server protocol
33 */
44declare namespace ts . server . protocol {
5- const enum CommandTypes {
6- Brace = "brace" ,
7- BraceCompletion = "braceCompletion" ,
8- Change = "change" ,
9- Close = "close" ,
10- Completions = "completions" ,
11- CompletionDetails = "completionEntryDetails" ,
12- CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList" ,
13- CompileOnSaveEmitFile = "compileOnSaveEmitFile" ,
14- Configure = "configure" ,
15- Definition = "definition" ,
16- Implementation = "implementation" ,
17- Exit = "exit" ,
18- Format = "format" ,
19- Formatonkey = "formatonkey" ,
20- Geterr = "geterr" ,
21- GeterrForProject = "geterrForProject" ,
22- SemanticDiagnosticsSync = "semanticDiagnosticsSync" ,
23- SyntacticDiagnosticsSync = "syntacticDiagnosticsSync" ,
24- NavBar = "navbar" ,
25- Navto = "navto" ,
26- NavTree = "navtree" ,
27- NavTreeFull = "navtree-full" ,
28- Occurrences = "occurrences" ,
29- DocumentHighlights = "documentHighlights" ,
30- Open = "open" ,
31- Quickinfo = "quickinfo" ,
32- References = "references" ,
33- Reload = "reload" ,
34- Rename = "rename" ,
35- Saveto = "saveto" ,
36- SignatureHelp = "signatureHelp" ,
37- TypeDefinition = "typeDefinition" ,
38- ProjectInfo = "projectInfo" ,
39- ReloadProjects = "reloadProjects" ,
40- Unknown = "unknown" ,
41- OpenExternalProject = "openExternalProject" ,
42- OpenExternalProjects = "openExternalProjects" ,
43- CloseExternalProject = "closeExternalProject" ,
44- TodoComments = "todoComments" ,
45- Indentation = "indentation" ,
46- DocCommentTemplate = "docCommentTemplate" ,
47- CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects" ,
48- GetCodeFixes = "getCodeFixes" ,
49- GetSupportedCodeFixes = "getSupportedCodeFixes" ,
50- GetApplicableRefactors = "getApplicableRefactors" ,
51- GetEditsForRefactor = "getEditsForRefactor" ,
5+ namespace CommandTypes {
6+ type Brace = "brace" ;
7+ type BraceCompletion = "braceCompletion" ;
8+ type Change = "change" ;
9+ type Close = "close" ;
10+ type Completions = "completions" ;
11+ type CompletionDetails = "completionEntryDetails" ;
12+ type CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList" ;
13+ type CompileOnSaveEmitFile = "compileOnSaveEmitFile" ;
14+ type Configure = "configure" ;
15+ type Definition = "definition" ;
16+ type Implementation = "implementation" ;
17+ type Exit = "exit" ;
18+ type Format = "format" ;
19+ type Formatonkey = "formatonkey" ;
20+ type Geterr = "geterr" ;
21+ type GeterrForProject = "geterrForProject" ;
22+ type SemanticDiagnosticsSync = "semanticDiagnosticsSync" ;
23+ type SyntacticDiagnosticsSync = "syntacticDiagnosticsSync" ;
24+ type NavBar = "navbar" ;
25+ type Navto = "navto" ;
26+ type NavTree = "navtree" ;
27+ type NavTreeFull = "navtree-full" ;
28+ type Occurrences = "occurrences" ;
29+ type DocumentHighlights = "documentHighlights" ;
30+ type Open = "open" ;
31+ type Quickinfo = "quickinfo" ;
32+ type References = "references" ;
33+ type Reload = "reload" ;
34+ type Rename = "rename" ;
35+ type Saveto = "saveto" ;
36+ type SignatureHelp = "signatureHelp" ;
37+ type TypeDefinition = "typeDefinition" ;
38+ type ProjectInfo = "projectInfo" ;
39+ type ReloadProjects = "reloadProjects" ;
40+ type Unknown = "unknown" ;
41+ type OpenExternalProject = "openExternalProject" ;
42+ type OpenExternalProjects = "openExternalProjects" ;
43+ type CloseExternalProject = "closeExternalProject" ;
44+ type TodoComments = "todoComments" ;
45+ type Indentation = "indentation" ;
46+ type DocCommentTemplate = "docCommentTemplate" ;
47+ type CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects" ;
48+ type GetCodeFixes = "getCodeFixes" ;
49+ type GetSupportedCodeFixes = "getSupportedCodeFixes" ;
50+ type GetApplicableRefactors = "getApplicableRefactors" ;
51+ type GetRefactorCodeActions = "getRefactorCodeActions" ;
52+ type GetEditsForRefactor = "getEditsForRefactor" ;
5253 }
5354 /**
5455 * A TypeScript Server message
@@ -571,9 +572,10 @@ declare namespace ts.server.protocol {
571572 }
572573 /**
573574 * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
575+ * Kind is taken from HighlightSpanKind type.
574576 */
575577 interface HighlightSpan extends TextSpan {
576- kind : HighlightSpanKind ;
578+ kind : string ;
577579 }
578580 /**
579581 * Represents a set of highligh spans for a give name
@@ -691,7 +693,7 @@ declare namespace ts.server.protocol {
691693 /**
692694 * The items's kind (such as 'className' or 'parameterName' or plain 'text').
693695 */
694- kind : ScriptElementKind ;
696+ kind : string ;
695697 /**
696698 * Optional modifiers for the kind (such as 'public').
697699 */
@@ -1039,7 +1041,7 @@ declare namespace ts.server.protocol {
10391041 /**
10401042 * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
10411043 */
1042- kind : ScriptElementKind ;
1044+ kind : string ;
10431045 /**
10441046 * Optional modifiers for the kind (such as 'public').
10451047 */
@@ -1225,7 +1227,7 @@ declare namespace ts.server.protocol {
12251227 /**
12261228 * The symbol's kind (such as 'className' or 'parameterName').
12271229 */
1228- kind : ScriptElementKind ;
1230+ kind : string ;
12291231 /**
12301232 * Optional modifiers for the kind (such as 'public').
12311233 */
@@ -1252,7 +1254,7 @@ declare namespace ts.server.protocol {
12521254 /**
12531255 * The symbol's kind (such as 'className' or 'parameterName').
12541256 */
1255- kind : ScriptElementKind ;
1257+ kind : string ;
12561258 /**
12571259 * Optional modifiers for the kind (such as 'public').
12581260 */
@@ -1645,7 +1647,7 @@ declare namespace ts.server.protocol {
16451647 /**
16461648 * The symbol's kind (such as 'className' or 'parameterName').
16471649 */
1648- kind : ScriptElementKind ;
1650+ kind : string ;
16491651 /**
16501652 * exact, substring, or prefix.
16511653 */
@@ -1678,7 +1680,7 @@ declare namespace ts.server.protocol {
16781680 /**
16791681 * Kind of symbol's container symbol (if any).
16801682 */
1681- containerKind ?: ScriptElementKind ;
1683+ containerKind ?: string ;
16821684 }
16831685 /**
16841686 * Navto response message. Body is an array of navto items. Each
@@ -1742,7 +1744,7 @@ declare namespace ts.server.protocol {
17421744 /**
17431745 * The symbol's kind (such as 'className' or 'parameterName').
17441746 */
1745- kind : ScriptElementKind ;
1747+ kind : string ;
17461748 /**
17471749 * Optional modifiers for the kind (such as 'public').
17481750 */
@@ -1763,7 +1765,7 @@ declare namespace ts.server.protocol {
17631765 /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
17641766 interface NavigationTree {
17651767 text : string ;
1766- kind : ScriptElementKind ;
1768+ kind : string ;
17671769 kindModifiers : string ;
17681770 spans : TextSpan [ ] ;
17691771 childItems ?: NavigationTree [ ] ;
@@ -1838,11 +1840,12 @@ declare namespace ts.server.protocol {
18381840 interface NavTreeResponse extends Response {
18391841 body ?: NavigationTree ;
18401842 }
1841- const enum IndentStyle {
1842- None = "None" ,
1843- Block = "Block" ,
1844- Smart = "Smart" ,
1843+ namespace IndentStyle {
1844+ type None = "None" ;
1845+ type Block = "Block" ;
1846+ type Smart = "Smart" ;
18451847 }
1848+ type IndentStyle = IndentStyle . None | IndentStyle . Block | IndentStyle . Smart ;
18461849 interface EditorSettings {
18471850 baseIndentSize ?: number ;
18481851 indentSize ?: number ;
@@ -1936,35 +1939,40 @@ declare namespace ts.server.protocol {
19361939 typeRoots ?: string [ ] ;
19371940 [ option : string ] : CompilerOptionsValue | undefined ;
19381941 }
1939- const enum JsxEmit {
1940- None = "None" ,
1941- Preserve = "Preserve" ,
1942- ReactNative = "ReactNative" ,
1943- React = "React" ,
1944- }
1945- const enum ModuleKind {
1946- None = "None" ,
1947- CommonJS = "CommonJS" ,
1948- AMD = "AMD" ,
1949- UMD = "UMD" ,
1950- System = "System" ,
1951- ES6 = "ES6" ,
1952- ES2015 = "ES2015" ,
1953- }
1954- const enum ModuleResolutionKind {
1955- Classic = "Classic" ,
1956- Node = "Node" ,
1957- }
1958- const enum NewLineKind {
1959- Crlf = "Crlf" ,
1960- Lf = "Lf" ,
1961- }
1962- const enum ScriptTarget {
1963- ES3 = "ES3" ,
1964- ES5 = "ES5" ,
1965- ES6 = "ES6" ,
1966- ES2015 = "ES2015" ,
1967- }
1942+ namespace JsxEmit {
1943+ type None = "None" ;
1944+ type Preserve = "Preserve" ;
1945+ type ReactNative = "ReactNative" ;
1946+ type React = "React" ;
1947+ }
1948+ type JsxEmit = JsxEmit . None | JsxEmit . Preserve | JsxEmit . React | JsxEmit . ReactNative ;
1949+ namespace ModuleKind {
1950+ type None = "None" ;
1951+ type CommonJS = "CommonJS" ;
1952+ type AMD = "AMD" ;
1953+ type UMD = "UMD" ;
1954+ type System = "System" ;
1955+ type ES6 = "ES6" ;
1956+ type ES2015 = "ES2015" ;
1957+ }
1958+ type ModuleKind = ModuleKind . None | ModuleKind . CommonJS | ModuleKind . AMD | ModuleKind . UMD | ModuleKind . System | ModuleKind . ES6 | ModuleKind . ES2015 ;
1959+ namespace ModuleResolutionKind {
1960+ type Classic = "Classic" ;
1961+ type Node = "Node" ;
1962+ }
1963+ type ModuleResolutionKind = ModuleResolutionKind . Classic | ModuleResolutionKind . Node ;
1964+ namespace NewLineKind {
1965+ type Crlf = "Crlf" ;
1966+ type Lf = "Lf" ;
1967+ }
1968+ type NewLineKind = NewLineKind . Crlf | NewLineKind . Lf ;
1969+ namespace ScriptTarget {
1970+ type ES3 = "ES3" ;
1971+ type ES5 = "ES5" ;
1972+ type ES6 = "ES6" ;
1973+ type ES2015 = "ES2015" ;
1974+ }
1975+ type ScriptTarget = ScriptTarget . ES3 | ScriptTarget . ES5 | ScriptTarget . ES6 | ScriptTarget . ES2015 ;
19681976}
19691977declare namespace ts . server . protocol {
19701978
@@ -2020,8 +2028,6 @@ declare namespace ts.server.protocol {
20202028}
20212029declare namespace ts {
20222030 // these types are empty stubs for types from services and should not be used directly
2023- export type HighlightSpanKind = never ;
2024- export type ScriptElementKind = never ;
20252031 export type ScriptKind = never ;
20262032 export type IndentStyle = never ;
20272033 export type JsxEmit = never ;
0 commit comments