@tslite/services 0.0.0-stage → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/LICENSE +55 -0
  2. package/NOTICE +13 -0
  3. package/dist/_namespaces/edit.d.ts +8 -0
  4. package/dist/_namespaces/edit.js +11 -0
  5. package/dist/_namespaces/ts.Completions.StringCompletions.d.ts +1 -0
  6. package/dist/_namespaces/ts.Completions.StringCompletions.js +2 -0
  7. package/dist/_namespaces/ts.Completions.d.ts +2 -0
  8. package/dist/_namespaces/ts.Completions.js +3 -0
  9. package/dist/_namespaces/ts.FindAllReferences.d.ts +2 -0
  10. package/dist/_namespaces/ts.FindAllReferences.js +3 -0
  11. package/dist/_namespaces/ts.GoToDefinition.d.ts +1 -0
  12. package/dist/_namespaces/ts.GoToDefinition.js +2 -0
  13. package/dist/_namespaces/ts.NavigationBar.d.ts +1 -0
  14. package/dist/_namespaces/ts.NavigationBar.js +2 -0
  15. package/dist/_namespaces/ts.OrganizeImports.d.ts +1 -0
  16. package/dist/_namespaces/ts.OrganizeImports.js +2 -0
  17. package/dist/_namespaces/ts.OutliningElementsCollector.d.ts +1 -0
  18. package/dist/_namespaces/ts.OutliningElementsCollector.js +2 -0
  19. package/dist/_namespaces/ts.Rename.d.ts +1 -0
  20. package/dist/_namespaces/ts.Rename.js +2 -0
  21. package/dist/_namespaces/ts.SignatureHelp.d.ts +1 -0
  22. package/dist/_namespaces/ts.SignatureHelp.js +2 -0
  23. package/dist/_namespaces/ts.SmartSelectionRange.d.ts +1 -0
  24. package/dist/_namespaces/ts.SmartSelectionRange.js +2 -0
  25. package/dist/_namespaces/ts.SymbolDisplay.d.ts +1 -0
  26. package/dist/_namespaces/ts.SymbolDisplay.js +2 -0
  27. package/dist/_namespaces/ts.codefix.d.ts +26 -0
  28. package/dist/_namespaces/ts.codefix.js +27 -0
  29. package/dist/_namespaces/ts.d.ts +17 -0
  30. package/dist/_namespaces/ts.formatting.d.ts +7 -0
  31. package/dist/_namespaces/ts.formatting.js +8 -0
  32. package/dist/_namespaces/ts.js +20 -0
  33. package/dist/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.d.ts +1 -0
  34. package/dist/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.js +2 -0
  35. package/dist/_namespaces/ts.refactor.convertParamsToDestructuredObject.d.ts +1 -0
  36. package/dist/_namespaces/ts.refactor.convertParamsToDestructuredObject.js +2 -0
  37. package/dist/_namespaces/ts.refactor.convertStringOrTemplateLiteral.d.ts +1 -0
  38. package/dist/_namespaces/ts.refactor.convertStringOrTemplateLiteral.js +2 -0
  39. package/dist/_namespaces/ts.refactor.d.ts +9 -0
  40. package/dist/_namespaces/ts.refactor.extractSymbol.d.ts +1 -0
  41. package/dist/_namespaces/ts.refactor.extractSymbol.js +2 -0
  42. package/dist/_namespaces/ts.refactor.js +10 -0
  43. package/dist/_namespaces/ts.textChanges.d.ts +1 -0
  44. package/dist/_namespaces/ts.textChanges.js +2 -0
  45. package/dist/classifier.d.ts +5 -0
  46. package/dist/classifier.js +439 -0
  47. package/dist/codeFixProvider.d.ts +13 -0
  48. package/dist/codeFixProvider.js +84 -0
  49. package/dist/codefixes/addConvertToUnknownForNonOverlappingTypes.d.ts +1 -0
  50. package/dist/codefixes/addConvertToUnknownForNonOverlappingTypes.js +21 -0
  51. package/dist/codefixes/addEmptyExportDeclaration.d.ts +1 -0
  52. package/dist/codefixes/addEmptyExportDeclaration.js +17 -0
  53. package/dist/codefixes/addMissingAsync.d.ts +1 -0
  54. package/dist/codefixes/addMissingAsync.js +75 -0
  55. package/dist/codefixes/addMissingAwait.d.ts +1 -0
  56. package/dist/codefixes/addMissingAwait.js +236 -0
  57. package/dist/codefixes/addMissingConst.d.ts +1 -0
  58. package/dist/codefixes/addMissingConst.js +91 -0
  59. package/dist/codefixes/addNameToNamelessParameter.d.ts +1 -0
  60. package/dist/codefixes/addNameToNamelessParameter.js +29 -0
  61. package/dist/codefixes/convertConstToLet.d.ts +1 -0
  62. package/dist/codefixes/convertConstToLet.js +30 -0
  63. package/dist/codefixes/convertToAsyncFunction.d.ts +1 -0
  64. package/dist/codefixes/convertToAsyncFunction.js +495 -0
  65. package/dist/codefixes/convertToMappedObjectType.d.ts +1 -0
  66. package/dist/codefixes/convertToMappedObjectType.js +48 -0
  67. package/dist/codefixes/correctQualifiedNameToIndexedAccessType.d.ts +1 -0
  68. package/dist/codefixes/correctQualifiedNameToIndexedAccessType.js +33 -0
  69. package/dist/codefixes/fixAddModuleReferTypeMissingTypeof.d.ts +1 -0
  70. package/dist/codefixes/fixAddModuleReferTypeMissingTypeof.js +27 -0
  71. package/dist/codefixes/fixAwaitInSyncFunction.d.ts +1 -0
  72. package/dist/codefixes/fixAwaitInSyncFunction.js +69 -0
  73. package/dist/codefixes/fixExpectedComma.d.ts +1 -0
  74. package/dist/codefixes/fixExpectedComma.js +35 -0
  75. package/dist/codefixes/fixInvalidJsxCharacters.d.ts +1 -0
  76. package/dist/codefixes/fixInvalidJsxCharacters.js +41 -0
  77. package/dist/codefixes/fixMissingCallParentheses.d.ts +1 -0
  78. package/dist/codefixes/fixMissingCallParentheses.js +42 -0
  79. package/dist/codefixes/fixSpelling.d.ts +1 -0
  80. package/dist/codefixes/fixSpelling.js +94 -0
  81. package/dist/codefixes/fixUnreachableCode.d.ts +1 -0
  82. package/dist/codefixes/fixUnreachableCode.js +65 -0
  83. package/dist/codefixes/fixUnusedIdentifier.d.ts +1 -0
  84. package/dist/codefixes/fixUnusedIdentifier.js +224 -0
  85. package/dist/codefixes/helpers.d.ts +8 -0
  86. package/dist/codefixes/helpers.js +53 -0
  87. package/dist/codefixes/importFixes.d.ts +14 -0
  88. package/dist/codefixes/importFixes.js +441 -0
  89. package/dist/codefixes/inferFromUsage.d.ts +1 -0
  90. package/dist/codefixes/inferFromUsage.js +742 -0
  91. package/dist/codefixes/removeUnnecessaryAwait.d.ts +1 -0
  92. package/dist/codefixes/removeUnnecessaryAwait.js +41 -0
  93. package/dist/codefixes/returnValueCorrect.d.ts +1 -0
  94. package/dist/codefixes/returnValueCorrect.js +132 -0
  95. package/dist/codefixes/splitTypeOnlyImport.d.ts +1 -0
  96. package/dist/codefixes/splitTypeOnlyImport.js +32 -0
  97. package/dist/codefixes/useBigintLiteral.d.ts +1 -0
  98. package/dist/codefixes/useBigintLiteral.js +29 -0
  99. package/dist/completions.d.ts +83 -0
  100. package/dist/completions.js +1720 -0
  101. package/dist/documentHighlights.d.ts +8 -0
  102. package/dist/documentHighlights.js +367 -0
  103. package/dist/documentRegistry.d.ts +36 -0
  104. package/dist/documentRegistry.js +63 -0
  105. package/dist/editingServices.d.ts +1 -0
  106. package/dist/editingServices.js +4 -0
  107. package/dist/findAllReferences.d.ts +113 -0
  108. package/dist/findAllReferences.js +1366 -0
  109. package/dist/formatting/formatting.d.ts +26 -0
  110. package/dist/formatting/formatting.js +1021 -0
  111. package/dist/formatting/formattingContext.d.ts +34 -0
  112. package/dist/formatting/formattingContext.js +78 -0
  113. package/dist/formatting/formattingScanner.d.ts +14 -0
  114. package/dist/formatting/formattingScanner.js +228 -0
  115. package/dist/formatting/rule.d.ts +31 -0
  116. package/dist/formatting/rule.js +22 -0
  117. package/dist/formatting/rules.d.ts +7 -0
  118. package/dist/formatting/rules.js +610 -0
  119. package/dist/formatting/rulesMap.d.ts +5 -0
  120. package/dist/formatting/rulesMap.js +127 -0
  121. package/dist/formatting/smartIndenter.d.ts +44 -0
  122. package/dist/formatting/smartIndenter.js +518 -0
  123. package/dist/getEditsForFileRename.d.ts +6 -0
  124. package/dist/getEditsForFileRename.js +86 -0
  125. package/dist/goToDefinition.d.ts +8 -0
  126. package/dist/goToDefinition.js +246 -0
  127. package/dist/importTracker.d.ts +50 -0
  128. package/dist/importTracker.js +422 -0
  129. package/dist/index.d.ts +1 -0
  130. package/dist/index.js +3 -0
  131. package/dist/navigationBar.d.ts +3 -0
  132. package/dist/navigationBar.js +549 -0
  133. package/dist/organizeImports.d.ts +18 -0
  134. package/dist/organizeImports.js +290 -0
  135. package/dist/outliningElementsCollector.d.ts +2 -0
  136. package/dist/outliningElementsCollector.js +261 -0
  137. package/dist/refactorProvider.d.ts +5 -0
  138. package/dist/refactorProvider.js +16 -0
  139. package/dist/refactors/addOrRemoveBracesToArrowFunction.d.ts +1 -0
  140. package/dist/refactors/addOrRemoveBracesToArrowFunction.js +86 -0
  141. package/dist/refactors/convertExport.d.ts +1 -0
  142. package/dist/refactors/convertExport.js +126 -0
  143. package/dist/refactors/convertImport.d.ts +1 -0
  144. package/dist/refactors/convertImport.js +116 -0
  145. package/dist/refactors/convertParamsToDestructuredObject.d.ts +1 -0
  146. package/dist/refactors/convertParamsToDestructuredObject.js +282 -0
  147. package/dist/refactors/convertStringOrTemplateLiteral.d.ts +1 -0
  148. package/dist/refactors/convertStringOrTemplateLiteral.js +148 -0
  149. package/dist/refactors/extractSymbol.d.ts +60 -0
  150. package/dist/refactors/extractSymbol.js +1281 -0
  151. package/dist/refactors/extractType.d.ts +1 -0
  152. package/dist/refactors/extractType.js +102 -0
  153. package/dist/refactors/moveToNewFile.d.ts +1 -0
  154. package/dist/refactors/moveToNewFile.js +477 -0
  155. package/dist/rename.d.ts +2 -0
  156. package/dist/rename.js +100 -0
  157. package/dist/services.d.ts +48 -0
  158. package/dist/services.js +1480 -0
  159. package/dist/signatureHelp.d.ts +8 -0
  160. package/dist/signatureHelp.js +414 -0
  161. package/dist/smartSelection.d.ts +2 -0
  162. package/dist/smartSelection.js +243 -0
  163. package/dist/stringCompletions.d.ts +4 -0
  164. package/dist/stringCompletions.js +220 -0
  165. package/dist/suggestionDiagnostics.d.ts +6 -0
  166. package/dist/suggestionDiagnostics.js +92 -0
  167. package/dist/symbolDisplay.d.ts +16 -0
  168. package/dist/symbolDisplay.js +400 -0
  169. package/dist/textChanges.d.ts +161 -0
  170. package/dist/textChanges.js +1163 -0
  171. package/dist/types.d.ts +908 -0
  172. package/dist/types.js +263 -0
  173. package/dist/utilities.d.ts +283 -0
  174. package/dist/utilities.js +1981 -0
  175. package/package.json +45 -3
  176. package/README.md +0 -3
