@lpc-lang/core 1.1.2-5.1

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 (317) hide show
  1. package/README.md +255 -0
  2. package/bin/lpc +4 -0
  3. package/bin/lpcserver +4 -0
  4. package/cancellationToken/cancellationToken.d.ts +8 -0
  5. package/cancellationToken/cancellationToken.d.ts.map +1 -0
  6. package/cancellationToken/serverCancellationToken.d.ts +21 -0
  7. package/cancellationToken/serverCancellationToken.d.ts.map +1 -0
  8. package/cli/_namespaces/lpc.d.ts +2 -0
  9. package/cli/_namespaces/lpc.d.ts.map +1 -0
  10. package/cli/lpc.d.ts +2 -0
  11. package/cli/lpc.d.ts.map +1 -0
  12. package/compiler/LpcConfig.d.ts +17 -0
  13. package/compiler/LpcConfig.d.ts.map +1 -0
  14. package/compiler/_namespaces/lpc.d.ts +49 -0
  15. package/compiler/_namespaces/lpc.d.ts.map +1 -0
  16. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts +2 -0
  17. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts.map +1 -0
  18. package/compiler/_namespaces/lpc.performance.d.ts +2 -0
  19. package/compiler/_namespaces/lpc.performance.d.ts.map +1 -0
  20. package/compiler/binder.d.ts +2 -0
  21. package/compiler/binder.d.ts.map +1 -0
  22. package/compiler/builderPublic.d.ts +76 -0
  23. package/compiler/builderPublic.d.ts.map +1 -0
  24. package/compiler/checker.d.ts +2 -0
  25. package/compiler/checker.d.ts.map +1 -0
  26. package/compiler/commandLineParser.d.ts +47 -0
  27. package/compiler/commandLineParser.d.ts.map +1 -0
  28. package/compiler/core.d.ts +3 -0
  29. package/compiler/core.d.ts.map +1 -0
  30. package/compiler/corePublic.d.ts +19 -0
  31. package/compiler/corePublic.d.ts.map +1 -0
  32. package/compiler/debug.d.ts +71 -0
  33. package/compiler/debug.d.ts.map +1 -0
  34. package/compiler/diagnosticInformation.d.ts +518 -0
  35. package/compiler/diagnosticInformation.d.ts.map +1 -0
  36. package/compiler/emitter.d.ts +11 -0
  37. package/compiler/emitter.d.ts.map +1 -0
  38. package/compiler/executeCommandLine.d.ts +15 -0
  39. package/compiler/executeCommandLine.d.ts.map +1 -0
  40. package/compiler/expressionToTypeNode.d.ts +2 -0
  41. package/compiler/expressionToTypeNode.d.ts.map +1 -0
  42. package/compiler/factory/baseNodeFactory.d.ts +2 -0
  43. package/compiler/factory/baseNodeFactory.d.ts.map +1 -0
  44. package/compiler/factory/emitHelper.d.ts +2 -0
  45. package/compiler/factory/emitHelper.d.ts.map +1 -0
  46. package/compiler/factory/emitNode.d.ts +22 -0
  47. package/compiler/factory/emitNode.d.ts.map +1 -0
  48. package/compiler/factory/nodeChildren.d.ts +2 -0
  49. package/compiler/factory/nodeChildren.d.ts.map +1 -0
  50. package/compiler/factory/nodeConverters.d.ts +2 -0
  51. package/compiler/factory/nodeConverters.d.ts.map +1 -0
  52. package/compiler/factory/nodeFactory.d.ts +4 -0
  53. package/compiler/factory/nodeFactory.d.ts.map +1 -0
  54. package/compiler/factory/parenthesizerRules.d.ts +2 -0
  55. package/compiler/factory/parenthesizerRules.d.ts.map +1 -0
  56. package/compiler/factory/utilities.d.ts +2 -0
  57. package/compiler/factory/utilities.d.ts.map +1 -0
  58. package/compiler/factory/utilitiesPublic.d.ts +4 -0
  59. package/compiler/factory/utilitiesPublic.d.ts.map +1 -0
  60. package/compiler/lpcFileHandler.d.ts +10 -0
  61. package/compiler/lpcFileHandler.d.ts.map +1 -0
  62. package/compiler/lpcJsHelpers.d.ts +17 -0
  63. package/compiler/lpcJsHelpers.d.ts.map +1 -0
  64. package/compiler/lpcbuild.d.ts +2 -0
  65. package/compiler/lpcbuild.d.ts.map +1 -0
  66. package/compiler/lpcbuildPublic.d.ts +26 -0
  67. package/compiler/lpcbuildPublic.d.ts.map +1 -0
  68. package/compiler/moduleNameResolver.d.ts +55 -0
  69. package/compiler/moduleNameResolver.d.ts.map +1 -0
  70. package/compiler/moduleSpecifiers.d.ts +2 -0
  71. package/compiler/moduleSpecifiers.d.ts.map +1 -0
  72. package/compiler/nodeTests.d.ts +115 -0
  73. package/compiler/nodeTests.d.ts.map +1 -0
  74. package/compiler/parser.d.ts +65 -0
  75. package/compiler/parser.d.ts.map +1 -0
  76. package/compiler/path.d.ts +2 -0
  77. package/compiler/path.d.ts.map +1 -0
  78. package/compiler/perfLoger.d.ts +2 -0
  79. package/compiler/perfLoger.d.ts.map +1 -0
  80. package/compiler/performance.d.ts +2 -0
  81. package/compiler/performance.d.ts.map +1 -0
  82. package/compiler/performanceCore.d.ts +2 -0
  83. package/compiler/performanceCore.d.ts.map +1 -0
  84. package/compiler/program.d.ts +72 -0
  85. package/compiler/program.d.ts.map +1 -0
  86. package/compiler/resolutionCache.d.ts +6 -0
  87. package/compiler/resolutionCache.d.ts.map +1 -0
  88. package/compiler/resolver.d.ts +1 -0
  89. package/compiler/resolver.d.ts.map +1 -0
  90. package/compiler/scanner.d.ts +85 -0
  91. package/compiler/scanner.d.ts.map +1 -0
  92. package/compiler/sourcemap.d.ts +2 -0
  93. package/compiler/sourcemap.d.ts.map +1 -0
  94. package/compiler/sys.d.ts +56 -0
  95. package/compiler/sys.d.ts.map +1 -0
  96. package/compiler/tracing.d.ts +31 -0
  97. package/compiler/tracing.d.ts.map +1 -0
  98. package/compiler/transformers/declarations.d.ts +2 -0
  99. package/compiler/transformers/declarations.d.ts.map +1 -0
  100. package/compiler/transformers.d.ts +2 -0
  101. package/compiler/transformers.d.ts.map +1 -0
  102. package/compiler/types.d.ts +3284 -0
  103. package/compiler/types.d.ts.map +1 -0
  104. package/compiler/utilities.d.ts +57 -0
  105. package/compiler/utilities.d.ts.map +1 -0
  106. package/compiler/utilitiesPublic.d.ts +213 -0
  107. package/compiler/utilitiesPublic.d.ts.map +1 -0
  108. package/compiler/visitorPublic.d.ts +72 -0
  109. package/compiler/visitorPublic.d.ts.map +1 -0
  110. package/compiler/watch.d.ts +2 -0
  111. package/compiler/watch.d.ts.map +1 -0
  112. package/compiler/watchPublic.d.ts +44 -0
  113. package/compiler/watchPublic.d.ts.map +1 -0
  114. package/compiler/watchUtilities.d.ts +14 -0
  115. package/compiler/watchUtilities.d.ts.map +1 -0
  116. package/config-types.d.ts +33 -0
  117. package/config-types.d.ts.map +1 -0
  118. package/harness/harnessIO.d.ts +4 -0
  119. package/harness/harnessIO.d.ts.map +1 -0
  120. package/lpc/_namespaces/lpc.d.ts +6 -0
  121. package/lpc/_namespaces/lpc.d.ts.map +1 -0
  122. package/lpc/_namespaces/lpc.server.d.ts +2 -0
  123. package/lpc/_namespaces/lpc.server.d.ts.map +1 -0
  124. package/lpc/lpc.d.ts +2 -0
  125. package/lpc/lpc.d.ts.map +1 -0
  126. package/lpcserver/document.d.ts +1 -0
  127. package/lpcserver/document.d.ts.map +1 -0
  128. package/lpcserver/nodeServer.d.ts +25 -0
  129. package/lpcserver/nodeServer.d.ts.map +1 -0
  130. package/lpcserver/protocol.const.d.ts +46 -0
  131. package/lpcserver/protocol.const.d.ts.map +1 -0
  132. package/lpcserver/server.d.ts +3 -0
  133. package/lpcserver/server.d.ts.map +1 -0
  134. package/lpcserver/textRendering.d.ts +14 -0
  135. package/lpcserver/textRendering.d.ts.map +1 -0
  136. package/lpcserver/typeConverters.d.ts +44 -0
  137. package/lpcserver/typeConverters.d.ts.map +1 -0
  138. package/lpcserver/utils.d.ts +14 -0
  139. package/lpcserver/utils.d.ts.map +1 -0
  140. package/package.json +48 -0
  141. package/parse-fluff-docs.d.ts +2 -0
  142. package/parse-fluff-docs.d.ts.map +1 -0
  143. package/parse-ld-docs.d.ts +2 -0
  144. package/parse-ld-docs.d.ts.map +1 -0
  145. package/server/_namespaces/lpc.d.ts +5 -0
  146. package/server/_namespaces/lpc.d.ts.map +1 -0
  147. package/server/_namespaces/lpc.server.d.ts +11 -0
  148. package/server/_namespaces/lpc.server.d.ts.map +1 -0
  149. package/server/_namespaces/lpc.server.protocol.d.ts +2 -0
  150. package/server/_namespaces/lpc.server.protocol.d.ts.map +1 -0
  151. package/server/editorServices.d.ts +261 -0
  152. package/server/editorServices.d.ts.map +1 -0
  153. package/server/project.d.ts +143 -0
  154. package/server/project.d.ts.map +1 -0
  155. package/server/protocol.d.ts +962 -0
  156. package/server/protocol.d.ts.map +1 -0
  157. package/server/scriptInfo.d.ts +53 -0
  158. package/server/scriptInfo.d.ts.map +1 -0
  159. package/server/scriptVersionCache.d.ts +2 -0
  160. package/server/scriptVersionCache.d.ts.map +1 -0
  161. package/server/session.d.ts +150 -0
  162. package/server/session.d.ts.map +1 -0
  163. package/server/types.d.ts +24 -0
  164. package/server/types.d.ts.map +1 -0
  165. package/server/utilities.d.ts +2 -0
  166. package/server/utilities.d.ts.map +1 -0
  167. package/server/utilitiesPublic.d.ts +37 -0
  168. package/server/utilitiesPublic.d.ts.map +1 -0
  169. package/server.d.ts +2 -0
  170. package/server.d.ts.map +1 -0
  171. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts +2 -0
  172. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts.map +1 -0
  173. package/services/_namespaces/lpc.Completions.d.ts +4 -0
  174. package/services/_namespaces/lpc.Completions.d.ts.map +1 -0
  175. package/services/_namespaces/lpc.FindAllReferences.d.ts +3 -0
  176. package/services/_namespaces/lpc.FindAllReferences.d.ts.map +1 -0
  177. package/services/_namespaces/lpc.GoToDefinition.d.ts +2 -0
  178. package/services/_namespaces/lpc.GoToDefinition.d.ts.map +1 -0
  179. package/services/_namespaces/lpc.JsDoc.d.ts +2 -0
  180. package/services/_namespaces/lpc.JsDoc.d.ts.map +1 -0
  181. package/services/_namespaces/lpc.NavigationBar.d.ts +2 -0
  182. package/services/_namespaces/lpc.NavigationBar.d.ts.map +1 -0
  183. package/services/_namespaces/lpc.Rename.d.ts +2 -0
  184. package/services/_namespaces/lpc.Rename.d.ts.map +1 -0
  185. package/services/_namespaces/lpc.SignatureHelp.d.ts +2 -0
  186. package/services/_namespaces/lpc.SignatureHelp.d.ts.map +1 -0
  187. package/services/_namespaces/lpc.SymbolDisplay.d.ts +2 -0
  188. package/services/_namespaces/lpc.SymbolDisplay.d.ts.map +1 -0
  189. package/services/_namespaces/lpc.codefix.d.ts +3 -0
  190. package/services/_namespaces/lpc.codefix.d.ts.map +1 -0
  191. package/services/_namespaces/lpc.d.ts +30 -0
  192. package/services/_namespaces/lpc.d.ts.map +1 -0
  193. package/services/_namespaces/lpc.formatting.d.ts +7 -0
  194. package/services/_namespaces/lpc.formatting.d.ts.map +1 -0
  195. package/services/_namespaces/lpc.textChanges.d.ts +2 -0
  196. package/services/_namespaces/lpc.textChanges.d.ts.map +1 -0
  197. package/services/classifier2020.d.ts +2 -0
  198. package/services/classifier2020.d.ts.map +1 -0
  199. package/services/codefixes/helpers.d.ts +2 -0
  200. package/services/codefixes/helpers.d.ts.map +1 -0
  201. package/services/codefixes/importFixes.d.ts +2 -0
  202. package/services/codefixes/importFixes.d.ts.map +1 -0
  203. package/services/completions.d.ts +2 -0
  204. package/services/completions.d.ts.map +1 -0
  205. package/services/documentRegistry.d.ts +90 -0
  206. package/services/documentRegistry.d.ts.map +1 -0
  207. package/services/exportInfoMap.d.ts +5 -0
  208. package/services/exportInfoMap.d.ts.map +1 -0
  209. package/services/findAllReferences.d.ts +2 -0
  210. package/services/findAllReferences.d.ts.map +1 -0
  211. package/services/formatting/formatting.d.ts +2 -0
  212. package/services/formatting/formatting.d.ts.map +1 -0
  213. package/services/formatting/formattingContext.d.ts +2 -0
  214. package/services/formatting/formattingContext.d.ts.map +1 -0
  215. package/services/formatting/rule.d.ts +2 -0
  216. package/services/formatting/rule.d.ts.map +1 -0
  217. package/services/formatting/rules.d.ts +2 -0
  218. package/services/formatting/rules.d.ts.map +1 -0
  219. package/services/formatting/rulesMap.d.ts +2 -0
  220. package/services/formatting/rulesMap.d.ts.map +1 -0
  221. package/services/formatting/smartIndenter.d.ts +2 -0
  222. package/services/formatting/smartIndenter.d.ts.map +1 -0
  223. package/services/goToDefinition.d.ts +2 -0
  224. package/services/goToDefinition.d.ts.map +1 -0
  225. package/services/importTracker.d.ts +2 -0
  226. package/services/importTracker.d.ts.map +1 -0
  227. package/services/jsDoc.d.ts +2 -0
  228. package/services/jsDoc.d.ts.map +1 -0
  229. package/services/navigationBar.d.ts +2 -0
  230. package/services/navigationBar.d.ts.map +1 -0
  231. package/services/rename.d.ts +2 -0
  232. package/services/rename.d.ts.map +1 -0
  233. package/services/services.d.ts +54 -0
  234. package/services/services.d.ts.map +1 -0
  235. package/services/signatureHelp.d.ts +2 -0
  236. package/services/signatureHelp.d.ts.map +1 -0
  237. package/services/sourcemaps.d.ts +2 -0
  238. package/services/sourcemaps.d.ts.map +1 -0
  239. package/services/stringCompletions.d.ts +2 -0
  240. package/services/stringCompletions.d.ts.map +1 -0
  241. package/services/suggestionDiagnostics.d.ts +2 -0
  242. package/services/suggestionDiagnostics.d.ts.map +1 -0
  243. package/services/symbolDisplay.d.ts +2 -0
  244. package/services/symbolDisplay.d.ts.map +1 -0
  245. package/services/textChanges.d.ts +2 -0
  246. package/services/textChanges.d.ts.map +1 -0
  247. package/services/types.d.ts +901 -0
  248. package/services/types.d.ts.map +1 -0
  249. package/services/utilities.d.ts +3 -0
  250. package/services/utilities.d.ts.map +1 -0
  251. package/src/cli.js +58 -0
  252. package/src/cli.js.map +7 -0
  253. package/src/efuns/fluffos/arrays.h +205 -0
  254. package/src/efuns/fluffos/async.h +84 -0
  255. package/src/efuns/fluffos/buffers.h +80 -0
  256. package/src/efuns/fluffos/calls.h +275 -0
  257. package/src/efuns/fluffos/contrib.h +805 -0
  258. package/src/efuns/fluffos/db.h +125 -0
  259. package/src/efuns/fluffos/driver.h +107 -0
  260. package/src/efuns/fluffos/ed.h +48 -0
  261. package/src/efuns/fluffos/efuns.fluffos.h +75 -0
  262. package/src/efuns/fluffos/external.h +30 -0
  263. package/src/efuns/fluffos/filesystem.h +154 -0
  264. package/src/efuns/fluffos/floats.h +136 -0
  265. package/src/efuns/fluffos/functions.h +104 -0
  266. package/src/efuns/fluffos/general.h +548 -0
  267. package/src/efuns/fluffos/interactive.h +777 -0
  268. package/src/efuns/fluffos/internals.h +455 -0
  269. package/src/efuns/fluffos/lpc-config.json +10 -0
  270. package/src/efuns/fluffos/mappings.h +205 -0
  271. package/src/efuns/fluffos/misc.h +43 -0
  272. package/src/efuns/fluffos/mudlib.h +228 -0
  273. package/src/efuns/fluffos/numbers.h +41 -0
  274. package/src/efuns/fluffos/objects.h +365 -0
  275. package/src/efuns/fluffos/parsing.h +220 -0
  276. package/src/efuns/fluffos/pcre.h +75 -0
  277. package/src/efuns/fluffos/sockets.h +276 -0
  278. package/src/efuns/fluffos/strings.h +542 -0
  279. package/src/efuns/fluffos/system.h +408 -0
  280. package/src/efuns/fluffos/zh-cn/arrays.zh-cn.h +167 -0
  281. package/src/efuns/fluffos/zh-cn/async.zh-cn.h +81 -0
  282. package/src/efuns/fluffos/zh-cn/buffers.zh-cn.h +69 -0
  283. package/src/efuns/fluffos/zh-cn/calls.zh-cn.h +242 -0
  284. package/src/efuns/fluffos/zh-cn/contrib.zh-cn.h +767 -0
  285. package/src/efuns/fluffos/zh-cn/db.zh-cn.h +113 -0
  286. package/src/efuns/fluffos/zh-cn/ed.zh-cn.h +42 -0
  287. package/src/efuns/fluffos/zh-cn/efuns.fluffos.h +76 -0
  288. package/src/efuns/fluffos/zh-cn/external.zh-cn.h +25 -0
  289. package/src/efuns/fluffos/zh-cn/filesystem.zh-cn.h +140 -0
  290. package/src/efuns/fluffos/zh-cn/floats.zh-cn.h +129 -0
  291. package/src/efuns/fluffos/zh-cn/functions.zh-cn.h +87 -0
  292. package/src/efuns/fluffos/zh-cn/general.zh-cn.h +506 -0
  293. package/src/efuns/fluffos/zh-cn/interactive.zh-cn.h +659 -0
  294. package/src/efuns/fluffos/zh-cn/internals.zh-cn.h +356 -0
  295. package/src/efuns/fluffos/zh-cn/mappings.zh-cn.h +188 -0
  296. package/src/efuns/fluffos/zh-cn/misc.zh-cn.h +43 -0
  297. package/src/efuns/fluffos/zh-cn/mudlib.zh-cn.h +190 -0
  298. package/src/efuns/fluffos/zh-cn/numbers.zh-cn.h +36 -0
  299. package/src/efuns/fluffos/zh-cn/objects.zh-cn.h +280 -0
  300. package/src/efuns/fluffos/zh-cn/parsing.zh-cn.h +212 -0
  301. package/src/efuns/fluffos/zh-cn/pcre.zh-cn.h +67 -0
  302. package/src/efuns/fluffos/zh-cn/sockets.zh-cn.h +230 -0
  303. package/src/efuns/fluffos/zh-cn/strings.zh-cn.h +484 -0
  304. package/src/efuns/fluffos/zh-cn/system.zh-cn.h +366 -0
  305. package/src/efuns/ldmud/defines.h +69 -0
  306. package/src/efuns/ldmud/efun.h +10449 -0
  307. package/src/efuns/ldmud/efuns.ldmud.h +87 -0
  308. package/src/efuns/ldmud/lpc-config.json +9 -0
  309. package/src/efuns/ldmud/obsolete.h +2168 -0
  310. package/src/lpc.js +82486 -0
  311. package/src/lpc.js.map +6 -0
  312. package/src/server.js +129 -0
  313. package/src/server.js.map +7 -0
  314. package/types.d.ts +23 -0
  315. package/types.d.ts.map +1 -0
  316. package/utils.d.ts +21 -0
  317. package/utils.d.ts.map +1 -0
