@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
@@ -0,0 +1,908 @@
1
+ import type { CancellationToken, CheckResult, Declaration, Diagnostic, DiagnosticWithLocation, DocumentHighlights, IntersectionType, LineAndCharacter, LiteralType, Map, NodeArray, NumberLiteralType, ScriptKind, SignatureDeclaration, SourceFile, StringLiteralType, Symbol, SymbolFlags, TextChangeRange, TextRange, TextSpan, TypeFlags, TypeParameter, UnderscoreEscapedMap, UnionOrIntersectionType, UnionType, UserPreferences, __String } from "./_namespaces/ts.js";
2
+ import type { textChanges } from "./_namespaces/edit.js";
3
+ declare module "@tslite/parser" {
4
+ interface Node {
5
+ getSourceFile(): SourceFile;
6
+ getChildCount(sourceFile?: SourceFile): number;
7
+ getChildAt(index: number, sourceFile?: SourceFile): Node;
8
+ getChildren(sourceFile?: SourceFileLike): Node[];
9
+ getStart(sourceFile?: SourceFileLike): number;
10
+ getFullStart(): number;
11
+ getEnd(): number;
12
+ getWidth(sourceFile?: SourceFileLike): number;
13
+ getFullWidth(): number;
14
+ getLeadingTriviaWidth(sourceFile?: SourceFile): number;
15
+ getFullText(sourceFile?: SourceFile): string;
16
+ getText(sourceFile?: SourceFile): string;
17
+ getFirstToken(sourceFile?: SourceFileLike): Node | undefined;
18
+ getLastToken(sourceFile?: SourceFileLike): Node | undefined;
19
+ forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
20
+ }
21
+ interface Identifier {
22
+ readonly text: string;
23
+ }
24
+ interface Symbol {
25
+ readonly name: string;
26
+ getFlags(): SymbolFlags;
27
+ getEscapedName(): __String;
28
+ getName(): string;
29
+ getDeclarations(): Declaration[] | undefined;
30
+ }
31
+ interface SourceFile {
32
+ version: string;
33
+ scriptSnapshot: IScriptSnapshot | undefined;
34
+ nameTable: UnderscoreEscapedMap<number> | undefined;
35
+ getNamedDeclarations(): Map<readonly Declaration[]>;
36
+ getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
37
+ getLineEndOfPosition(pos: number): number;
38
+ getLineStarts(): readonly number[];
39
+ getPositionOfLineAndCharacter(line: number, character: number): number;
40
+ update(newText: string, textChangeRange: TextChangeRange): SourceFile;
41
+ }
42
+ interface SourceFileLike {
43
+ getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
44
+ }
45
+ interface SourceMapSource {
46
+ getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
47
+ }
48
+ }
49
+ declare module "@tslite/checker" {
50
+ interface Type {
51
+ getFlags(): TypeFlags;
52
+ getSymbol(): Symbol | undefined;
53
+ getProperties(): Symbol[];
54
+ getProperty(propertyName: string): Symbol | undefined;
55
+ getApparentProperties(): Symbol[];
56
+ getCallSignatures(): readonly Signature[];
57
+ getStringIndexType(): Type | undefined;
58
+ getNumberIndexType(): Type | undefined;
59
+ getNonNullableType(): Type;
60
+ getNonOptionalType(): Type;
61
+ isNullableType(): boolean;
62
+ getConstraint(): Type | undefined;
63
+ getDefault(): Type | undefined;
64
+ isUnion(): this is UnionType;
65
+ isIntersection(): this is IntersectionType;
66
+ isUnionOrIntersection(): this is UnionOrIntersectionType;
67
+ isLiteral(): this is LiteralType;
68
+ isStringLiteral(): this is StringLiteralType;
69
+ isNumberLiteral(): this is NumberLiteralType;
70
+ isTypeParameter(): this is TypeParameter;
71
+ }
72
+ interface TypeReference {
73
+ typeArguments?: readonly Type[];
74
+ }
75
+ interface Signature {
76
+ getDeclaration(): SignatureDeclaration;
77
+ getTypeParameters(): TypeParameter[] | undefined;
78
+ getParameters(): Symbol[];
79
+ getReturnType(): Type;
80
+ }
81
+ }
82
+ /**
83
+ * Represents an immutable snapshot of a script at a specified time.Once acquired, the
84
+ * snapshot is observably immutable. i.e. the same calls with the same parameters will return
85
+ * the same values.
86
+ */
87
+ export interface IScriptSnapshot {
88
+ /** Gets a portion of the script snapshot specified by [start, end). */
89
+ getText(start: number, end: number): string;
90
+ /** Gets the length of this script snapshot. */
91
+ getLength(): number;
92
+ /**
93
+ * Gets the TextChangeRange that describe how the text changed between this text and
94
+ * an older version. This information is used by the incremental parser to determine
95
+ * what sections of the script need to be re-parsed. 'undefined' can be returned if the
96
+ * change range cannot be determined. However, in that case, incremental parsing will
97
+ * not happen and the entire document will be re - parsed.
98
+ */
99
+ getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
100
+ /** Releases all resources held by this script snapshot */
101
+ dispose?(): void;
102
+ }
103
+ export declare namespace ScriptSnapshot {
104
+ function fromString(text: string): IScriptSnapshot;
105
+ }
106
+ export declare const emptyOptions: {};
107
+ export type WithMetadata<T> = T & {
108
+ metadata?: unknown;
109
+ };
110
+ export interface HostCancellationToken {
111
+ isCancellationRequested(): boolean;
112
+ }
113
+ export interface FormattingHost {
114
+ getNewLine?(): string;
115
+ }
116
+ /**
117
+ * O host de uma instância do language service: o mundo que ele tipa (CK-47). Os arquivos do programa são os que
118
+ * `getScriptFileNames` dá, na ordem em que o programa os quer (as libs primeiro, como o `Program` da tag as ordena), e
119
+ * quem resolve um import é o host (CK-46). Sai da tag o que é do host do `tsc`: as opções (a configuração é fixa, CK-06),
120
+ * a lib default (o host a põe entre os arquivos), a leitura de disco, as referências de projeto, as diretivas de tipo, os
121
+ * pacotes de tipos, os transformers e o mapa de fontes.
122
+ */
123
+ export interface LanguageServiceHost {
124
+ /** A quebra de linha que o editor prefere, para o texto que a edição escreve sem uma nas opções de formatação. */
125
+ getNewLine?(): string;
126
+ getProjectVersion?(): string;
127
+ getScriptFileNames(): string[];
128
+ getScriptKind?(fileName: string): ScriptKind;
129
+ getScriptVersion(fileName: string): string;
130
+ getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
131
+ getLocalizedDiagnosticMessages?(): any;
132
+ getCancellationToken?(): HostCancellationToken;
133
+ getCurrentDirectory(): string;
134
+ log?(s: string): void;
135
+ trace?(s: string): void;
136
+ error?(s: string): void;
137
+ useCaseSensitiveFileNames?(): boolean;
138
+ /**
139
+ * O arquivo a que o import `moduleName` do arquivo `containingFile` resolve, pelo nome, ou `undefined` se não
140
+ * resolve (CK-46): o `resolveModule` do `CheckHost`, no lugar do `resolveModuleNames` da tag.
141
+ */
142
+ resolveModule(moduleName: string, containingFile: string): string | undefined;
143
+ }
144
+ export interface LanguageService {
145
+ /** This is used as a part of restarting the language service. */
146
+ cleanupSemanticCache(): void;
147
+ /**
148
+ * Gets errors indicating invalid syntax in a file.
149
+ *
150
+ * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
151
+ * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
152
+ * errors in TypeScript are missing parentheses in an `if` statement, mismatched
153
+ * curly braces, and using a reserved keyword as a variable name.
154
+ *
155
+ * These diagnostics are inexpensive to compute and don't require knowledge of
156
+ * other files. Note that a non-empty result increases the likelihood of false positives
157
+ * from `getSemanticDiagnostics`.
158
+ *
159
+ * While these represent the majority of syntax-related diagnostics, there are some
160
+ * that require the type system, which will be present in `getSemanticDiagnostics`.
161
+ *
162
+ * @param fileName A path to the file you want syntactic diagnostics for
163
+ */
164
+ getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
165
+ /**
166
+ * Gets warnings or errors indicating type system issues in a given file.
167
+ * Requesting semantic diagnostics may start up the type system and
168
+ * run deferred work, so the first call may take longer than subsequent calls.
169
+ *
170
+ * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
171
+ * include a reference to a source file. Specifically, the first time this is called,
172
+ * it will return global diagnostics with no associated location.
173
+ *
174
+ * To contrast the differences between semantic and syntactic diagnostics, consider the
175
+ * sentence: "The sun is green." is syntactically correct; those are real English words with
176
+ * correct sentence structure. However, it is semantically invalid, because it is not true.
177
+ *
178
+ * @param fileName A path to the file you want semantic diagnostics for
179
+ */
180
+ getSemanticDiagnostics(fileName: string): Diagnostic[];
181
+ /**
182
+ * Gets suggestion diagnostics for a specific file. These diagnostics tend to
183
+ * proactively suggest refactors, as opposed to diagnostics that indicate
184
+ * potentially incorrect runtime behavior.
185
+ *
186
+ * @param fileName A path to the file you want semantic diagnostics for
187
+ */
188
+ getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
189
+ /** @deprecated Use getEncodedSyntacticClassifications instead. */
190
+ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
191
+ /** @deprecated Use getEncodedSemanticClassifications instead. */
192
+ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
193
+ getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
194
+ getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
195
+ /**
196
+ * Gets completion entries at a particular position in a file.
197
+ *
198
+ * @param fileName The path to the file
199
+ * @param position A zero-based index of the character where you want the entries
200
+ * @param options An object describing how the request was triggered and what kinds
201
+ * of code actions can be returned with the completions.
202
+ */
203
+ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
204
+ /**
205
+ * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
206
+ *
207
+ * @param fileName The path to the file
208
+ * @param position A zero based index of the character where you want the entries
209
+ * @param entryName The name from an existing completion which came from `getCompletionsAtPosition`
210
+ * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
211
+ * @param source Source code for the current file, can be undefined for backwards compatibility
212
+ * @param preferences User settings, can be undefined for backwards compatibility
213
+ */
214
+ getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined): CompletionEntryDetails | undefined;
215
+ getCompletionEntrySymbol(fileName: string, position: number, name: string, source: string | undefined): Symbol | undefined;
216
+ /**
217
+ * Gets semantic information about the identifier at a particular position in a
218
+ * file. Quick info is what you typically see when you hover in an editor.
219
+ *
220
+ * @param fileName The path to the file
221
+ * @param position A zero-based index of the character where you want the quick info
222
+ */
223
+ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
224
+ getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
225
+ getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
226
+ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
227
+ getSmartSelectionRange(fileName: string, position: number): SelectionRange;
228
+ getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
229
+ getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined;
230
+ getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
231
+ getImplementationAtPosition(fileName: string, position: number): readonly ImplementationLocation[] | undefined;
232
+ getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined;
233
+ findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
234
+ getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] | undefined;
235
+ /** @deprecated */
236
+ getOccurrencesAtPosition(fileName: string, position: number): readonly ReferenceEntry[] | undefined;
237
+ getNavigationBarItems(fileName: string): NavigationBarItem[];
238
+ getNavigationTree(fileName: string): NavigationTree;
239
+ getOutliningSpans(fileName: string): OutliningSpan[];
240
+ getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
241
+ getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[];
242
+ getIndentationAtPosition(fileName: string, position: number, options: EditorOptions | EditorSettings): number;
243
+ getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
244
+ getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
245
+ getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[];
246
+ isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
247
+ /**
248
+ * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag.
249
+ * Editors should call this after `>` is typed.
250
+ */
251
+ getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
252
+ getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
253
+ getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: readonly number[], formatOptions: FormatCodeSettings, preferences: UserPreferences): readonly CodeFixAction[];
254
+ getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
255
+ getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[];
256
+ getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
257
+ organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
258
+ getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
259
+ /** O programa ligado e tipado da foto atual do host: o resultado do `check` da cópia, no lugar do `Program`. */
260
+ getProgram(): CheckResult | undefined;
261
+ dispose(): void;
262
+ }
263
+ export interface JsxClosingTagInfo {
264
+ readonly newText: string;
265
+ }
266
+ export interface CombinedCodeFixScope {
267
+ type: "file";
268
+ fileName: string;
269
+ }
270
+ export type OrganizeImportsScope = CombinedCodeFixScope;
271
+ export type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#";
272
+ export interface GetCompletionsAtPositionOptions extends UserPreferences {
273
+ /**
274
+ * If the editor is asking for completions because a certain character was typed
275
+ * (as opposed to when the user explicitly requested them) this should be set.
276
+ */
277
+ triggerCharacter?: CompletionsTriggerCharacter;
278
+ /** @deprecated Use includeCompletionsForModuleExports */
279
+ includeExternalModuleExports?: boolean;
280
+ /** @deprecated Use includeCompletionsWithInsertText */
281
+ includeInsertTextCompletions?: boolean;
282
+ }
283
+ export type SignatureHelpTriggerCharacter = "," | "(" | "<";
284
+ export type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
285
+ export interface SignatureHelpItemsOptions {
286
+ triggerReason?: SignatureHelpTriggerReason;
287
+ }
288
+ export type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
289
+ /**
290
+ * Signals that the user manually requested signature help.
291
+ * The language service will unconditionally attempt to provide a result.
292
+ */
293
+ export interface SignatureHelpInvokedReason {
294
+ kind: "invoked";
295
+ triggerCharacter?: undefined;
296
+ }
297
+ /**
298
+ * Signals that the signature help request came from a user typing a character.
299
+ * Depending on the character and the syntactic context, the request may or may not be served a result.
300
+ */
301
+ export interface SignatureHelpCharacterTypedReason {
302
+ kind: "characterTyped";
303
+ /**
304
+ * Character that was responsible for triggering signature help.
305
+ */
306
+ triggerCharacter: SignatureHelpTriggerCharacter;
307
+ }
308
+ /**
309
+ * Signals that this signature help request came from typing a character or moving the cursor.
310
+ * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
311
+ * The language service will unconditionally attempt to provide a result.
312
+ * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
313
+ */
314
+ export interface SignatureHelpRetriggeredReason {
315
+ kind: "retrigger";
316
+ /**
317
+ * Character that was responsible for triggering signature help.
318
+ */
319
+ triggerCharacter?: SignatureHelpRetriggerCharacter;
320
+ }
321
+ export interface Classifications {
322
+ spans: number[];
323
+ endOfLineState: EndOfLineState;
324
+ }
325
+ export interface ClassifiedSpan {
326
+ textSpan: TextSpan;
327
+ classificationType: ClassificationTypeNames;
328
+ }
329
+ export interface NavigationBarItem {
330
+ text: string;
331
+ kind: ScriptElementKind;
332
+ kindModifiers: string;
333
+ spans: TextSpan[];
334
+ childItems: NavigationBarItem[];
335
+ indent: number;
336
+ bolded: boolean;
337
+ grayed: boolean;
338
+ }
339
+ /**
340
+ * Node in a tree of nested declarations in a file.
341
+ * The top node is always a script or module node.
342
+ */
343
+ export interface NavigationTree {
344
+ /** Name of the declaration, or a short description, e.g. "<class>". */
345
+ text: string;
346
+ kind: ScriptElementKind;
347
+ /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
348
+ kindModifiers: string;
349
+ /**
350
+ * Spans of the nodes that generated this declaration.
351
+ * There will be more than one if this is the result of merging.
352
+ */
353
+ spans: TextSpan[];
354
+ nameSpan: TextSpan | undefined;
355
+ /** Present if non-empty */
356
+ childItems?: NavigationTree[];
357
+ }
358
+ export interface TodoCommentDescriptor {
359
+ text: string;
360
+ priority: number;
361
+ }
362
+ export interface TodoComment {
363
+ descriptor: TodoCommentDescriptor;
364
+ message: string;
365
+ position: number;
366
+ }
367
+ export interface TextChange {
368
+ span: TextSpan;
369
+ newText: string;
370
+ }
371
+ export interface FileTextChanges {
372
+ fileName: string;
373
+ textChanges: readonly TextChange[];
374
+ isNewFile?: boolean;
375
+ }
376
+ export interface CodeAction {
377
+ /** Description of the code action to display in the UI of the editor */
378
+ description: string;
379
+ /** Text changes to apply to each file as part of the code action */
380
+ changes: FileTextChanges[];
381
+ }
382
+ export interface CodeFixAction extends CodeAction {
383
+ /** Short name to identify the fix, for use by telemetry. */
384
+ fixName: string;
385
+ /**
386
+ * If present, one may call 'getCombinedCodeFix' with this fixId.
387
+ * This may be omitted to indicate that the code fix can't be applied in a group.
388
+ */
389
+ fixId?: {};
390
+ fixAllDescription?: string;
391
+ }
392
+ export interface CombinedCodeActions {
393
+ changes: readonly FileTextChanges[];
394
+ }
395
+ /**
396
+ * A set of one or more available refactoring actions, grouped under a parent refactoring.
397
+ */
398
+ export interface ApplicableRefactorInfo {
399
+ /**
400
+ * The programmatic name of the refactoring
401
+ */
402
+ name: string;
403
+ /**
404
+ * A description of this refactoring category to show to the user.
405
+ * If the refactoring gets inlined (see below), this text will not be visible.
406
+ */
407
+ description: string;
408
+ /**
409
+ * Inlineable refactorings can have their actions hoisted out to the top level
410
+ * of a context menu. Non-inlineanable refactorings should always be shown inside
411
+ * their parent grouping.
412
+ *
413
+ * If not specified, this value is assumed to be 'true'
414
+ */
415
+ inlineable?: boolean;
416
+ actions: RefactorActionInfo[];
417
+ }
418
+ /**
419
+ * Represents a single refactoring action - for example, the "Extract Method..." refactor might
420
+ * offer several actions, each corresponding to a surround class or closure to extract into.
421
+ */
422
+ export interface RefactorActionInfo {
423
+ /**
424
+ * The programmatic name of the refactoring action
425
+ */
426
+ name: string;
427
+ /**
428
+ * A description of this refactoring action to show to the user.
429
+ * If the parent refactoring is inlined away, this will be the only text shown,
430
+ * so this description should make sense by itself if the parent is inlineable=true
431
+ */
432
+ description: string;
433
+ }
434
+ /**
435
+ * As edições de um refactor, e o lugar de onde o editor começa um rename do nome que ele criou. Na tag, também o
436
+ * `commands`, o pedido ao host de instalar um pacote de tipos (CK-47).
437
+ */
438
+ export interface RefactorEditInfo {
439
+ edits: FileTextChanges[];
440
+ renameFilename?: string;
441
+ renameLocation?: number;
442
+ }
443
+ /**
444
+ * Um trecho de um arquivo. O `contextSpan` é o da declaração inteira, quando o `textSpan` é o nome dela. Na tag, também
445
+ * o trecho original de um arquivo mapeado (o `.d.ts.map`), que é do host.
446
+ */
447
+ export interface DocumentSpan {
448
+ textSpan: TextSpan;
449
+ fileName: string;
450
+ contextSpan?: TextSpan;
451
+ }
452
+ export interface RenameLocation extends DocumentSpan {
453
+ readonly prefixText?: string;
454
+ readonly suffixText?: string;
455
+ }
456
+ export interface ReferenceEntry extends DocumentSpan {
457
+ isWriteAccess: boolean;
458
+ isDefinition: boolean;
459
+ isInString?: true;
460
+ }
461
+ export interface ImplementationLocation extends DocumentSpan {
462
+ kind: ScriptElementKind;
463
+ displayParts: SymbolDisplayPart[];
464
+ }
465
+ export declare enum HighlightSpanKind {
466
+ none = "none",
467
+ definition = "definition",
468
+ reference = "reference",
469
+ writtenReference = "writtenReference"
470
+ }
471
+ export interface HighlightSpan {
472
+ fileName?: string;
473
+ isInString?: true;
474
+ textSpan: TextSpan;
475
+ contextSpan?: TextSpan;
476
+ kind: HighlightSpanKind;
477
+ }
478
+ export declare enum IndentStyle {
479
+ None = 0,
480
+ Block = 1,
481
+ Smart = 2
482
+ }
483
+ export declare enum SemicolonPreference {
484
+ Ignore = "ignore",
485
+ Insert = "insert",
486
+ Remove = "remove"
487
+ }
488
+ export interface EditorOptions {
489
+ BaseIndentSize?: number;
490
+ IndentSize: number;
491
+ TabSize: number;
492
+ NewLineCharacter: string;
493
+ ConvertTabsToSpaces: boolean;
494
+ IndentStyle: IndentStyle;
495
+ }
496
+ export interface EditorSettings {
497
+ baseIndentSize?: number;
498
+ indentSize?: number;
499
+ tabSize?: number;
500
+ newLineCharacter?: string;
501
+ convertTabsToSpaces?: boolean;
502
+ indentStyle?: IndentStyle;
503
+ trimTrailingWhitespace?: boolean;
504
+ }
505
+ export interface FormatCodeOptions extends EditorOptions {
506
+ InsertSpaceAfterCommaDelimiter: boolean;
507
+ InsertSpaceAfterSemicolonInForStatements: boolean;
508
+ InsertSpaceBeforeAndAfterBinaryOperators: boolean;
509
+ InsertSpaceAfterConstructor?: boolean;
510
+ InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
511
+ InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
512
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
513
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
514
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
515
+ InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
516
+ InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
517
+ InsertSpaceAfterTypeAssertion?: boolean;
518
+ InsertSpaceBeforeFunctionParenthesis?: boolean;
519
+ PlaceOpenBraceOnNewLineForFunctions: boolean;
520
+ PlaceOpenBraceOnNewLineForControlBlocks: boolean;
521
+ insertSpaceBeforeTypeAnnotation?: boolean;
522
+ }
523
+ export interface FormatCodeSettings extends EditorSettings {
524
+ readonly insertSpaceAfterCommaDelimiter?: boolean;
525
+ readonly insertSpaceAfterSemicolonInForStatements?: boolean;
526
+ readonly insertSpaceBeforeAndAfterBinaryOperators?: boolean;
527
+ readonly insertSpaceAfterConstructor?: boolean;
528
+ readonly insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
529
+ readonly insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
530
+ readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
531
+ readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
532
+ readonly insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
533
+ readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
534
+ readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
535
+ readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
536
+ readonly insertSpaceAfterTypeAssertion?: boolean;
537
+ readonly insertSpaceBeforeFunctionParenthesis?: boolean;
538
+ readonly placeOpenBraceOnNewLineForFunctions?: boolean;
539
+ readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
540
+ readonly insertSpaceBeforeTypeAnnotation?: boolean;
541
+ readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
542
+ readonly semicolons?: SemicolonPreference;
543
+ }
544
+ export declare function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
545
+ export interface DefinitionInfo extends DocumentSpan {
546
+ kind: ScriptElementKind;
547
+ name: string;
548
+ containerKind: ScriptElementKind;
549
+ containerName: string;
550
+ isLocal?: boolean;
551
+ }
552
+ export interface DefinitionInfoAndBoundSpan {
553
+ definitions?: readonly DefinitionInfo[];
554
+ textSpan: TextSpan;
555
+ }
556
+ export interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
557
+ displayParts: SymbolDisplayPart[];
558
+ }
559
+ export interface ReferencedSymbol {
560
+ definition: ReferencedSymbolDefinitionInfo;
561
+ references: ReferenceEntry[];
562
+ }
563
+ export declare enum SymbolDisplayPartKind {
564
+ aliasName = 0,
565
+ className = 1,
566
+ enumName = 2,
567
+ fieldName = 3,
568
+ interfaceName = 4,
569
+ keyword = 5,
570
+ lineBreak = 6,
571
+ numericLiteral = 7,
572
+ stringLiteral = 8,
573
+ localName = 9,
574
+ methodName = 10,
575
+ moduleName = 11,
576
+ operator = 12,
577
+ parameterName = 13,
578
+ propertyName = 14,
579
+ punctuation = 15,
580
+ space = 16,
581
+ text = 17,
582
+ typeParameterName = 18,
583
+ enumMemberName = 19,
584
+ functionName = 20,
585
+ regularExpressionLiteral = 21
586
+ }
587
+ export interface SymbolDisplayPart {
588
+ text: string;
589
+ kind: string;
590
+ }
591
+ export interface JSDocTagInfo {
592
+ name: string;
593
+ text?: string;
594
+ }
595
+ export interface QuickInfo {
596
+ kind: ScriptElementKind;
597
+ kindModifiers: string;
598
+ textSpan: TextSpan;
599
+ displayParts?: SymbolDisplayPart[];
600
+ documentation?: SymbolDisplayPart[];
601
+ tags?: JSDocTagInfo[];
602
+ }
603
+ export type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
604
+ export interface RenameInfoSuccess {
605
+ canRename: true;
606
+ /**
607
+ * File or directory to rename.
608
+ * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
609
+ */
610
+ fileToRename?: string;
611
+ displayName: string;
612
+ fullDisplayName: string;
613
+ kind: ScriptElementKind;
614
+ kindModifiers: string;
615
+ triggerSpan: TextSpan;
616
+ }
617
+ export interface RenameInfoFailure {
618
+ canRename: false;
619
+ localizedErrorMessage: string;
620
+ }
621
+ export interface RenameInfoOptions {
622
+ readonly allowRenameOfImportPath?: boolean;
623
+ }
624
+ export interface SignatureHelpParameter {
625
+ name: string;
626
+ documentation: SymbolDisplayPart[];
627
+ displayParts: SymbolDisplayPart[];
628
+ isOptional: boolean;
629
+ }
630
+ export interface SelectionRange {
631
+ textSpan: TextSpan;
632
+ parent?: SelectionRange;
633
+ }
634
+ /**
635
+ * Represents a single signature to show in signature help.
636
+ * The id is used for subsequent calls into the language service to ask questions about the
637
+ * signature help item in the context of any documents that have been updated. i.e. after
638
+ * an edit has happened, while signature help is still active, the host can ask important
639
+ * questions like 'what parameter is the user currently contained within?'.
640
+ */
641
+ export interface SignatureHelpItem {
642
+ isVariadic: boolean;
643
+ prefixDisplayParts: SymbolDisplayPart[];
644
+ suffixDisplayParts: SymbolDisplayPart[];
645
+ separatorDisplayParts: SymbolDisplayPart[];
646
+ parameters: SignatureHelpParameter[];
647
+ documentation: SymbolDisplayPart[];
648
+ tags: JSDocTagInfo[];
649
+ }
650
+ /**
651
+ * Represents a set of signature help items, and the preferred item that should be selected.
652
+ */
653
+ export interface SignatureHelpItems {
654
+ items: SignatureHelpItem[];
655
+ applicableSpan: TextSpan;
656
+ selectedItemIndex: number;
657
+ argumentIndex: number;
658
+ argumentCount: number;
659
+ }
660
+ export interface CompletionInfo {
661
+ /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
662
+ isGlobalCompletion: boolean;
663
+ isMemberCompletion: boolean;
664
+ /**
665
+ * true when the current location also allows for a new identifier
666
+ */
667
+ isNewIdentifierLocation: boolean;
668
+ entries: CompletionEntry[];
669
+ }
670
+ export interface CompletionEntry {
671
+ name: string;
672
+ kind: ScriptElementKind;
673
+ kindModifiers?: string;
674
+ sortText: string;
675
+ insertText?: string;
676
+ /**
677
+ * An optional span that indicates the text to be replaced by this completion item.
678
+ * If present, this span should be used instead of the default one.
679
+ * It will be set if the required span differs from the one generated by the default replacement behavior.
680
+ */
681
+ replacementSpan?: TextSpan;
682
+ hasAction?: true;
683
+ source?: string;
684
+ }
685
+ export interface CompletionEntryDetails {
686
+ name: string;
687
+ kind: ScriptElementKind;
688
+ kindModifiers: string;
689
+ displayParts: SymbolDisplayPart[];
690
+ documentation?: SymbolDisplayPart[];
691
+ tags?: JSDocTagInfo[];
692
+ codeActions?: CodeAction[];
693
+ source?: SymbolDisplayPart[];
694
+ }
695
+ export interface OutliningSpan {
696
+ /** The span of the document to actually collapse. */
697
+ textSpan: TextSpan;
698
+ /** The span of the document to display when the user hovers over the collapsed span. */
699
+ hintSpan: TextSpan;
700
+ /** The text to display in the editor for the collapsed region. */
701
+ bannerText: string;
702
+ /**
703
+ * Whether or not this region should be automatically collapsed when
704
+ * the 'Collapse to Definitions' command is invoked.
705
+ */
706
+ autoCollapse: boolean;
707
+ /**
708
+ * Classification of the contents of the span
709
+ */
710
+ kind: OutliningSpanKind;
711
+ }
712
+ export declare enum OutliningSpanKind {
713
+ /** Single or multi-line comments */
714
+ Comment = "comment",
715
+ /** Sections marked by '// #region' and '// #endregion' comments */
716
+ Region = "region",
717
+ /** Declarations and expressions */
718
+ Code = "code",
719
+ /** Contiguous blocks of import declarations */
720
+ Imports = "imports"
721
+ }
722
+ export declare enum ScriptElementKind {
723
+ unknown = "",
724
+ warning = "warning",
725
+ /** predefined type (void) or keyword (class) */
726
+ keyword = "keyword",
727
+ /** top level script node */
728
+ scriptElement = "script",
729
+ /** module foo {} */
730
+ moduleElement = "module",
731
+ /** class X {} */
732
+ classElement = "class",
733
+ /** var x = class X {} */
734
+ localClassElement = "local class",
735
+ /** interface Y {} */
736
+ interfaceElement = "interface",
737
+ /** type T = ... */
738
+ typeElement = "type",
739
+ /** enum E */
740
+ enumElement = "enum",
741
+ enumMemberElement = "enum member",
742
+ /**
743
+ * Inside module and script only
744
+ * const v = ..
745
+ */
746
+ variableElement = "var",
747
+ /** Inside function */
748
+ localVariableElement = "local var",
749
+ /**
750
+ * Inside module and script only
751
+ * function f() { }
752
+ */
753
+ functionElement = "function",
754
+ /** Inside function */
755
+ localFunctionElement = "local function",
756
+ /** class X { [public|private]* foo() {} } */
757
+ memberFunctionElement = "method",
758
+ /** class X { [public|private]* [get|set] foo:number; } */
759
+ memberGetAccessorElement = "getter",
760
+ memberSetAccessorElement = "setter",
761
+ /**
762
+ * class X { [public|private]* foo:number; }
763
+ * interface Y { foo:number; }
764
+ */
765
+ memberVariableElement = "property",
766
+ /** class X { constructor() { } } */
767
+ constructorImplementationElement = "constructor",
768
+ /** interface Y { ():number; } */
769
+ callSignatureElement = "call",
770
+ /** interface Y { []:number; } */
771
+ indexSignatureElement = "index",
772
+ /** interface Y { new():Y; } */
773
+ constructSignatureElement = "construct",
774
+ /** function foo(*Y*: string) */
775
+ parameterElement = "parameter",
776
+ typeParameterElement = "type parameter",
777
+ primitiveType = "primitive type",
778
+ label = "label",
779
+ alias = "alias",
780
+ constElement = "const",
781
+ letElement = "let",
782
+ directory = "directory",
783
+ externalModuleName = "external module name",
784
+ /**
785
+ * <JsxTagName attribute1 attribute2={0} />
786
+ */
787
+ jsxAttribute = "JSX attribute",
788
+ /** String literal */
789
+ string = "string"
790
+ }
791
+ export declare enum ScriptElementKindModifier {
792
+ none = "",
793
+ publicMemberModifier = "public",
794
+ privateMemberModifier = "private",
795
+ protectedMemberModifier = "protected",
796
+ exportedModifier = "export",
797
+ ambientModifier = "declare",
798
+ staticModifier = "static",
799
+ abstractModifier = "abstract",
800
+ optionalModifier = "optional",
801
+ dtsModifier = ".d.ts",
802
+ tsModifier = ".ts",
803
+ tsxModifier = ".tsx",
804
+ jsModifier = ".js",
805
+ jsxModifier = ".jsx",
806
+ jsonModifier = ".json"
807
+ }
808
+ export declare enum EndOfLineState {
809
+ None = 0,
810
+ InMultiLineCommentTrivia = 1,
811
+ InSingleQuoteStringLiteral = 2,
812
+ InDoubleQuoteStringLiteral = 3,
813
+ InTemplateHeadOrNoSubstitutionTemplate = 4,
814
+ InTemplateMiddleOrTail = 5,
815
+ InTemplateSubstitutionPosition = 6
816
+ }
817
+ export declare enum ClassificationTypeNames {
818
+ comment = "comment",
819
+ identifier = "identifier",
820
+ keyword = "keyword",
821
+ numericLiteral = "number",
822
+ bigintLiteral = "bigint",
823
+ operator = "operator",
824
+ stringLiteral = "string",
825
+ whiteSpace = "whitespace",
826
+ text = "text",
827
+ punctuation = "punctuation",
828
+ className = "class name",
829
+ enumName = "enum name",
830
+ interfaceName = "interface name",
831
+ moduleName = "module name",
832
+ typeParameterName = "type parameter name",
833
+ typeAliasName = "type alias name",
834
+ parameterName = "parameter name",
835
+ docCommentTagName = "doc comment tag name",
836
+ jsxOpenTagName = "jsx open tag name",
837
+ jsxCloseTagName = "jsx close tag name",
838
+ jsxSelfClosingTagName = "jsx self closing tag name",
839
+ jsxAttribute = "jsx attribute",
840
+ jsxText = "jsx text",
841
+ jsxAttributeStringLiteralValue = "jsx attribute string literal value"
842
+ }
843
+ /**
844
+ * O tipo de um trecho na classificação codificada. Os valores são o protocolo com o editor, como na tag: os que a
845
+ * Linguagem não produz (a classe, o enum, a regex, a tag do JSDoc) ficam, sem renumerar os outros.
846
+ */
847
+ export declare enum ClassificationType {
848
+ comment = 1,
849
+ identifier = 2,
850
+ keyword = 3,
851
+ numericLiteral = 4,
852
+ operator = 5,
853
+ stringLiteral = 6,
854
+ regularExpressionLiteral = 7,
855
+ whiteSpace = 8,
856
+ text = 9,
857
+ punctuation = 10,
858
+ className = 11,
859
+ enumName = 12,
860
+ interfaceName = 13,
861
+ moduleName = 14,
862
+ typeParameterName = 15,
863
+ typeAliasName = 16,
864
+ parameterName = 17,
865
+ docCommentTagName = 18,
866
+ jsxOpenTagName = 19,
867
+ jsxCloseTagName = 20,
868
+ jsxSelfClosingTagName = 21,
869
+ jsxAttribute = 22,
870
+ jsxText = 23,
871
+ jsxAttributeStringLiteralValue = 24,
872
+ bigintLiteral = 25
873
+ }
874
+ export interface CodeFixRegistration {
875
+ errorCodes: readonly number[];
876
+ getCodeActions(context: CodeFixContext): CodeFixAction[] | undefined;
877
+ fixIds?: readonly string[];
878
+ getAllCodeActions?(context: CodeFixAllContext): CombinedCodeActions;
879
+ }
880
+ /** O contexto de um code fix. O `program` é o resultado do `check` da cópia, no lugar do `Program` da tag. */
881
+ export interface CodeFixContextBase extends textChanges.TextChangesContext {
882
+ sourceFile: SourceFile;
883
+ program: CheckResult;
884
+ cancellationToken: CancellationToken;
885
+ preferences: UserPreferences;
886
+ }
887
+ export interface CodeFixAllContext extends CodeFixContextBase {
888
+ fixId: {};
889
+ }
890
+ export interface CodeFixContext extends CodeFixContextBase {
891
+ errorCode: number;
892
+ span: TextSpan;
893
+ }
894
+ export interface Refactor {
895
+ /** Compute the associated code actions */
896
+ getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined;
897
+ /** Compute (quickly) which actions are available here */
898
+ getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[];
899
+ }
900
+ /** O contexto de um refactor. O `program` é o resultado do `check` da cópia, no lugar do `Program` da tag. */
901
+ export interface RefactorContext extends textChanges.TextChangesContext {
902
+ file: SourceFile;
903
+ startPosition: number;
904
+ endPosition?: number;
905
+ program: CheckResult;
906
+ cancellationToken?: CancellationToken;
907
+ preferences: UserPreferences;
908
+ }