package/dist/types.js ADDED
@@ -0,0 +1,263 @@
1
+ export var ScriptSnapshot;
2
+ (function (ScriptSnapshot) {
3
+ class StringScriptSnapshot {
4
+ constructor(text) {
5
+ this.text = text;
6
+ }
7
+ getText(start, end) {
8
+ return start === 0 && end === this.text.length
9
+ ? this.text
10
+ : this.text.substring(start, end);
11
+ }
12
+ getLength() {
13
+ return this.text.length;
14
+ }
15
+ getChangeRange() {
16
+ // Text-based snapshots do not support incremental parsing. Return undefined
17
+ // to signal that to the caller.
18
+ return undefined;
19
+ }
20
+ }
21
+ function fromString(text) {
22
+ return new StringScriptSnapshot(text);
23
+ }
24
+ ScriptSnapshot.fromString = fromString;
25
+ })(ScriptSnapshot || (ScriptSnapshot = {}));
26
+ export const emptyOptions = {};
27
+ export var HighlightSpanKind;
28
+ (function (HighlightSpanKind) {
29
+ HighlightSpanKind["none"] = "none";
30
+ HighlightSpanKind["definition"] = "definition";
31
+ HighlightSpanKind["reference"] = "reference";
32
+ HighlightSpanKind["writtenReference"] = "writtenReference";
33
+ })(HighlightSpanKind || (HighlightSpanKind = {}));
34
+ export var IndentStyle;
35
+ (function (IndentStyle) {
36
+ IndentStyle[IndentStyle["None"] = 0] = "None";
37
+ IndentStyle[IndentStyle["Block"] = 1] = "Block";
38
+ IndentStyle[IndentStyle["Smart"] = 2] = "Smart";
39
+ })(IndentStyle || (IndentStyle = {}));
40
+ export var SemicolonPreference;
41
+ (function (SemicolonPreference) {
42
+ SemicolonPreference["Ignore"] = "ignore";
43
+ SemicolonPreference["Insert"] = "insert";
44
+ SemicolonPreference["Remove"] = "remove";
45
+ })(SemicolonPreference || (SemicolonPreference = {}));
46
+ export function getDefaultFormatCodeSettings(newLineCharacter) {
47
+ return {
48
+ indentSize: 4,
49
+ tabSize: 4,
50
+ newLineCharacter: newLineCharacter || "\n",
51
+ convertTabsToSpaces: true,
52
+ indentStyle: IndentStyle.Smart,
53
+ insertSpaceAfterConstructor: false,
54
+ insertSpaceAfterCommaDelimiter: true,
55
+ insertSpaceAfterSemicolonInForStatements: true,
56
+ insertSpaceBeforeAndAfterBinaryOperators: true,
57
+ insertSpaceAfterKeywordsInControlFlowStatements: true,
58
+ insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,
59
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
60
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
61
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true,
62
+ insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
63
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
64
+ insertSpaceBeforeFunctionParenthesis: false,
65
+ placeOpenBraceOnNewLineForFunctions: false,
66
+ placeOpenBraceOnNewLineForControlBlocks: false,
67
+ semicolons: SemicolonPreference.Ignore,
68
+ trimTrailingWhitespace: true
69
+ };
70
+ }
71
+ export var SymbolDisplayPartKind;
72
+ (function (SymbolDisplayPartKind) {
73
+ SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName";
74
+ SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className";
75
+ SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName";
76
+ SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName";
77
+ SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName";
78
+ SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword";
79
+ SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak";
80
+ SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral";
81
+ SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral";
82
+ SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName";
83
+ SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName";
84
+ SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName";
85
+ SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator";
86
+ SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName";
87
+ SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName";
88
+ SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation";
89
+ SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space";
90
+ SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text";
91
+ SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName";
92
+ SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName";
93
+ SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName";
94
+ SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral";
95
+ })(SymbolDisplayPartKind || (SymbolDisplayPartKind = {}));
96
+ export var OutliningSpanKind;
97
+ (function (OutliningSpanKind) {
98
+ /** Single or multi-line comments */
99
+ OutliningSpanKind["Comment"] = "comment";
100
+ /** Sections marked by '// #region' and '// #endregion' comments */
101
+ OutliningSpanKind["Region"] = "region";
102
+ /** Declarations and expressions */
103
+ OutliningSpanKind["Code"] = "code";
104
+ /** Contiguous blocks of import declarations */
105
+ OutliningSpanKind["Imports"] = "imports";
106
+ })(OutliningSpanKind || (OutliningSpanKind = {}));
107
+ export var ScriptElementKind;
108
+ (function (ScriptElementKind) {
109
+ ScriptElementKind["unknown"] = "";
110
+ ScriptElementKind["warning"] = "warning";
111
+ /** predefined type (void) or keyword (class) */
112
+ ScriptElementKind["keyword"] = "keyword";
113
+ /** top level script node */
114
+ ScriptElementKind["scriptElement"] = "script";
115
+ /** module foo {} */
116
+ ScriptElementKind["moduleElement"] = "module";
117
+ /** class X {} */
118
+ ScriptElementKind["classElement"] = "class";
119
+ /** var x = class X {} */
120
+ ScriptElementKind["localClassElement"] = "local class";
121
+ /** interface Y {} */
122
+ ScriptElementKind["interfaceElement"] = "interface";
123
+ /** type T = ... */
124
+ ScriptElementKind["typeElement"] = "type";
125
+ /** enum E */
126
+ ScriptElementKind["enumElement"] = "enum";
127
+ ScriptElementKind["enumMemberElement"] = "enum member";
128
+ /**
129
+ * Inside module and script only
130
+ * const v = ..
131
+ */
132
+ ScriptElementKind["variableElement"] = "var";
133
+ /** Inside function */
134
+ ScriptElementKind["localVariableElement"] = "local var";
135
+ /**
136
+ * Inside module and script only
137
+ * function f() { }
138
+ */
139
+ ScriptElementKind["functionElement"] = "function";
140
+ /** Inside function */
141
+ ScriptElementKind["localFunctionElement"] = "local function";
142
+ /** class X { [public|private]* foo() {} } */
143
+ ScriptElementKind["memberFunctionElement"] = "method";
144
+ /** class X { [public|private]* [get|set] foo:number; } */
145
+ ScriptElementKind["memberGetAccessorElement"] = "getter";
146
+ ScriptElementKind["memberSetAccessorElement"] = "setter";
147
+ /**
148
+ * class X { [public|private]* foo:number; }
149
+ * interface Y { foo:number; }
150
+ */
151
+ ScriptElementKind["memberVariableElement"] = "property";
152
+ /** class X { constructor() { } } */
153
+ ScriptElementKind["constructorImplementationElement"] = "constructor";
154
+ /** interface Y { ():number; } */
155
+ ScriptElementKind["callSignatureElement"] = "call";
156
+ /** interface Y { []:number; } */
157
+ ScriptElementKind["indexSignatureElement"] = "index";
158
+ /** interface Y { new():Y; } */
159
+ ScriptElementKind["constructSignatureElement"] = "construct";
160
+ /** function foo(*Y*: string) */
161
+ ScriptElementKind["parameterElement"] = "parameter";
162
+ ScriptElementKind["typeParameterElement"] = "type parameter";
163
+ ScriptElementKind["primitiveType"] = "primitive type";
164
+ ScriptElementKind["label"] = "label";
165
+ ScriptElementKind["alias"] = "alias";
166
+ ScriptElementKind["constElement"] = "const";
167
+ ScriptElementKind["letElement"] = "let";
168
+ ScriptElementKind["directory"] = "directory";
169
+ ScriptElementKind["externalModuleName"] = "external module name";
170
+ /**
171
+ * <JsxTagName attribute1 attribute2={0} />
172
+ */
173
+ ScriptElementKind["jsxAttribute"] = "JSX attribute";
174
+ /** String literal */
175
+ ScriptElementKind["string"] = "string";
176
+ })(ScriptElementKind || (ScriptElementKind = {}));
177
+ export var ScriptElementKindModifier;
178
+ (function (ScriptElementKindModifier) {
179
+ ScriptElementKindModifier["none"] = "";
180
+ ScriptElementKindModifier["publicMemberModifier"] = "public";
181
+ ScriptElementKindModifier["privateMemberModifier"] = "private";
182
+ ScriptElementKindModifier["protectedMemberModifier"] = "protected";
183
+ ScriptElementKindModifier["exportedModifier"] = "export";
184
+ ScriptElementKindModifier["ambientModifier"] = "declare";
185
+ ScriptElementKindModifier["staticModifier"] = "static";
186
+ ScriptElementKindModifier["abstractModifier"] = "abstract";
187
+ ScriptElementKindModifier["optionalModifier"] = "optional";
188
+ ScriptElementKindModifier["dtsModifier"] = ".d.ts";
189
+ ScriptElementKindModifier["tsModifier"] = ".ts";
190
+ ScriptElementKindModifier["tsxModifier"] = ".tsx";
191
+ ScriptElementKindModifier["jsModifier"] = ".js";
192
+ ScriptElementKindModifier["jsxModifier"] = ".jsx";
193
+ ScriptElementKindModifier["jsonModifier"] = ".json";
194
+ })(ScriptElementKindModifier || (ScriptElementKindModifier = {}));
195
+ export var EndOfLineState;
196
+ (function (EndOfLineState) {
197
+ EndOfLineState[EndOfLineState["None"] = 0] = "None";
198
+ EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
199
+ EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
200
+ EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
201
+ EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
202
+ EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
203
+ EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
204
+ })(EndOfLineState || (EndOfLineState = {}));
205
+ export var ClassificationTypeNames;
206
+ (function (ClassificationTypeNames) {
207
+ ClassificationTypeNames["comment"] = "comment";
208
+ ClassificationTypeNames["identifier"] = "identifier";
209
+ ClassificationTypeNames["keyword"] = "keyword";
210
+ ClassificationTypeNames["numericLiteral"] = "number";
211
+ ClassificationTypeNames["bigintLiteral"] = "bigint";
212
+ ClassificationTypeNames["operator"] = "operator";
213
+ ClassificationTypeNames["stringLiteral"] = "string";
214
+ ClassificationTypeNames["whiteSpace"] = "whitespace";
215
+ ClassificationTypeNames["text"] = "text";
216
+ ClassificationTypeNames["punctuation"] = "punctuation";
217
+ ClassificationTypeNames["className"] = "class name";
218
+ ClassificationTypeNames["enumName"] = "enum name";
219
+ ClassificationTypeNames["interfaceName"] = "interface name";
220
+ ClassificationTypeNames["moduleName"] = "module name";
221
+ ClassificationTypeNames["typeParameterName"] = "type parameter name";
222
+ ClassificationTypeNames["typeAliasName"] = "type alias name";
223
+ ClassificationTypeNames["parameterName"] = "parameter name";
224
+ ClassificationTypeNames["docCommentTagName"] = "doc comment tag name";
225
+ ClassificationTypeNames["jsxOpenTagName"] = "jsx open tag name";
226
+ ClassificationTypeNames["jsxCloseTagName"] = "jsx close tag name";
227
+ ClassificationTypeNames["jsxSelfClosingTagName"] = "jsx self closing tag name";
228
+ ClassificationTypeNames["jsxAttribute"] = "jsx attribute";
229
+ ClassificationTypeNames["jsxText"] = "jsx text";
230
+ ClassificationTypeNames["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value";
231
+ })(ClassificationTypeNames || (ClassificationTypeNames = {}));
232
+ /**
233
+ * O tipo de um trecho na classificação codificada. Os valores são o protocolo com o editor, como na tag: os que a
234
+ * Linguagem não produz (a classe, o enum, a regex, a tag do JSDoc) ficam, sem renumerar os outros.
235
+ */
236
+ export var ClassificationType;
237
+ (function (ClassificationType) {
238
+ ClassificationType[ClassificationType["comment"] = 1] = "comment";
239
+ ClassificationType[ClassificationType["identifier"] = 2] = "identifier";
240
+ ClassificationType[ClassificationType["keyword"] = 3] = "keyword";
241
+ ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral";
242
+ ClassificationType[ClassificationType["operator"] = 5] = "operator";
243
+ ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral";
244
+ ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral";
245
+ ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace";
246
+ ClassificationType[ClassificationType["text"] = 9] = "text";
247
+ ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation";
248
+ ClassificationType[ClassificationType["className"] = 11] = "className";
249
+ ClassificationType[ClassificationType["enumName"] = 12] = "enumName";
250
+ ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName";
251
+ ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName";
252
+ ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName";
253
+ ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName";
254
+ ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName";
255
+ ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName";
256
+ ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName";
257
+ ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName";
258
+ ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName";
259
+ ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute";
260
+ ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText";
261
+ ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue";
262
+ ClassificationType[ClassificationType["bigintLiteral"] = 25] = "bigintLiteral";
263
+ })(ClassificationType || (ClassificationType = {}));
@@ -0,0 +1,283 @@
1
+ import { Map, ScriptElementKind, ScriptKind, ScriptTarget, SymbolDisplayPartKind, SymbolFlags, SymbolFormatFlags, SyntaxKind, TypeFormatFlags } from "./_namespaces/ts.js";
2
+ import type { BindingElement, CallExpression, CaseClause, CheckResult, CommentKind, CommentRange, Declaration, DisplayPartsSymbolWriter, EqualityOperator, Expression, FileTextChanges, FormatCodeSettings, FormattingHost, IScriptSnapshot, Identifier, ImportClause, ImportDeclaration, ImportSpecifier, LanguageServiceHost, Modifier, ModuleSpecifierResolutionHost, NoSubstitutionTemplateLiteral, Node, NodeArray, NumericLiteral, PropertyName, RefactorContext, Scanner, Signature, SourceFile, SourceFileLike, Statement, StringLiteral, StringLiteralLike, Symbol, SymbolDisplayPart, SyntaxList, TemplateExpression, TextChange, TextRange, TextSpan, Token, Type, TypeChecker, TypeNode, UserPreferences, __String } from "./_namespaces/ts.js";
3
+ import type { textChanges } from "./_namespaces/edit.js";
4
+ export declare const scanner: Scanner;
5
+ export declare enum SemanticMeaning {
6
+ None = 0,
7
+ Value = 1,
8
+ Type = 2,
9
+ Namespace = 4,
10
+ All = 7
11
+ }
12
+ export declare function getMeaningFromDeclaration(node: Node): SemanticMeaning;
13
+ export declare function getMeaningFromLocation(node: Node): SemanticMeaning;
14
+ export declare function isCallExpressionTarget(node: Node, includeElementAccess?: boolean, skipPastOuterExpressions?: boolean): boolean;
15
+ export declare function climbPastPropertyAccess(node: Node): Node;
16
+ export declare function climbPastPropertyOrElementAccess(node: Node): Node;
17
+ export declare function hasPropertyAccessExpressionWithName(node: CallExpression, funcName: string): boolean;
18
+ export declare function isRightSideOfPropertyAccess(node: Node): boolean;
19
+ export declare function isArgumentExpressionOfElementAccess(node: Node): boolean;
20
+ /**
21
+ * Se o literal é o nome de uma declaração ou a chave de um acesso. Na tag, também o de uma propriedade de classe, de um
22
+ * membro de enum, de um método e de um acessor (CK-02), o de uma method signature (CK-36), e o de um `declare module "x"`
23
+ * (CK-02).
24
+ */
25
+ export declare function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: StringLiteral | NumericLiteral | NoSubstitutionTemplateLiteral): boolean;
26
+ /**
27
+ * A declaração que contém o nó: o arquivo ou o namespace. Na tag, também o método, a `function`, o acessor, a classe, a
28
+ * interface e o enum (CK-02), a method signature (CK-36), e o escopo do typedef do JSDoc (CK-03).
29
+ */
30
+ export declare function getContainerNode(node: Node): Declaration | undefined;
31
+ /**
32
+ * O tipo de elemento que o nó declara. Na tag, também a classe, a interface, o enum e o membro dele, a `function`, o
33
+ * acessor, o método, a construct signature, o construtor e a parameter property (CK-02), a method signature (CK-36), o
34
+ * typedef do JSDoc e o `import =` (CK-03), e a atribuição que declara: as do JavaScript (CK-03) e o expando (CK-38), que o
35
+ * binder da cópia não liga como declaração.
36
+ */
37
+ export declare function getNodeKind(node: Node): ScriptElementKind;
38
+ export interface ListItemInfo {
39
+ listItemIndex: number;
40
+ list: Node;
41
+ }
42
+ export declare function getLineStartPositionForPosition(position: number, sourceFile: SourceFileLike): number;
43
+ export declare function rangeContainsRange(r1: TextRange, r2: TextRange): boolean;
44
+ export declare function rangeContainsRangeExclusive(r1: TextRange, r2: TextRange): boolean;
45
+ export declare function rangeContainsPositionExclusive(r: TextRange, pos: number): boolean;
46
+ export declare function startEndContainsRange(start: number, end: number, range: TextRange): boolean;
47
+ export declare function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean;
48
+ export declare function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean;
49
+ export declare function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean;
50
+ /**
51
+ * Assumes `candidate.start <= position` holds.
52
+ */
53
+ export declare function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean;
54
+ export declare function findListItemInfo(node: Node): ListItemInfo | undefined;
55
+ export declare function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile: SourceFile): boolean;
56
+ export declare function findChildOfKind<T extends Node>(n: Node, kind: T["kind"], sourceFile: SourceFileLike): T | undefined;
57
+ export declare function findContainingList(node: Node): SyntaxList | undefined;
58
+ /**
59
+ * Adjusts the location used for "find references" and "go to definition" when the cursor was not
60
+ * on a property name.
61
+ */
62
+ export declare function getAdjustedReferenceLocation(node: Node): Node;
63
+ /**
64
+ * Adjusts the location used for "rename" when the cursor was not on a property name.
65
+ */
66
+ export declare function getAdjustedRenameLocation(node: Node): Node;
67
+ /**
68
+ * O token cujo texto contém a posição, ou o que termina nela quando é um nome, um literal ou uma palavra-chave. Na tag,
69
+ * também o nome `#private` (CK-02).
70
+ */
71
+ export declare function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node;
72
+ /**
73
+ * Returns the token if position is in [start, end).
74
+ * If position === end, returns the preceding token if includeItemAtEndPosition(previousToken) === true
75
+ */
76
+ export declare function getTouchingToken(sourceFile: SourceFile, position: number, includePrecedingTokenAtEndPosition?: (n: Node) => boolean): Node;
77
+ /** Returns a token if position is in [start-of-leading-trivia, end) */
78
+ export declare function getTokenAtPosition(sourceFile: SourceFile, position: number): Node;
79
+ /**
80
+ * The token on the left of the position is the token that strictly includes the position
81
+ * or sits to the left of the cursor if it is on a boundary. For example
82
+ *
83
+ * fo|o -> will return foo
84
+ * foo <comment> |bar -> will return foo
85
+ *
86
+ */
87
+ export declare function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node | undefined;
88
+ export declare function findNextToken(previousToken: Node, parent: Node, sourceFile: SourceFileLike): Node | undefined;
89
+ /**
90
+ * O token mais à direita que termina até a posição, fora o `JsxText` só de espaço. Na tag, o `excludeJsdoc` escolhia se
91
+ * o começo de um filho contava o JSDoc dele; a cópia não tem o JSDoc (CK-03).
92
+ */
93
+ export declare function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node | undefined;
94
+ export declare function isInString(sourceFile: SourceFile, position: number, previousToken?: Node | undefined): boolean;
95
+ /**
96
+ * returns true if the position is in between the open and close elements of an JSX expression.
97
+ */
98
+ export declare function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position: number): boolean;
99
+ export declare function isInTemplateString(sourceFile: SourceFile, position: number): boolean;
100
+ export declare function isInJSXText(sourceFile: SourceFile, position: number): boolean;
101
+ export declare function findPrecedingMatchingToken(token: Node, matchingTokenKind: SyntaxKind, sourceFile: SourceFile): Node | undefined;
102
+ export declare function removeOptionality(type: Type, isOptionalExpression: boolean, isOptionalChain: boolean): Type;
103
+ export declare function isPossiblyTypeArgumentPosition(token: Node, sourceFile: SourceFile, checker: TypeChecker): boolean;
104
+ export declare function getPossibleGenericSignatures(called: Expression, typeArgumentCount: number, checker: TypeChecker): readonly Signature[];
105
+ export interface PossibleTypeArgumentInfo {
106
+ readonly called: Identifier;
107
+ readonly nTypeArguments: number;
108
+ }
109
+ export declare function getPossibleTypeArgumentsInfo(tokenIn: Node, sourceFile: SourceFile): PossibleTypeArgumentInfo | undefined;
110
+ /**
111
+ * Returns true if the cursor at position in sourceFile is within a comment.
112
+ *
113
+ * @param tokenAtPosition Must equal `getTokenAtPosition(sourceFile, position)
114
+ * @param predicate Additional predicate to test on the comment range.
115
+ */
116
+ export declare function isInComment(sourceFile: SourceFile, position: number, tokenAtPosition?: Node): CommentRange | undefined;
117
+ export declare function getNodeModifiers(node: Node): string;
118
+ /** Na tag, também os parâmetros de tipo de uma classe e de uma interface declaradas (CK-02). */
119
+ export declare function getTypeArgumentOrTypeParameterList(node: Node): NodeArray<Node> | undefined;
120
+ export declare function isComment(kind: SyntaxKind): boolean;
121
+ /** A string e o template. Na tag, também o literal de regex (CK-02). */
122
+ export declare function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean;
123
+ export declare function isPunctuation(kind: SyntaxKind): boolean;
124
+ export declare function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node): boolean;
125
+ export declare function isInNonReferenceComment(sourceFile: SourceFile, position: number): boolean;
126
+ export declare function getReplacementSpanForContextToken(contextToken: Node | undefined): TextSpan | undefined;
127
+ export declare function createTextSpanFromNode(node: Node, sourceFile?: SourceFile, endNode?: Node): TextSpan;
128
+ export declare function createTextSpanFromStringLiteralLikeContent(node: StringLiteralLike): TextSpan | undefined;
129
+ export declare function createTextSpanFromRange(range: TextRange): TextSpan;
130
+ export declare function createTextRangeFromSpan(span: TextSpan): TextRange;
131
+ export declare function createTextChangeFromStartLength(start: number, length: number, newText: string): TextChange;
132
+ export declare function createTextChange(span: TextSpan, newText: string): TextChange;
133
+ export declare const typeKeywords: readonly SyntaxKind[];
134
+ export declare function isTypeKeyword(kind: SyntaxKind): boolean;
135
+ export declare function isTypeKeywordToken(node: Node): node is Token<SyntaxKind.TypeKeyword>;
136
+ /** True if the symbol is for an external module, as opposed to a namespace. */
137
+ export declare function isExternalModuleSymbol(moduleSymbol: Symbol): boolean;
138
+ /** Returns `true` the first time it encounters a node and `false` afterwards. */
139
+ export type NodeSeenTracker<T = Node> = (node: T) => boolean;
140
+ export declare function nodeSeenTracker<T extends Node>(): NodeSeenTracker<T>;
141
+ export declare function getSnapshotText(snap: IScriptSnapshot): string;
142
+ export declare function repeatString(str: string, count: number): string;
143
+ export declare function skipConstraint(type: Type): Type;
144
+ export declare function getNameFromPropertyName(name: PropertyName): string | undefined;
145
+ /**
146
+ * O host do cálculo de um specifier. Na tag, recebia também o programa, e o host dava ainda o que a resolução do Node,
147
+ * os symlinks, o cache de tipos e as project references perguntavam (CK-46, CK-47).
148
+ */
149
+ export declare function createModuleSpecifierResolutionHost(host: LanguageServiceHost): ModuleSpecifierResolutionHost;
150
+ export declare function makeImportIfNecessary(defaultImport: Identifier | undefined, namedImports: readonly ImportSpecifier[] | undefined, moduleSpecifier: string, quotePreference: QuotePreference): ImportDeclaration | undefined;
151
+ export declare function makeImport(defaultImport: Identifier | undefined, namedImports: readonly ImportSpecifier[] | undefined, moduleSpecifier: string | Expression, quotePreference: QuotePreference, isTypeOnly?: boolean): ImportDeclaration;
152
+ export declare function makeStringLiteral(text: string, quotePreference: QuotePreference): StringLiteral;
153
+ export declare enum QuotePreference {
154
+ Single = 0,
155
+ Double = 1
156
+ }
157
+ export declare function quotePreferenceFromString(str: StringLiteral, sourceFile: SourceFile): QuotePreference;
158
+ export declare function getQuotePreference(sourceFile: SourceFile, preferences: UserPreferences): QuotePreference;
159
+ export declare function symbolNameNoDefault(symbol: Symbol): string | undefined;
160
+ export declare function symbolEscapedNameNoDefault(symbol: Symbol): __String | undefined;
161
+ export type ObjectBindingElementWithoutPropertyName = BindingElement & {
162
+ name: Identifier;
163
+ };
164
+ export declare function isObjectBindingElementWithoutPropertyName(bindingElement: Node): bindingElement is ObjectBindingElementWithoutPropertyName;
165
+ export declare function getPropertySymbolFromBindingElement(checker: TypeChecker, bindingElement: ObjectBindingElementWithoutPropertyName): Symbol | undefined;
166
+ export declare function getParentNodeInSpan(node: Node | undefined, file: SourceFile, span: TextSpan): Node | undefined;
167
+ export declare function findModifier(node: Node, kind: Modifier["kind"]): Modifier | undefined;
168
+ export declare function insertImports(changes: textChanges.ChangeTracker, sourceFile: SourceFile, imports: Statement | readonly Statement[], blankLineBetween: boolean): void;
169
+ export declare function getTypeKeywordOfTypeOnlyImport(importClause: ImportClause, sourceFile: SourceFile): Token<SyntaxKind.TypeKeyword>;
170
+ export declare function textSpansEqual(a: TextSpan | undefined, b: TextSpan | undefined): boolean;
171
+ export declare function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean;
172
+ export declare function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart;
173
+ export declare function displayPart(text: string, kind: SymbolDisplayPartKind): SymbolDisplayPart;
174
+ export declare function spacePart(): SymbolDisplayPart;
175
+ export declare function keywordPart(kind: SyntaxKind): SymbolDisplayPart;
176
+ export declare function punctuationPart(kind: SyntaxKind): SymbolDisplayPart;
177
+ export declare function operatorPart(kind: SyntaxKind): SymbolDisplayPart;
178
+ export declare function textOrKeywordPart(text: string): SymbolDisplayPart;
179
+ export declare function textPart(text: string): SymbolDisplayPart;
180
+ /**
181
+ * The default is CRLF.
182
+ */
183
+ export declare function getNewLineOrDefaultFromHost(host: FormattingHost, formatSettings?: FormatCodeSettings): string;
184
+ export declare function lineBreakPart(): SymbolDisplayPart;
185
+ export declare function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[];
186
+ export declare function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[];
187
+ export declare function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[];
188
+ export declare function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[];
189
+ export declare function isImportOrExportSpecifierName(location: Node): location is Identifier;
190
+ export declare function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind;
191
+ export declare function getSymbolTarget(symbol: Symbol, checker: TypeChecker): Symbol;
192
+ export declare function getUniqueSymbolId(symbol: Symbol, checker: TypeChecker): number;
193
+ export declare function getFirstNonSpaceCharacterPosition(text: string, position: number): number;
194
+ export declare function getPrecedingNonSpaceCharacterPosition(text: string, position: number): number;
195
+ /**
196
+ * Creates a deep, memberwise clone of a node with no source map location.
197
+ *
198
+ * WARNING: This is an expensive operation and is only intended to be used in refactorings
199
+ * and code fixes (because those are triggered by explicit user actions).
200
+ */
201
+ export declare function getSynthesizedDeepClone<T extends Node | undefined>(node: T, includeTrivia?: boolean): T;
202
+ export declare function getSynthesizedDeepCloneWithRenames<T extends Node>(node: T, includeTrivia?: boolean, renameMap?: Map<Identifier>, checker?: TypeChecker, callback?: (originalNode: Node, clone: Node) => any): T;
203
+ /**
204
+ * Sets EmitFlags to suppress leading and trailing trivia on the node.
205
+ */
206
+ export declare function suppressLeadingAndTrailingTrivia(node: Node): void;
207
+ /**
208
+ * Sets EmitFlags to suppress leading trivia on the node.
209
+ */
210
+ export declare function suppressLeadingTrivia(node: Node): void;
211
+ /**
212
+ * Sets EmitFlags to suppress trailing trivia on the node.
213
+ */
214
+ export declare function suppressTrailingTrivia(node: Node): void;
215
+ export declare function copyComments(sourceNode: Node, targetNode: Node): void;
216
+ export declare function getUniqueName(baseName: string, sourceFile: SourceFile): string;
217
+ /**
218
+ * @return The index of the (only) reference to the extracted symbol. We want the cursor
219
+ * to be on the reference, rather than the declaration, because it's closer to where the
220
+ * user was before extracting it.
221
+ */
222
+ export declare function getRenameLocation(edits: readonly FileTextChanges[], renameFilename: string, name: string, preferLastLocation: boolean): number;
223
+ export declare function copyLeadingComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile, commentKind?: CommentKind, hasTrailingNewLine?: boolean): void;
224
+ export declare function copyTrailingComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile, commentKind?: CommentKind, hasTrailingNewLine?: boolean): void;
225
+ /**
226
+ * This function copies the trailing comments for the token that comes before `sourceNode`, as leading comments of `targetNode`.
227
+ * This is useful because sometimes a comment that refers to `sourceNode` will be a leading comment for `sourceNode`, according to the
228
+ * notion of trivia ownership, and instead will be a trailing comment for the token before `sourceNode`, e.g.:
229
+ * `function foo(\* not leading comment for a *\ a: string) {}`
230
+ * The comment refers to `a` but belongs to the `(` token, but we might want to copy it.
231
+ */
232
+ export declare function copyTrailingAsLeadingComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile, commentKind?: CommentKind, hasTrailingNewLine?: boolean): void;
233
+ /** Na tag, também a expressão com o operador vírgula (CK-02). */
234
+ export declare function needsParentheses(expression: Expression): expression is import("@tslite/parser").ObjectLiteralExpression;
235
+ export declare function getContextualTypeFromParent(node: Expression, checker: TypeChecker): Type | undefined;
236
+ export declare function quote(text: string, preferences: UserPreferences): string;
237
+ /** A igualdade da Linguagem: o `==` e o `!=`. Na tag, também o `===` e o `!==`, que a Linguagem não tem (CK-70). */
238
+ export declare function isEqualityOperatorKind(kind: SyntaxKind): kind is EqualityOperator;
239
+ /** Na tag, também o template marcado (CK-02). */
240
+ export declare function isStringLiteralOrTemplate(node: Node): node is StringLiteralLike | TemplateExpression;
241
+ export declare function hasIndexSignature(type: Type): boolean;
242
+ export declare function getSwitchedType(caseClause: CaseClause, checker: TypeChecker): Type | undefined;
243
+ /**
244
+ * O tipo como nó, se todo símbolo que ele nomeia é acessível do ponto. Na tag, o tracker recebia também os avisos do
245
+ * `this`, do `private` de uma classe e do `unique symbol` inacessíveis, que o node builder da cópia não dá (CK-02), e o
246
+ * host do specifier somava o diretório comum do `Program` (CK-47).
247
+ */
248
+ export declare function getTypeNodeIfAccessible(type: Type, enclosingScope: Node, program: CheckResult, host: LanguageServiceHost): TypeNode | undefined;
249
+ /** Na tag, também a construct signature (CK-02) e a method signature (CK-36). */
250
+ export declare function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind: SyntaxKind): kind is SyntaxKind.PropertySignature | SyntaxKind.CallSignature | SyntaxKind.IndexSignature;
251
+ export declare function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind: SyntaxKind): kind is SyntaxKind.ModuleDeclaration;
252
+ /** Na tag, também o `debugger` e a propriedade de classe (CK-02), e o `import =` e o `export as namespace` (CK-03). */
253
+ export declare function syntaxRequiresTrailingSemicolonOrASI(kind: SyntaxKind): kind is SyntaxKind.VariableStatement | SyntaxKind.ExpressionStatement | SyntaxKind.DoStatement | SyntaxKind.ContinueStatement | SyntaxKind.BreakStatement | SyntaxKind.ReturnStatement | SyntaxKind.ThrowStatement | SyntaxKind.TypeAliasDeclaration | SyntaxKind.ImportDeclaration | SyntaxKind.ExportAssignment | SyntaxKind.ExportDeclaration;
254
+ export declare const syntaxMayBeASICandidate: (kind: SyntaxKind) => boolean;
255
+ export declare function positionIsASICandidate(pos: number, context: Node, sourceFile: SourceFileLike): boolean;
256
+ export declare function probablyUsesSemicolons(sourceFile: SourceFile): boolean;
257
+ export declare function getRefactorContextSpan({ startPosition, endPosition }: RefactorContext): TextSpan;
258
+ export declare function getNameForExportedSymbol(symbol: Symbol, scriptTarget: ScriptTarget): string;
259
+ /**
260
+ * Useful to check whether a string contains another string at a specific index
261
+ * without allocating another string or traversing the entire contents of the outer string.
262
+ *
263
+ * This function is useful in place of either of the following:
264
+ *
265
+ * ```ts
266
+ * // Allocates
267
+ * haystack.substr(startIndex, needle.length) === needle
268
+ *
269
+ * // Full traversal
270
+ * haystack.indexOf(needle, startIndex) === startIndex
271
+ * ```
272
+ *
273
+ * @param haystack The string that potentially contains `needle`.
274
+ * @param needle The string whose content might sit within `haystack`.
275
+ * @param startIndex The index within `haystack` to start searching for `needle`.
276
+ */
277
+ export declare function stringContainsAt(haystack: string, needle: string, startIndex: number): boolean;
278
+ export declare function moduleSymbolToValidIdentifier(moduleSymbol: Symbol, target: ScriptTarget): string;
279
+ export declare function moduleSpecifierToValidIdentifier(moduleSpecifier: string, target: ScriptTarget): string;
280
+ /**
281
+ * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`.
282
+ */
283
+ export declare function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, precedingToken?: Node | null, tokenAtPosition?: Node): CommentRange | undefined;