@@ -0,0 +1,901 @@
1
+ import { CompilerOptions, Diagnostic, DiagnosticWithLocation, ExportMapInfoKey, FormatCodeSettings, GetEffectiveTypeRootsHost, LineAndCharacter, MinimalResolutionCacheHost, Program, ProjectReference, ResolvedModule, ResolvedModuleWithFailedLookupLocations, ResolvedProjectReference, ScriptKind, SourceFile, StringLiteral, Symbol, TextChangeRange, TextSpan, UserPreferences } from "./_namespaces/lpc.js";
2
+ declare module "../compiler/types.js" {
3
+ interface Type {
4
+ getFlags(): TypeFlags;
5
+ getSymbol(): Symbol | undefined;
6
+ getProperties(): Symbol[];
7
+ getProperty(propertyName: string): Symbol | undefined;
8
+ getApparentProperties(): Symbol[];
9
+ getCallSignatures(): readonly Signature[];
10
+ getConstructSignatures(): readonly Signature[];
11
+ getStringIndexType(): Type | undefined;
12
+ getNumberIndexType(): Type | undefined;
13
+ getBaseTypes(): BaseType[] | undefined;
14
+ getNonNullableType(): Type;
15
+ getConstraint(): Type | undefined;
16
+ getDefault(): Type | undefined;
17
+ isUnion(): this is UnionType;
18
+ isUnionOrIntersection(): this is UnionOrIntersectionType;
19
+ isLiteral(): this is LiteralType;
20
+ isStringLiteral(): this is StringLiteralType;
21
+ isIntLiteral(): this is IntLiteralType;
22
+ isFloatLiteral(): this is FloatLiteralType;
23
+ isTypeParameter(): this is TypeParameter;
24
+ isClassOrInterface(): this is InterfaceType;
25
+ isClass(): this is InterfaceType;
26
+ isIndexType(): this is IndexType;
27
+ }
28
+ }
29
+ declare module "../compiler/types.js" {
30
+ interface Node {
31
+ getSourceFile(): SourceFile;
32
+ getChildCount(sourceFile?: SourceFile): number;
33
+ getChildAt(index: number, sourceFile?: SourceFile): Node;
34
+ getChildren(sourceFile?: SourceFile): readonly Node[];
35
+ getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
36
+ getFullStart(): number;
37
+ getEnd(): number;
38
+ getWidth(sourceFile?: SourceFileLike): number;
39
+ getFullWidth(): number;
40
+ getLeadingTriviaWidth(sourceFile?: SourceFile): number;
41
+ getFullText(sourceFile?: SourceFile): string;
42
+ getText(sourceFile?: SourceFile): string;
43
+ getFirstToken(sourceFile?: SourceFile): Node | undefined;
44
+ getLastToken(sourceFile?: SourceFile): Node | undefined;
45
+ forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
46
+ }
47
+ }
48
+ declare module "../compiler/types.js" {
49
+ interface SourceFile {
50
+ getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
51
+ getLineEndOfPosition(pos: number): number;
52
+ getLineStarts(): readonly number[];
53
+ getPositionOfLineAndCharacter(line: number, character: number): number;
54
+ }
55
+ }
56
+ declare module "../compiler/types.js" {
57
+ interface SourceFileLike {
58
+ getLineAndCharacterOfPosition?(pos: number): LineAndCharacter;
59
+ }
60
+ }
61
+ declare module "../compiler/types.js" {
62
+ interface Identifier {
63
+ readonly text: string;
64
+ }
65
+ }
66
+ declare module "../compiler/types.js" {
67
+ interface Signature {
68
+ getDeclaration(): SignatureDeclaration;
69
+ getTypeParameters(): TypeParameter[] | undefined;
70
+ getParameters(): Symbol[];
71
+ getReturnType(): Type;
72
+ getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
73
+ getJsDocTags(): JSDocTagInfo[];
74
+ }
75
+ }
76
+ declare module "../compiler/types.js" {
77
+ interface Symbol {
78
+ getFlags(): SymbolFlags;
79
+ getName(): string;
80
+ getDeclarations(): Declaration[] | undefined;
81
+ getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
82
+ getJsDocTags(checker?: TypeChecker): JSDocTagInfo[];
83
+ }
84
+ }
85
+ export interface SymbolDisplayPart {
86
+ /**
87
+ * Text of an item describing the symbol.
88
+ */
89
+ text: string;
90
+ /**
91
+ * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
92
+ */
93
+ kind: string;
94
+ }
95
+ export interface JSDocTagInfo {
96
+ name: string;
97
+ text?: SymbolDisplayPart[];
98
+ }
99
+ export interface DocumentSpan {
100
+ textSpan: TextSpan;
101
+ fileName: string;
102
+ /**
103
+ * If the span represents a location that was remapped (e.g. via a .d.ts.map file),
104
+ * then the original filename and span will be specified here
105
+ */
106
+ originalTextSpan?: TextSpan;
107
+ originalFileName?: string;
108
+ /**
109
+ * If DocumentSpan.textSpan is the span for name of the declaration,
110
+ * then this is the span for relevant declaration
111
+ */
112
+ contextSpan?: TextSpan;
113
+ originalContextSpan?: TextSpan;
114
+ }
115
+ export declare const enum ScriptElementKind {
116
+ unknown = "",
117
+ warning = "warning",
118
+ /** predefined type (void) or keyword (class) */
119
+ keyword = "keyword",
120
+ /** top level script node */
121
+ scriptElement = "script",
122
+ /** module foo {} */
123
+ moduleElement = "module",
124
+ /** class X {} */
125
+ classElement = "class",
126
+ /** var x = class X {} */
127
+ localClassElement = "local class",
128
+ /** interface Y {} */
129
+ interfaceElement = "interface",
130
+ /** type T = ... */
131
+ typeElement = "type",
132
+ /** enum E */
133
+ enumElement = "enum",
134
+ enumMemberElement = "enum member",
135
+ /**
136
+ * Inside module and script only
137
+ * const v = ..
138
+ */
139
+ variableElement = "var",
140
+ /** Inside function */
141
+ localVariableElement = "local var",
142
+ /** using foo = ... */
143
+ variableUsingElement = "using",
144
+ /** await using foo = ... */
145
+ variableAwaitUsingElement = "await using",
146
+ /**
147
+ * Inside module and script only
148
+ * function f() { }
149
+ */
150
+ functionElement = "function",
151
+ /** Inside function */
152
+ localFunctionElement = "local function",
153
+ /** class X { [public|private]* foo() {} } */
154
+ memberFunctionElement = "method",
155
+ /** class X { [public|private]* [get|set] foo:number; } */
156
+ memberGetAccessorElement = "getter",
157
+ memberSetAccessorElement = "setter",
158
+ /**
159
+ * class X { [public|private]* foo:number; }
160
+ * interface Y { foo:number; }
161
+ */
162
+ memberVariableElement = "property",
163
+ /** class X { [public|private]* accessor foo: number; } */
164
+ memberAccessorVariableElement = "accessor",
165
+ /**
166
+ * class X { constructor() { } }
167
+ * class X { static { } }
168
+ */
169
+ constructorImplementationElement = "constructor",
170
+ /** interface Y { ():number; } */
171
+ callSignatureElement = "call",
172
+ /** interface Y { []:number; } */
173
+ indexSignatureElement = "index",
174
+ /** interface Y { new():Y; } */
175
+ constructSignatureElement = "construct",
176
+ /** function foo(*Y*: string) */
177
+ parameterElement = "parameter",
178
+ typeParameterElement = "type parameter",
179
+ primitiveType = "primitive type",
180
+ label = "label",
181
+ alias = "alias",
182
+ constElement = "const",
183
+ letElement = "let",
184
+ define = "define",
185
+ directory = "directory",
186
+ externalModuleName = "external module name",
187
+ /**
188
+ * <JsxTagName attribute1 attribute2={0} />
189
+ * @deprecated
190
+ */
191
+ jsxAttribute = "JSX attribute",
192
+ /** String literal */
193
+ string = "string",
194
+ /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */
195
+ link = "link",
196
+ /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */
197
+ linkName = "link name",
198
+ /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */
199
+ linkText = "link text"
200
+ }
201
+ export interface DefinitionInfo extends DocumentSpan {
202
+ kind: ScriptElementKind;
203
+ name: string;
204
+ containerKind: ScriptElementKind;
205
+ containerName: string;
206
+ unverified?: boolean;
207
+ }
208
+ export type WithMetadata<T> = T & {
209
+ metadata?: unknown;
210
+ };
211
+ export interface LanguageService {
212
+ /** This is used as a part of restarting the language service. */
213
+ cleanupSemanticCache(): void;
214
+ getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
215
+ /**
216
+ * Gets semantic highlights information for a particular file. Has two formats, an older
217
+ * version used by VS and a format used by VS Code.
218
+ *
219
+ * @param fileName The path to the file
220
+ * @param position A text span to return results within
221
+ * @param format Which format to use, defaults to "original"
222
+ * @returns a number array encoded as triples of [start, length, ClassificationType, ...].
223
+ */
224
+ getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
225
+ getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
226
+ /**
227
+ * Gets semantic information about the identifier at a particular position in a
228
+ * file. Quick info is what you typically see when you hover in an editor.
229
+ *
230
+ * @param fileName The path to the file
231
+ * @param position A zero-based index of the character where you want the quick info
232
+ */
233
+ getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
234
+ /**
235
+ * Gets global diagnostics related to the program configuration and compiler options.
236
+ */
237
+ getCompilerOptionsDiagnostics(): Diagnostic[];
238
+ getProgram(): Program | undefined;
239
+ getNavigationTree(fileName: string): NavigationTree;
240
+ /**
241
+ * Gets errors indicating invalid syntax in a file.
242
+ *
243
+ * In English, "this cdeo have, erorrs" is syntactically invalid because it has typos,
244
+ * grammatical errors, and misplaced punctuation. Likewise, examples of syntax
245
+ * errors in TypeScript are missing parentheses in an `if` statement, mismatched
246
+ * curly braces, and using a reserved keyword as a variable name.
247
+ *
248
+ * These diagnostics are inexpensive to compute and don't require knowledge of
249
+ * other files. Note that a non-empty result increases the likelihood of false positives
250
+ * from `getSemanticDiagnostics`.
251
+ *
252
+ * While these represent the majority of syntax-related diagnostics, there are some
253
+ * that require the type system, which will be present in `getSemanticDiagnostics`.
254
+ *
255
+ * @param fileName A path to the file you want syntactic diagnostics for
256
+ */
257
+ getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[];
258
+ /**
259
+ * Gets suggestion diagnostics for a specific file. These diagnostics tend to
260
+ * proactively suggest refactors, as opposed to diagnostics that indicate
261
+ * potentially incorrect runtime behavior.
262
+ *
263
+ * @param fileName A path to the file you want semantic diagnostics for
264
+ */
265
+ getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[];
266
+ /**
267
+ * Gets warnings or errors indicating type system issues in a given file.
268
+ * Requesting semantic diagnostics may start up the type system and
269
+ * run deferred work, so the first call may take longer than subsequent calls.
270
+ *
271
+ * Unlike the other get*Diagnostics functions, these diagnostics can potentially not
272
+ * include a reference to a source file. Specifically, the first time this is called,
273
+ * it will return global diagnostics with no associated location.
274
+ *
275
+ * To contrast the differences between semantic and syntactic diagnostics, consider the
276
+ * sentence: "The sun is green." is syntactically correct; those are real English words with
277
+ * correct sentence structure. However, it is semantically invalid, because it is not true.
278
+ *
279
+ * @param fileName A path to the file you want semantic diagnostics for
280
+ */
281
+ getSemanticDiagnostics(fileName: string): Diagnostic[];
282
+ toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
283
+ findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined;
284
+ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined;
285
+ /** @deprecated Pass `providePrefixAndSuffixTextForRename` as part of a `UserPreferences` parameter. */
286
+ findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
287
+ getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo;
288
+ /**
289
+ * Gets completion entries at a particular position in a file.
290
+ *
291
+ * @param fileName The path to the file
292
+ * @param position A zero-based index of the character where you want the entries
293
+ * @param options An object describing how the request was triggered and what kinds
294
+ * of code actions can be returned with the completions.
295
+ * @param formattingSettings settings needed for calling formatting functions.
296
+ */
297
+ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
298
+ /**
299
+ * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
300
+ *
301
+ * @param fileName The path to the file
302
+ * @param position A zero based index of the character where you want the entries
303
+ * @param entryName The `name` from an existing completion which came from `getCompletionsAtPosition`
304
+ * @param formatOptions How should code samples in the completions be formatted, can be undefined for backwards compatibility
305
+ * @param source `source` property from the completion entry
306
+ * @param preferences User settings, can be undefined for backwards compatibility
307
+ * @param data `data` property from the completion entry
308
+ */
309
+ getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: FormatCodeSettings | undefined, source: string | undefined, preferences: UserPreferences | undefined, data: CompletionEntryData | undefined): CompletionEntryDetails | undefined;
310
+ getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined;
311
+ dispose(): void;
312
+ }
313
+ export interface HostCancellationToken {
314
+ isCancellationRequested(): boolean;
315
+ }
316
+ /**
317
+ * Represents an immutable snapshot of a script at a specified time.Once acquired, the
318
+ * snapshot is observably immutable. i.e. the same calls with the same parameters will return
319
+ * the same values.
320
+ */
321
+ export interface IScriptSnapshot {
322
+ /** Gets a portion of the script snapshot specified by [start, end). */
323
+ getText(start: number, end: number): string;
324
+ /** Gets the length of this script snapshot. */
325
+ getLength(): number;
326
+ /**
327
+ * Gets the TextChangeRange that describe how the text changed between this text and
328
+ * an older version. This information is used by the incremental parser to determine
329
+ * what sections of the script need to be re-parsed. 'undefined' can be returned if the
330
+ * change range cannot be determined. However, in that case, incremental parsing will
331
+ * not happen and the entire document will be re - parsed.
332
+ */
333
+ getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
334
+ /** Releases all resources held by this script snapshot */
335
+ dispose?(): void;
336
+ }
337
+ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalResolutionCacheHost {
338
+ getCompilationSettings(): CompilerOptions;
339
+ getNewLine?(): string;
340
+ getProjectVersion?(): string;
341
+ getScriptFileNames(): string[];
342
+ getScriptKind?(fileName: string): ScriptKind;
343
+ getScriptVersion(fileName: string): string;
344
+ getScriptSnapshot(fileName: string): IScriptSnapshot | undefined;
345
+ getProjectReferences?(): readonly ProjectReference[] | undefined;
346
+ getLocalizedDiagnosticMessages?(): any;
347
+ getCancellationToken?(): HostCancellationToken;
348
+ getCurrentDirectory(): string;
349
+ getDefaultLibFileName(options: CompilerOptions): string;
350
+ log?(s: string): void;
351
+ trace?(s: string): void;
352
+ error?(s: string): void;
353
+ useCaseSensitiveFileNames?(): boolean;
354
+ readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
355
+ realpath?(path: string): string;
356
+ readFile(path: string, encoding?: string): string | undefined;
357
+ fileExists(path: string): boolean;
358
+ getTypeRootsVersion?(): number;
359
+ getIncludeDirs: () => string[];
360
+ /** @deprecated supply resolveModuleNameLiterals instead for resolution that can handle newer resolution modes like nodenext */
361
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
362
+ /** @deprecated supply resolveTypeReferenceDirectiveReferences instead for resolution that can handle newer resolution modes like nodenext */
363
+ resolveModuleNameLiterals?(moduleLiterals: readonly StringLiteral[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile, reusedNames: readonly StringLiteral[] | undefined): readonly ResolvedModuleWithFailedLookupLocations[];
364
+ getDirectories?(directoryName: string): string[];
365
+ /**
366
+ * Gets a set of custom transformers to use during emit.
367
+ */
368
+ isKnownTypesPackageName?(name: string): boolean;
369
+ writeFile?(fileName: string, content: string): void;
370
+ onAllFilesNeedReparse?(fileNames: string[]): void;
371
+ }
372
+ /**
373
+ * Represents an immutable snapshot of a script at a specified time.Once acquired, the
374
+ * snapshot is observably immutable. i.e. the same calls with the same parameters will return
375
+ * the same values.
376
+ */
377
+ export interface IScriptSnapshot {
378
+ /** Gets a portion of the script snapshot specified by [start, end). */
379
+ getText(start: number, end: number): string;
380
+ /** Gets the length of this script snapshot. */
381
+ getLength(): number;
382
+ /**
383
+ * Gets the TextChangeRange that describe how the text changed between this text and
384
+ * an older version. This information is used by the incremental parser to determine
385
+ * what sections of the script need to be re-parsed. 'undefined' can be returned if the
386
+ * change range cannot be determined. However, in that case, incremental parsing will
387
+ * not happen and the entire document will be re - parsed.
388
+ */
389
+ getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | undefined;
390
+ /** Releases all resources held by this script snapshot */
391
+ dispose?(): void;
392
+ }
393
+ export declare namespace ScriptSnapshot {
394
+ function fromString(text: string): IScriptSnapshot;
395
+ }
396
+ export interface QuickInfo {
397
+ kind: ScriptElementKind;
398
+ kindModifiers: string;
399
+ textSpan: TextSpan;
400
+ displayParts?: SymbolDisplayPart[];
401
+ documentation?: SymbolDisplayPart[];
402
+ tags?: JSDocTagInfo[];
403
+ }
404
+ export declare const enum ScriptElementKindModifier {
405
+ none = "",
406
+ publicMemberModifier = "public",
407
+ privateMemberModifier = "private",
408
+ protectedMemberModifier = "protected",
409
+ exportedModifier = "export",
410
+ ambientModifier = "declare",
411
+ staticModifier = "static",
412
+ abstractModifier = "abstract",
413
+ optionalModifier = "optional",
414
+ deprecatedModifier = "deprecated",
415
+ jsonModifier = ".json",
416
+ cModifier = ".c",
417
+ hModifier = ".h",
418
+ lpcModifier = ".lpc"
419
+ }
420
+ export declare enum SymbolDisplayPartKind {
421
+ aliasName = 0,
422
+ className = 1,
423
+ enumName = 2,
424
+ fieldName = 3,
425
+ interfaceName = 4,
426
+ keyword = 5,
427
+ lineBreak = 6,
428
+ numericLiteral = 7,
429
+ stringLiteral = 8,
430
+ localName = 9,
431
+ methodName = 10,
432
+ moduleName = 11,
433
+ operator = 12,
434
+ parameterName = 13,
435
+ propertyName = 14,
436
+ punctuation = 15,
437
+ space = 16,
438
+ text = 17,
439
+ typeParameterName = 18,
440
+ enumMemberName = 19,
441
+ functionName = 20,
442
+ regularExpressionLiteral = 21,
443
+ link = 22,
444
+ linkName = 23,
445
+ linkText = 24
446
+ }
447
+ export declare enum LanguageServiceMode {
448
+ Semantic = 0,
449
+ PartialSemantic = 1,
450
+ Syntactic = 2
451
+ }
452
+ export interface TextChange {
453
+ span: TextSpan;
454
+ newText: string;
455
+ }
456
+ export interface PerformanceEvent {
457
+ kind: "UpdateGraph" | "CreatePackageJsonAutoImportProvider";
458
+ durationMs: number;
459
+ }
460
+ /**
461
+ * Navigation bar interface designed for visual studio's dual-column layout.
462
+ * This does not form a proper tree.
463
+ * The navbar is returned as a list of top-level items, each of which has a list of child items.
464
+ * Child items always have an empty array for their `childItems`.
465
+ */
466
+ export interface NavigationBarItem {
467
+ text: string;
468
+ kind: ScriptElementKind;
469
+ kindModifiers: string;
470
+ spans: TextSpan[];
471
+ childItems: NavigationBarItem[];
472
+ indent: number;
473
+ bolded: boolean;
474
+ grayed: boolean;
475
+ }
476
+ /**
477
+ * Node in a tree of nested declarations in a file.
478
+ * The top node is always a script or module node.
479
+ */
480
+ export interface NavigationTree {
481
+ /** Name of the declaration, or a short description, e.g. "<class>". */
482
+ text: string;
483
+ kind: ScriptElementKind;
484
+ /** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
485
+ kindModifiers: string;
486
+ /**
487
+ * Spans of the nodes that generated this declaration.
488
+ * There will be more than one if this is the result of merging.
489
+ */
490
+ spans: TextSpan[];
491
+ nameSpan: TextSpan | undefined;
492
+ /** Present if non-empty */
493
+ childItems?: NavigationTree[];
494
+ }
495
+ export interface ReferenceEntry extends DocumentSpan {
496
+ isWriteAccess: boolean;
497
+ isInString?: true;
498
+ }
499
+ export interface ReferencedSymbolDefinitionInfo extends DefinitionInfo {
500
+ displayParts: SymbolDisplayPart[];
501
+ }
502
+ export interface ReferencedSymbol {
503
+ definition: ReferencedSymbolDefinitionInfo;
504
+ references: ReferencedSymbolEntry[];
505
+ }
506
+ export interface ReferencedSymbolEntry extends ReferenceEntry {
507
+ isDefinition?: boolean;
508
+ }
509
+ export interface RenameInfoSuccess {
510
+ canRename: true;
511
+ /**
512
+ * File or directory to rename.
513
+ * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
514
+ */
515
+ fileToRename?: string;
516
+ displayName: string;
517
+ /**
518
+ * Full display name of item to be renamed.
519
+ * If item to be renamed is a file, then this is the original text of the module specifer
520
+ */
521
+ fullDisplayName: string;
522
+ kind: ScriptElementKind;
523
+ kindModifiers: string;
524
+ triggerSpan: TextSpan;
525
+ }
526
+ export type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
527
+ export interface RenameLocation extends DocumentSpan {
528
+ readonly prefixText?: string;
529
+ readonly suffixText?: string;
530
+ }
531
+ export interface RenameInfoFailure {
532
+ canRename: false;
533
+ localizedErrorMessage: string;
534
+ }
535
+ export interface CompletionEntryLabelDetails {
536
+ /**
537
+ * An optional string which is rendered less prominently directly after
538
+ * {@link CompletionEntry.name name}, without any spacing. Should be
539
+ * used for function signatures or type annotations.
540
+ */
541
+ detail?: string;
542
+ /**
543
+ * An optional string which is rendered less prominently after
544
+ * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
545
+ * names or file path.
546
+ */
547
+ description?: string;
548
+ }
549
+ export interface CompletionEntryDataAutoImport {
550
+ /**
551
+ * The name of the property or export in the module's symbol table. Differs from the completion name
552
+ * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default.
553
+ */
554
+ exportName: string;
555
+ exportMapKey?: ExportMapInfoKey;
556
+ moduleSpecifier?: string;
557
+ /** The file name declaring the export's module symbol, if it was an external module */
558
+ fileName?: string;
559
+ /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */
560
+ ambientModuleName?: string;
561
+ /** True if the export was found in the package.json AutoImportProvider */
562
+ isPackageJsonImport?: true;
563
+ }
564
+ export interface CompletionEntryDataResolved extends CompletionEntryDataAutoImport {
565
+ moduleSpecifier: string;
566
+ }
567
+ export interface CompletionEntryDataUnresolved extends CompletionEntryDataAutoImport {
568
+ exportMapKey: ExportMapInfoKey;
569
+ }
570
+ export type CompletionEntryData = CompletionEntryDataUnresolved | CompletionEntryDataResolved;
571
+ export interface CompletionEntry {
572
+ name: string;
573
+ kind: ScriptElementKind;
574
+ kindModifiers?: string;
575
+ /**
576
+ * A string that is used for comparing completion items so that they can be ordered. This
577
+ * is often the same as the name but may be different in certain circumstances.
578
+ */
579
+ sortText: string;
580
+ /**
581
+ * Text to insert instead of `name`.
582
+ * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
583
+ * coupled with `replacementSpan` to replace a dotted access with a bracket access.
584
+ */
585
+ insertText?: string;
586
+ /**
587
+ * A string that should be used when filtering a set of
588
+ * completion items.
589
+ */
590
+ filterText?: string;
591
+ /**
592
+ * `insertText` should be interpreted as a snippet if true.
593
+ */
594
+ isSnippet?: true;
595
+ /**
596
+ * An optional span that indicates the text to be replaced by this completion item.
597
+ * If present, this span should be used instead of the default one.
598
+ * It will be set if the required span differs from the one generated by the default replacement behavior.
599
+ */
600
+ replacementSpan?: TextSpan;
601
+ /**
602
+ * Indicates whether commiting this completion entry will require additional code actions to be
603
+ * made to avoid errors. The CompletionEntryDetails will have these actions.
604
+ */
605
+ hasAction?: true;
606
+ /**
607
+ * Identifier (not necessarily human-readable) identifying where this completion came from.
608
+ */
609
+ source?: string;
610
+ /**
611
+ * Human-readable description of the `source`.
612
+ */
613
+ sourceDisplay?: SymbolDisplayPart[];
614
+ /**
615
+ * Additional details for the label.
616
+ */
617
+ labelDetails?: CompletionEntryLabelDetails;
618
+ /**
619
+ * If true, this completion should be highlighted as recommended. There will only be one of these.
620
+ * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
621
+ * Then either that enum/class or a namespace containing it will be the recommended symbol.
622
+ */
623
+ isRecommended?: true;
624
+ /**
625
+ * If true, this completion was generated from traversing the name table of an unchecked JS file,
626
+ * and therefore may not be accurate.
627
+ */
628
+ isFromUncheckedFile?: true;
629
+ /**
630
+ * If true, this completion was for an auto-import of a module not yet in the program, but listed
631
+ * in the project package.json. Used for telemetry reporting.
632
+ */
633
+ isPackageJsonImport?: true;
634
+ /**
635
+ * If true, this completion was an auto-import-style completion of an import statement (i.e., the
636
+ * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
637
+ */
638
+ isImportStatementCompletion?: true;
639
+ /**
640
+ * For API purposes.
641
+ * Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`.
642
+ * @example Get declaration of completion: `symbol.valueDeclaration`
643
+ */
644
+ symbol?: Symbol;
645
+ /**
646
+ * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
647
+ * that allows TS Server to look up the symbol represented by the completion item, disambiguating
648
+ * items with the same name. Currently only defined for auto-import completions, but the type is
649
+ * `unknown` in the protocol, so it can be changed as needed to support other kinds of completions.
650
+ * The presence of this property should generally not be used to assume that this completion entry
651
+ * is an auto-import.
652
+ */
653
+ data?: CompletionEntryData;
654
+ }
655
+ export declare const enum CompletionInfoFlags {
656
+ None = 0,
657
+ MayIncludeAutoImports = 1,
658
+ IsImportStatementCompletion = 2,
659
+ IsContinuation = 4,
660
+ ResolvedModuleSpecifiers = 8,
661
+ ResolvedModuleSpecifiersBeyondLimit = 16,
662
+ MayIncludeMethodSnippets = 32
663
+ }
664
+ export interface CompletionInfo {
665
+ /** For performance telemetry. */
666
+ flags?: CompletionInfoFlags;
667
+ /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
668
+ isGlobalCompletion: boolean;
669
+ isMemberCompletion: boolean;
670
+ /**
671
+ * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
672
+ * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
673
+ * must be used to commit that completion entry.
674
+ */
675
+ optionalReplacementSpan?: TextSpan;
676
+ /**
677
+ * true when the current location also allows for a new identifier
678
+ */
679
+ isNewIdentifierLocation: boolean;
680
+ /**
681
+ * Indicates to client to continue requesting completions on subsequent keystrokes.
682
+ */
683
+ isIncomplete?: true;
684
+ entries: CompletionEntry[];
685
+ }
686
+ export type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | " " | ">";
687
+ export declare const CompletionTriggerCharacterArray: CompletionsTriggerCharacter[];
688
+ export declare const enum CompletionTriggerKind {
689
+ /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
690
+ Invoked = 1,
691
+ /** Completion was triggered by a trigger character. */
692
+ TriggerCharacter = 2,
693
+ /** Completion was re-triggered as the current completion list is incomplete. */
694
+ TriggerForIncompleteCompletions = 3
695
+ }
696
+ export interface GetCompletionsAtPositionOptions extends UserPreferences {
697
+ /**
698
+ * If the editor is asking for completions because a certain character was typed
699
+ * (as opposed to when the user explicitly requested them) this should be set.
700
+ */
701
+ triggerCharacter?: CompletionsTriggerCharacter;
702
+ triggerKind?: CompletionTriggerKind;
703
+ /**
704
+ * Include a `symbol` property on each completion entry object.
705
+ * Symbols reference cyclic data structures and sometimes an entire TypeChecker instance,
706
+ * so use caution when serializing or retaining completion entries retrieved with this option.
707
+ * @default false
708
+ */
709
+ includeSymbol?: boolean;
710
+ /** @deprecated Use includeCompletionsForModuleExports */
711
+ includeExternalModuleExports?: boolean;
712
+ /** @deprecated Use includeCompletionsWithInsertText */
713
+ includeInsertTextCompletions?: boolean;
714
+ }
715
+ export interface TextChange {
716
+ span: TextSpan;
717
+ newText: string;
718
+ }
719
+ export interface FileTextChanges {
720
+ fileName: string;
721
+ textChanges: readonly TextChange[];
722
+ isNewFile?: boolean;
723
+ }
724
+ export type CodeActionCommand = InstallPackageAction;
725
+ export interface InstallPackageAction {
726
+ }
727
+ export interface CodeAction {
728
+ /** Description of the code action to display in the UI of the editor */
729
+ description: string;
730
+ /** Text changes to apply to each file as part of the code action */
731
+ changes: FileTextChanges[];
732
+ /**
733
+ * If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
734
+ * This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
735
+ */
736
+ commands?: CodeActionCommand[];
737
+ }
738
+ export interface CompletionEntryDetails {
739
+ name: string;
740
+ kind: ScriptElementKind;
741
+ kindModifiers: string;
742
+ displayParts: SymbolDisplayPart[];
743
+ documentation?: SymbolDisplayPart[];
744
+ tags?: JSDocTagInfo[];
745
+ codeActions?: CodeAction[];
746
+ /** @deprecated Use `sourceDisplay` instead. */
747
+ source?: SymbolDisplayPart[];
748
+ sourceDisplay?: SymbolDisplayPart[];
749
+ }
750
+ export interface DocCommentTemplateOptions {
751
+ readonly generateReturnInDocTemplate?: boolean;
752
+ }
753
+ export interface TextInsertion {
754
+ newText: string;
755
+ /** The position in newText the caret should point to after the insertion. */
756
+ caretOffset: number;
757
+ }
758
+ export interface JSDocLinkDisplayPart extends SymbolDisplayPart {
759
+ target: DocumentSpan;
760
+ }
761
+ export interface IncompleteCompletionsCache {
762
+ get(): CompletionInfo | undefined;
763
+ set(response: CompletionInfo): void;
764
+ clear(): void;
765
+ }
766
+ export declare const enum EndOfLineState {
767
+ None = 0,
768
+ InMultiLineCommentTrivia = 1,
769
+ InSingleQuoteStringLiteral = 2,
770
+ InDoubleQuoteStringLiteral = 3,
771
+ InTemplateHeadOrNoSubstitutionTemplate = 4,
772
+ InTemplateMiddleOrTail = 5,
773
+ InTemplateSubstitutionPosition = 6
774
+ }
775
+ export declare enum TokenClass {
776
+ Punctuation = 0,
777
+ Keyword = 1,
778
+ Operator = 2,
779
+ Comment = 3,
780
+ Whitespace = 4,
781
+ Identifier = 5,
782
+ NumberLiteral = 6,
783
+ BigIntLiteral = 7,
784
+ StringLiteral = 8,
785
+ RegExpLiteral = 9
786
+ }
787
+ export interface ClassificationResult {
788
+ finalLexState: EndOfLineState;
789
+ entries: ClassificationInfo[];
790
+ }
791
+ export interface ClassificationInfo {
792
+ length: number;
793
+ classification: TokenClass;
794
+ }
795
+ export interface Classifier {
796
+ /**
797
+ * Gives lexical classifications of tokens on a line without any syntactic context.
798
+ * For instance, a token consisting of the text 'string' can be either an identifier
799
+ * named 'string' or the keyword 'string', however, because this classifier is not aware,
800
+ * it relies on certain heuristics to give acceptable results. For classifications where
801
+ * speed trumps accuracy, this function is preferable; however, for true accuracy, the
802
+ * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the
803
+ * lexical, syntactic, and semantic classifiers may issue the best user experience.
804
+ *
805
+ * @param text The text of a line to classify.
806
+ * @param lexState The state of the lexical classifier at the end of the previous line.
807
+ * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier.
808
+ * If there is no syntactic classifier (syntacticClassifierAbsent=true),
809
+ * certain heuristics may be used in its place; however, if there is a
810
+ * syntactic classifier (syntacticClassifierAbsent=false), certain
811
+ * classifications which may be incorrectly categorized will be given
812
+ * back as Identifiers in order to allow the syntactic classifier to
813
+ * subsume the classification.
814
+ * @deprecated Use getLexicalClassifications instead.
815
+ */
816
+ getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
817
+ getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
818
+ }
819
+ export interface Classifications {
820
+ spans: number[];
821
+ endOfLineState: EndOfLineState;
822
+ }
823
+ export interface ClassifiedSpan2020 {
824
+ textSpan: TextSpan;
825
+ classificationType: number;
826
+ }
827
+ export type SignatureHelpTriggerCharacter = "," | "(" | "<";
828
+ export type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
829
+ export interface SignatureHelpItemsOptions {
830
+ triggerReason?: SignatureHelpTriggerReason;
831
+ }
832
+ export type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
833
+ /**
834
+ * Signals that the user manually requested signature help.
835
+ * The language service will unconditionally attempt to provide a result.
836
+ */
837
+ export interface SignatureHelpInvokedReason {
838
+ kind: "invoked";
839
+ triggerCharacter?: undefined;
840
+ }
841
+ /**
842
+ * Signals that the signature help request came from a user typing a character.
843
+ * Depending on the character and the syntactic context, the request may or may not be served a result.
844
+ */
845
+ export interface SignatureHelpCharacterTypedReason {
846
+ kind: "characterTyped";
847
+ /**
848
+ * Character that was responsible for triggering signature help.
849
+ */
850
+ triggerCharacter: SignatureHelpTriggerCharacter;
851
+ }
852
+ /**
853
+ * Signals that this signature help request came from typing a character or moving the cursor.
854
+ * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
855
+ * The language service will unconditionally attempt to provide a result.
856
+ * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
857
+ */
858
+ export interface SignatureHelpRetriggeredReason {
859
+ kind: "retrigger";
860
+ /**
861
+ * Character that was responsible for triggering signature help.
862
+ */
863
+ triggerCharacter?: SignatureHelpRetriggerCharacter;
864
+ }
865
+ /**
866
+ * Signature help information for a single parameter
867
+ */
868
+ export interface SignatureHelpParameter {
869
+ name: string;
870
+ documentation: SymbolDisplayPart[];
871
+ displayParts: SymbolDisplayPart[];
872
+ isOptional: boolean;
873
+ isRest?: boolean;
874
+ }
875
+ /**
876
+ * Represents a single signature to show in signature help.
877
+ * The id is used for subsequent calls into the language service to ask questions about the
878
+ * signature help item in the context of any documents that have been updated. i.e. after
879
+ * an edit has happened, while signature help is still active, the host can ask important
880
+ * questions like 'what parameter is the user currently contained within?'.
881
+ */
882
+ export interface SignatureHelpItem {
883
+ isVariadic: boolean;
884
+ prefixDisplayParts: SymbolDisplayPart[];
885
+ suffixDisplayParts: SymbolDisplayPart[];
886
+ separatorDisplayParts: SymbolDisplayPart[];
887
+ parameters: SignatureHelpParameter[];
888
+ documentation: SymbolDisplayPart[];
889
+ tags: JSDocTagInfo[];
890
+ }
891
+ /**
892
+ * Represents a set of signature help items, and the preferred item that should be selected.
893
+ */
894
+ export interface SignatureHelpItems {
895
+ items: SignatureHelpItem[];
896
+ applicableSpan: TextSpan;
897
+ selectedItemIndex: number;
898
+ argumentIndex: number;
899
+ argumentCount: number;
900
+ }
901
+ //# sourceMappingURL=types.d.ts.map