2
2
* Declaration module describing the TypeScript Server protocol
3
3
*/
4
4
declare 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" ;
52
53
}
53
54
/**
54
55
* A TypeScript Server message
@@ -571,9 +572,10 @@ declare namespace ts.server.protocol {
571
572
}
572
573
/**
573
574
* Span augmented with extra information that denotes the kind of the highlighting to be used for span.
575
+ * Kind is taken from HighlightSpanKind type.
574
576
*/
575
577
interface HighlightSpan extends TextSpan {
576
- kind : HighlightSpanKind ;
578
+ kind : string ;
577
579
}
578
580
/**
579
581
* Represents a set of highligh spans for a give name
@@ -691,7 +693,7 @@ declare namespace ts.server.protocol {
691
693
/**
692
694
* The items's kind (such as 'className' or 'parameterName' or plain 'text').
693
695
*/
694
- kind : ScriptElementKind ;
696
+ kind : string ;
695
697
/**
696
698
* Optional modifiers for the kind (such as 'public').
697
699
*/
@@ -1039,7 +1041,7 @@ declare namespace ts.server.protocol {
1039
1041
/**
1040
1042
* The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1041
1043
*/
1042
- kind : ScriptElementKind ;
1044
+ kind : string ;
1043
1045
/**
1044
1046
* Optional modifiers for the kind (such as 'public').
1045
1047
*/
@@ -1225,7 +1227,7 @@ declare namespace ts.server.protocol {
1225
1227
/**
1226
1228
* The symbol's kind (such as 'className' or 'parameterName').
1227
1229
*/
1228
- kind : ScriptElementKind ;
1230
+ kind : string ;
1229
1231
/**
1230
1232
* Optional modifiers for the kind (such as 'public').
1231
1233
*/
@@ -1252,7 +1254,7 @@ declare namespace ts.server.protocol {
1252
1254
/**
1253
1255
* The symbol's kind (such as 'className' or 'parameterName').
1254
1256
*/
1255
- kind : ScriptElementKind ;
1257
+ kind : string ;
1256
1258
/**
1257
1259
* Optional modifiers for the kind (such as 'public').
1258
1260
*/
@@ -1645,7 +1647,7 @@ declare namespace ts.server.protocol {
1645
1647
/**
1646
1648
* The symbol's kind (such as 'className' or 'parameterName').
1647
1649
*/
1648
- kind : ScriptElementKind ;
1650
+ kind : string ;
1649
1651
/**
1650
1652
* exact, substring, or prefix.
1651
1653
*/
@@ -1678,7 +1680,7 @@ declare namespace ts.server.protocol {
1678
1680
/**
1679
1681
* Kind of symbol's container symbol (if any).
1680
1682
*/
1681
- containerKind ?: ScriptElementKind ;
1683
+ containerKind ?: string ;
1682
1684
}
1683
1685
/**
1684
1686
* Navto response message. Body is an array of navto items. Each
@@ -1742,7 +1744,7 @@ declare namespace ts.server.protocol {
1742
1744
/**
1743
1745
* The symbol's kind (such as 'className' or 'parameterName').
1744
1746
*/
1745
- kind : ScriptElementKind ;
1747
+ kind : string ;
1746
1748
/**
1747
1749
* Optional modifiers for the kind (such as 'public').
1748
1750
*/
@@ -1763,7 +1765,7 @@ declare namespace ts.server.protocol {
1763
1765
/** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
1764
1766
interface NavigationTree {
1765
1767
text : string ;
1766
- kind : ScriptElementKind ;
1768
+ kind : string ;
1767
1769
kindModifiers : string ;
1768
1770
spans : TextSpan [ ] ;
1769
1771
childItems ?: NavigationTree [ ] ;
@@ -1838,11 +1840,12 @@ declare namespace ts.server.protocol {
1838
1840
interface NavTreeResponse extends Response {
1839
1841
body ?: NavigationTree ;
1840
1842
}
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" ;
1845
1847
}
1848
+ type IndentStyle = IndentStyle . None | IndentStyle . Block | IndentStyle . Smart ;
1846
1849
interface EditorSettings {
1847
1850
baseIndentSize ?: number ;
1848
1851
indentSize ?: number ;
@@ -1936,35 +1939,40 @@ declare namespace ts.server.protocol {
1936
1939
typeRoots ?: string [ ] ;
1937
1940
[ option : string ] : CompilerOptionsValue | undefined ;
1938
1941
}
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 ;
1968
1976
}
1969
1977
declare namespace ts . server . protocol {
1970
1978
@@ -2020,8 +2028,6 @@ declare namespace ts.server.protocol {
2020
2028
}
2021
2029
declare namespace ts {
2022
2030
// 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 ;
2025
2031
export type ScriptKind = never ;
2026
2032
export type IndentStyle = never ;
2027
2033
export type JsxEmit = never ;
0 commit comments