@microsoft/api-extractor 7.56.3 → 7.57.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 (299) hide show
  1. package/CHANGELOG.json +58 -0
  2. package/CHANGELOG.md +15 -1
  3. package/bin/api-extractor +1 -1
  4. package/dist/tsdoc-metadata.json +1 -1
  5. package/lib-esm/aedoc/PackageDocComment.js +56 -0
  6. package/lib-esm/aedoc/PackageDocComment.js.map +1 -0
  7. package/lib-esm/analyzer/AstDeclaration.js +214 -0
  8. package/lib-esm/analyzer/AstDeclaration.js.map +1 -0
  9. package/lib-esm/analyzer/AstEntity.js +35 -0
  10. package/lib-esm/analyzer/AstEntity.js.map +1 -0
  11. package/lib-esm/analyzer/AstImport.js +76 -0
  12. package/lib-esm/analyzer/AstImport.js.map +1 -0
  13. package/lib-esm/analyzer/AstModule.js +22 -0
  14. package/lib-esm/analyzer/AstModule.js.map +1 -0
  15. package/lib-esm/analyzer/AstNamespaceExport.js +38 -0
  16. package/lib-esm/analyzer/AstNamespaceExport.js.map +1 -0
  17. package/lib-esm/analyzer/AstNamespaceImport.js +57 -0
  18. package/lib-esm/analyzer/AstNamespaceImport.js.map +1 -0
  19. package/lib-esm/analyzer/AstReferenceResolver.js +202 -0
  20. package/lib-esm/analyzer/AstReferenceResolver.js.map +1 -0
  21. package/lib-esm/analyzer/AstSymbol.js +104 -0
  22. package/lib-esm/analyzer/AstSymbol.js.map +1 -0
  23. package/lib-esm/analyzer/AstSymbolTable.js +524 -0
  24. package/lib-esm/analyzer/AstSymbolTable.js.map +1 -0
  25. package/lib-esm/analyzer/ExportAnalyzer.js +725 -0
  26. package/lib-esm/analyzer/ExportAnalyzer.js.map +1 -0
  27. package/lib-esm/analyzer/PackageMetadataManager.js +235 -0
  28. package/lib-esm/analyzer/PackageMetadataManager.js.map +1 -0
  29. package/lib-esm/analyzer/SourceFileLocationFormatter.js +44 -0
  30. package/lib-esm/analyzer/SourceFileLocationFormatter.js.map +1 -0
  31. package/lib-esm/analyzer/Span.js +545 -0
  32. package/lib-esm/analyzer/Span.js.map +1 -0
  33. package/lib-esm/analyzer/SyntaxHelpers.js +72 -0
  34. package/lib-esm/analyzer/SyntaxHelpers.js.map +1 -0
  35. package/lib-esm/analyzer/TypeScriptHelpers.js +242 -0
  36. package/lib-esm/analyzer/TypeScriptHelpers.js.map +1 -0
  37. package/lib-esm/analyzer/TypeScriptInternals.js +114 -0
  38. package/lib-esm/analyzer/TypeScriptInternals.js.map +1 -0
  39. package/lib-esm/api/CompilerState.js +149 -0
  40. package/lib-esm/api/CompilerState.js.map +1 -0
  41. package/lib-esm/api/ConsoleMessageId.js +82 -0
  42. package/lib-esm/api/ConsoleMessageId.js.map +1 -0
  43. package/lib-esm/api/Extractor.js +290 -0
  44. package/lib-esm/api/Extractor.js.map +1 -0
  45. package/lib-esm/api/ExtractorConfig.js +801 -0
  46. package/lib-esm/api/ExtractorConfig.js.map +1 -0
  47. package/lib-esm/api/ExtractorLogLevel.js +46 -0
  48. package/lib-esm/api/ExtractorLogLevel.js.map +1 -0
  49. package/lib-esm/api/ExtractorMessage.js +140 -0
  50. package/lib-esm/api/ExtractorMessage.js.map +1 -0
  51. package/lib-esm/api/ExtractorMessageId.js +128 -0
  52. package/lib-esm/api/ExtractorMessageId.js.map +1 -0
  53. package/lib-esm/api/IConfigFile.js +4 -0
  54. package/lib-esm/api/IConfigFile.js.map +1 -0
  55. package/lib-esm/cli/ApiExtractorCommandLine.js +51 -0
  56. package/lib-esm/cli/ApiExtractorCommandLine.js.map +1 -0
  57. package/lib-esm/cli/InitAction.js +35 -0
  58. package/lib-esm/cli/InitAction.js.map +1 -0
  59. package/lib-esm/cli/RunAction.js +123 -0
  60. package/lib-esm/cli/RunAction.js.map +1 -0
  61. package/lib-esm/collector/ApiItemMetadata.js +55 -0
  62. package/lib-esm/collector/ApiItemMetadata.js.map +1 -0
  63. package/lib-esm/collector/Collector.js +794 -0
  64. package/lib-esm/collector/Collector.js.map +1 -0
  65. package/lib-esm/collector/CollectorEntity.js +219 -0
  66. package/lib-esm/collector/CollectorEntity.js.map +1 -0
  67. package/lib-esm/collector/DeclarationMetadata.js +24 -0
  68. package/lib-esm/collector/DeclarationMetadata.js.map +1 -0
  69. package/lib-esm/collector/MessageRouter.js +476 -0
  70. package/lib-esm/collector/MessageRouter.js.map +1 -0
  71. package/lib-esm/collector/SourceMapper.js +171 -0
  72. package/lib-esm/collector/SourceMapper.js.map +1 -0
  73. package/lib-esm/collector/SymbolMetadata.js +12 -0
  74. package/lib-esm/collector/SymbolMetadata.js.map +1 -0
  75. package/lib-esm/collector/VisitorState.js +23 -0
  76. package/lib-esm/collector/VisitorState.js.map +1 -0
  77. package/lib-esm/collector/WorkingPackage.js +30 -0
  78. package/lib-esm/collector/WorkingPackage.js.map +1 -0
  79. package/lib-esm/enhancers/DocCommentEnhancer.js +213 -0
  80. package/lib-esm/enhancers/DocCommentEnhancer.js.map +1 -0
  81. package/lib-esm/enhancers/ValidationEnhancer.js +217 -0
  82. package/lib-esm/enhancers/ValidationEnhancer.js.map +1 -0
  83. package/lib-esm/generators/ApiModelGenerator.js +852 -0
  84. package/lib-esm/generators/ApiModelGenerator.js.map +1 -0
  85. package/lib-esm/generators/ApiReportGenerator.js +518 -0
  86. package/lib-esm/generators/ApiReportGenerator.js.map +1 -0
  87. package/lib-esm/generators/DeclarationReferenceGenerator.js +292 -0
  88. package/lib-esm/generators/DeclarationReferenceGenerator.js.map +1 -0
  89. package/lib-esm/generators/DtsEmitHelpers.js +227 -0
  90. package/lib-esm/generators/DtsEmitHelpers.js.map +1 -0
  91. package/lib-esm/generators/DtsRollupGenerator.js +391 -0
  92. package/lib-esm/generators/DtsRollupGenerator.js.map +1 -0
  93. package/lib-esm/generators/ExcerptBuilder.js +259 -0
  94. package/lib-esm/generators/ExcerptBuilder.js.map +1 -0
  95. package/lib-esm/generators/IndentedWriter.js +238 -0
  96. package/lib-esm/generators/IndentedWriter.js.map +1 -0
  97. package/lib-esm/index.js +17 -0
  98. package/lib-esm/index.js.map +1 -0
  99. package/lib-esm/schemas/api-extractor-defaults.json +94 -0
  100. package/lib-esm/schemas/api-extractor-template.json +454 -0
  101. package/lib-esm/schemas/api-extractor.schema.json +257 -0
  102. package/lib-esm/start.js +14 -0
  103. package/lib-esm/start.js.map +1 -0
  104. package/package.json +37 -9
  105. /package/{lib → lib-commonjs}/aedoc/PackageDocComment.js +0 -0
  106. /package/{lib → lib-commonjs}/aedoc/PackageDocComment.js.map +0 -0
  107. /package/{lib → lib-commonjs}/analyzer/AstDeclaration.js +0 -0
  108. /package/{lib → lib-commonjs}/analyzer/AstDeclaration.js.map +0 -0
  109. /package/{lib → lib-commonjs}/analyzer/AstEntity.js +0 -0
  110. /package/{lib → lib-commonjs}/analyzer/AstEntity.js.map +0 -0
  111. /package/{lib → lib-commonjs}/analyzer/AstImport.js +0 -0
  112. /package/{lib → lib-commonjs}/analyzer/AstImport.js.map +0 -0
  113. /package/{lib → lib-commonjs}/analyzer/AstModule.js +0 -0
  114. /package/{lib → lib-commonjs}/analyzer/AstModule.js.map +0 -0
  115. /package/{lib → lib-commonjs}/analyzer/AstNamespaceExport.js +0 -0
  116. /package/{lib → lib-commonjs}/analyzer/AstNamespaceExport.js.map +0 -0
  117. /package/{lib → lib-commonjs}/analyzer/AstNamespaceImport.js +0 -0
  118. /package/{lib → lib-commonjs}/analyzer/AstNamespaceImport.js.map +0 -0
  119. /package/{lib → lib-commonjs}/analyzer/AstReferenceResolver.js +0 -0
  120. /package/{lib → lib-commonjs}/analyzer/AstReferenceResolver.js.map +0 -0
  121. /package/{lib → lib-commonjs}/analyzer/AstSymbol.js +0 -0
  122. /package/{lib → lib-commonjs}/analyzer/AstSymbol.js.map +0 -0
  123. /package/{lib → lib-commonjs}/analyzer/AstSymbolTable.js +0 -0
  124. /package/{lib → lib-commonjs}/analyzer/AstSymbolTable.js.map +0 -0
  125. /package/{lib → lib-commonjs}/analyzer/ExportAnalyzer.js +0 -0
  126. /package/{lib → lib-commonjs}/analyzer/ExportAnalyzer.js.map +0 -0
  127. /package/{lib → lib-commonjs}/analyzer/PackageMetadataManager.js +0 -0
  128. /package/{lib → lib-commonjs}/analyzer/PackageMetadataManager.js.map +0 -0
  129. /package/{lib → lib-commonjs}/analyzer/SourceFileLocationFormatter.js +0 -0
  130. /package/{lib → lib-commonjs}/analyzer/SourceFileLocationFormatter.js.map +0 -0
  131. /package/{lib → lib-commonjs}/analyzer/Span.js +0 -0
  132. /package/{lib → lib-commonjs}/analyzer/Span.js.map +0 -0
  133. /package/{lib → lib-commonjs}/analyzer/SyntaxHelpers.js +0 -0
  134. /package/{lib → lib-commonjs}/analyzer/SyntaxHelpers.js.map +0 -0
  135. /package/{lib → lib-commonjs}/analyzer/TypeScriptHelpers.js +0 -0
  136. /package/{lib → lib-commonjs}/analyzer/TypeScriptHelpers.js.map +0 -0
  137. /package/{lib → lib-commonjs}/analyzer/TypeScriptInternals.js +0 -0
  138. /package/{lib → lib-commonjs}/analyzer/TypeScriptInternals.js.map +0 -0
  139. /package/{lib → lib-commonjs}/api/CompilerState.js +0 -0
  140. /package/{lib → lib-commonjs}/api/CompilerState.js.map +0 -0
  141. /package/{lib → lib-commonjs}/api/ConsoleMessageId.js +0 -0
  142. /package/{lib → lib-commonjs}/api/ConsoleMessageId.js.map +0 -0
  143. /package/{lib → lib-commonjs}/api/Extractor.js +0 -0
  144. /package/{lib → lib-commonjs}/api/Extractor.js.map +0 -0
  145. /package/{lib → lib-commonjs}/api/ExtractorConfig.js +0 -0
  146. /package/{lib → lib-commonjs}/api/ExtractorConfig.js.map +0 -0
  147. /package/{lib → lib-commonjs}/api/ExtractorLogLevel.js +0 -0
  148. /package/{lib → lib-commonjs}/api/ExtractorLogLevel.js.map +0 -0
  149. /package/{lib → lib-commonjs}/api/ExtractorMessage.js +0 -0
  150. /package/{lib → lib-commonjs}/api/ExtractorMessage.js.map +0 -0
  151. /package/{lib → lib-commonjs}/api/ExtractorMessageId.js +0 -0
  152. /package/{lib → lib-commonjs}/api/ExtractorMessageId.js.map +0 -0
  153. /package/{lib → lib-commonjs}/api/IConfigFile.js +0 -0
  154. /package/{lib → lib-commonjs}/api/IConfigFile.js.map +0 -0
  155. /package/{lib → lib-commonjs}/cli/ApiExtractorCommandLine.js +0 -0
  156. /package/{lib → lib-commonjs}/cli/ApiExtractorCommandLine.js.map +0 -0
  157. /package/{lib → lib-commonjs}/cli/InitAction.js +0 -0
  158. /package/{lib → lib-commonjs}/cli/InitAction.js.map +0 -0
  159. /package/{lib → lib-commonjs}/cli/RunAction.js +0 -0
  160. /package/{lib → lib-commonjs}/cli/RunAction.js.map +0 -0
  161. /package/{lib → lib-commonjs}/collector/ApiItemMetadata.js +0 -0
  162. /package/{lib → lib-commonjs}/collector/ApiItemMetadata.js.map +0 -0
  163. /package/{lib → lib-commonjs}/collector/Collector.js +0 -0
  164. /package/{lib → lib-commonjs}/collector/Collector.js.map +0 -0
  165. /package/{lib → lib-commonjs}/collector/CollectorEntity.js +0 -0
  166. /package/{lib → lib-commonjs}/collector/CollectorEntity.js.map +0 -0
  167. /package/{lib → lib-commonjs}/collector/DeclarationMetadata.js +0 -0
  168. /package/{lib → lib-commonjs}/collector/DeclarationMetadata.js.map +0 -0
  169. /package/{lib → lib-commonjs}/collector/MessageRouter.js +0 -0
  170. /package/{lib → lib-commonjs}/collector/MessageRouter.js.map +0 -0
  171. /package/{lib → lib-commonjs}/collector/SourceMapper.js +0 -0
  172. /package/{lib → lib-commonjs}/collector/SourceMapper.js.map +0 -0
  173. /package/{lib → lib-commonjs}/collector/SymbolMetadata.js +0 -0
  174. /package/{lib → lib-commonjs}/collector/SymbolMetadata.js.map +0 -0
  175. /package/{lib → lib-commonjs}/collector/VisitorState.js +0 -0
  176. /package/{lib → lib-commonjs}/collector/VisitorState.js.map +0 -0
  177. /package/{lib → lib-commonjs}/collector/WorkingPackage.js +0 -0
  178. /package/{lib → lib-commonjs}/collector/WorkingPackage.js.map +0 -0
  179. /package/{lib → lib-commonjs}/enhancers/DocCommentEnhancer.js +0 -0
  180. /package/{lib → lib-commonjs}/enhancers/DocCommentEnhancer.js.map +0 -0
  181. /package/{lib → lib-commonjs}/enhancers/ValidationEnhancer.js +0 -0
  182. /package/{lib → lib-commonjs}/enhancers/ValidationEnhancer.js.map +0 -0
  183. /package/{lib → lib-commonjs}/generators/ApiModelGenerator.js +0 -0
  184. /package/{lib → lib-commonjs}/generators/ApiModelGenerator.js.map +0 -0
  185. /package/{lib → lib-commonjs}/generators/ApiReportGenerator.js +0 -0
  186. /package/{lib → lib-commonjs}/generators/ApiReportGenerator.js.map +0 -0
  187. /package/{lib → lib-commonjs}/generators/DeclarationReferenceGenerator.js +0 -0
  188. /package/{lib → lib-commonjs}/generators/DeclarationReferenceGenerator.js.map +0 -0
  189. /package/{lib → lib-commonjs}/generators/DtsEmitHelpers.js +0 -0
  190. /package/{lib → lib-commonjs}/generators/DtsEmitHelpers.js.map +0 -0
  191. /package/{lib → lib-commonjs}/generators/DtsRollupGenerator.js +0 -0
  192. /package/{lib → lib-commonjs}/generators/DtsRollupGenerator.js.map +0 -0
  193. /package/{lib → lib-commonjs}/generators/ExcerptBuilder.js +0 -0
  194. /package/{lib → lib-commonjs}/generators/ExcerptBuilder.js.map +0 -0
  195. /package/{lib → lib-commonjs}/generators/IndentedWriter.js +0 -0
  196. /package/{lib → lib-commonjs}/generators/IndentedWriter.js.map +0 -0
  197. /package/{lib → lib-commonjs}/index.js +0 -0
  198. /package/{lib → lib-commonjs}/index.js.map +0 -0
  199. /package/{lib → lib-commonjs}/schemas/api-extractor-defaults.json +0 -0
  200. /package/{lib → lib-commonjs}/schemas/api-extractor-template.json +0 -0
  201. /package/{lib → lib-commonjs}/schemas/api-extractor.schema.json +0 -0
  202. /package/{lib → lib-commonjs}/start.js +0 -0
  203. /package/{lib → lib-commonjs}/start.js.map +0 -0
  204. /package/{lib → lib-dts}/aedoc/PackageDocComment.d.ts +0 -0
  205. /package/{lib → lib-dts}/aedoc/PackageDocComment.d.ts.map +0 -0
  206. /package/{lib → lib-dts}/analyzer/AstDeclaration.d.ts +0 -0
  207. /package/{lib → lib-dts}/analyzer/AstDeclaration.d.ts.map +0 -0
  208. /package/{lib → lib-dts}/analyzer/AstEntity.d.ts +0 -0
  209. /package/{lib → lib-dts}/analyzer/AstEntity.d.ts.map +0 -0
  210. /package/{lib → lib-dts}/analyzer/AstImport.d.ts +0 -0
  211. /package/{lib → lib-dts}/analyzer/AstImport.d.ts.map +0 -0
  212. /package/{lib → lib-dts}/analyzer/AstModule.d.ts +0 -0
  213. /package/{lib → lib-dts}/analyzer/AstModule.d.ts.map +0 -0
  214. /package/{lib → lib-dts}/analyzer/AstNamespaceExport.d.ts +0 -0
  215. /package/{lib → lib-dts}/analyzer/AstNamespaceExport.d.ts.map +0 -0
  216. /package/{lib → lib-dts}/analyzer/AstNamespaceImport.d.ts +0 -0
  217. /package/{lib → lib-dts}/analyzer/AstNamespaceImport.d.ts.map +0 -0
  218. /package/{lib → lib-dts}/analyzer/AstReferenceResolver.d.ts +0 -0
  219. /package/{lib → lib-dts}/analyzer/AstReferenceResolver.d.ts.map +0 -0
  220. /package/{lib → lib-dts}/analyzer/AstSymbol.d.ts +0 -0
  221. /package/{lib → lib-dts}/analyzer/AstSymbol.d.ts.map +0 -0
  222. /package/{lib → lib-dts}/analyzer/AstSymbolTable.d.ts +0 -0
  223. /package/{lib → lib-dts}/analyzer/AstSymbolTable.d.ts.map +0 -0
  224. /package/{lib → lib-dts}/analyzer/ExportAnalyzer.d.ts +0 -0
  225. /package/{lib → lib-dts}/analyzer/ExportAnalyzer.d.ts.map +0 -0
  226. /package/{lib → lib-dts}/analyzer/PackageMetadataManager.d.ts +0 -0
  227. /package/{lib → lib-dts}/analyzer/PackageMetadataManager.d.ts.map +0 -0
  228. /package/{lib → lib-dts}/analyzer/SourceFileLocationFormatter.d.ts +0 -0
  229. /package/{lib → lib-dts}/analyzer/SourceFileLocationFormatter.d.ts.map +0 -0
  230. /package/{lib → lib-dts}/analyzer/Span.d.ts +0 -0
  231. /package/{lib → lib-dts}/analyzer/Span.d.ts.map +0 -0
  232. /package/{lib → lib-dts}/analyzer/SyntaxHelpers.d.ts +0 -0
  233. /package/{lib → lib-dts}/analyzer/SyntaxHelpers.d.ts.map +0 -0
  234. /package/{lib → lib-dts}/analyzer/TypeScriptHelpers.d.ts +0 -0
  235. /package/{lib → lib-dts}/analyzer/TypeScriptHelpers.d.ts.map +0 -0
  236. /package/{lib → lib-dts}/analyzer/TypeScriptInternals.d.ts +0 -0
  237. /package/{lib → lib-dts}/analyzer/TypeScriptInternals.d.ts.map +0 -0
  238. /package/{lib → lib-dts}/api/CompilerState.d.ts +0 -0
  239. /package/{lib → lib-dts}/api/CompilerState.d.ts.map +0 -0
  240. /package/{lib → lib-dts}/api/ConsoleMessageId.d.ts +0 -0
  241. /package/{lib → lib-dts}/api/ConsoleMessageId.d.ts.map +0 -0
  242. /package/{lib → lib-dts}/api/Extractor.d.ts +0 -0
  243. /package/{lib → lib-dts}/api/Extractor.d.ts.map +0 -0
  244. /package/{lib → lib-dts}/api/ExtractorConfig.d.ts +0 -0
  245. /package/{lib → lib-dts}/api/ExtractorConfig.d.ts.map +0 -0
  246. /package/{lib → lib-dts}/api/ExtractorLogLevel.d.ts +0 -0
  247. /package/{lib → lib-dts}/api/ExtractorLogLevel.d.ts.map +0 -0
  248. /package/{lib → lib-dts}/api/ExtractorMessage.d.ts +0 -0
  249. /package/{lib → lib-dts}/api/ExtractorMessage.d.ts.map +0 -0
  250. /package/{lib → lib-dts}/api/ExtractorMessageId.d.ts +0 -0
  251. /package/{lib → lib-dts}/api/ExtractorMessageId.d.ts.map +0 -0
  252. /package/{lib → lib-dts}/api/IConfigFile.d.ts +0 -0
  253. /package/{lib → lib-dts}/api/IConfigFile.d.ts.map +0 -0
  254. /package/{lib → lib-dts}/cli/ApiExtractorCommandLine.d.ts +0 -0
  255. /package/{lib → lib-dts}/cli/ApiExtractorCommandLine.d.ts.map +0 -0
  256. /package/{lib → lib-dts}/cli/InitAction.d.ts +0 -0
  257. /package/{lib → lib-dts}/cli/InitAction.d.ts.map +0 -0
  258. /package/{lib → lib-dts}/cli/RunAction.d.ts +0 -0
  259. /package/{lib → lib-dts}/cli/RunAction.d.ts.map +0 -0
  260. /package/{lib → lib-dts}/collector/ApiItemMetadata.d.ts +0 -0
  261. /package/{lib → lib-dts}/collector/ApiItemMetadata.d.ts.map +0 -0
  262. /package/{lib → lib-dts}/collector/Collector.d.ts +0 -0
  263. /package/{lib → lib-dts}/collector/Collector.d.ts.map +0 -0
  264. /package/{lib → lib-dts}/collector/CollectorEntity.d.ts +0 -0
  265. /package/{lib → lib-dts}/collector/CollectorEntity.d.ts.map +0 -0
  266. /package/{lib → lib-dts}/collector/DeclarationMetadata.d.ts +0 -0
  267. /package/{lib → lib-dts}/collector/DeclarationMetadata.d.ts.map +0 -0
  268. /package/{lib → lib-dts}/collector/MessageRouter.d.ts +0 -0
  269. /package/{lib → lib-dts}/collector/MessageRouter.d.ts.map +0 -0
  270. /package/{lib → lib-dts}/collector/SourceMapper.d.ts +0 -0
  271. /package/{lib → lib-dts}/collector/SourceMapper.d.ts.map +0 -0
  272. /package/{lib → lib-dts}/collector/SymbolMetadata.d.ts +0 -0
  273. /package/{lib → lib-dts}/collector/SymbolMetadata.d.ts.map +0 -0
  274. /package/{lib → lib-dts}/collector/VisitorState.d.ts +0 -0
  275. /package/{lib → lib-dts}/collector/VisitorState.d.ts.map +0 -0
  276. /package/{lib → lib-dts}/collector/WorkingPackage.d.ts +0 -0
  277. /package/{lib → lib-dts}/collector/WorkingPackage.d.ts.map +0 -0
  278. /package/{lib → lib-dts}/enhancers/DocCommentEnhancer.d.ts +0 -0
  279. /package/{lib → lib-dts}/enhancers/DocCommentEnhancer.d.ts.map +0 -0
  280. /package/{lib → lib-dts}/enhancers/ValidationEnhancer.d.ts +0 -0
  281. /package/{lib → lib-dts}/enhancers/ValidationEnhancer.d.ts.map +0 -0
  282. /package/{lib → lib-dts}/generators/ApiModelGenerator.d.ts +0 -0
  283. /package/{lib → lib-dts}/generators/ApiModelGenerator.d.ts.map +0 -0
  284. /package/{lib → lib-dts}/generators/ApiReportGenerator.d.ts +0 -0
  285. /package/{lib → lib-dts}/generators/ApiReportGenerator.d.ts.map +0 -0
  286. /package/{lib → lib-dts}/generators/DeclarationReferenceGenerator.d.ts +0 -0
  287. /package/{lib → lib-dts}/generators/DeclarationReferenceGenerator.d.ts.map +0 -0
  288. /package/{lib → lib-dts}/generators/DtsEmitHelpers.d.ts +0 -0
  289. /package/{lib → lib-dts}/generators/DtsEmitHelpers.d.ts.map +0 -0
  290. /package/{lib → lib-dts}/generators/DtsRollupGenerator.d.ts +0 -0
  291. /package/{lib → lib-dts}/generators/DtsRollupGenerator.d.ts.map +0 -0
  292. /package/{lib → lib-dts}/generators/ExcerptBuilder.d.ts +0 -0
  293. /package/{lib → lib-dts}/generators/ExcerptBuilder.d.ts.map +0 -0
  294. /package/{lib → lib-dts}/generators/IndentedWriter.d.ts +0 -0
  295. /package/{lib → lib-dts}/generators/IndentedWriter.d.ts.map +0 -0
  296. /package/{lib → lib-dts}/index.d.ts +0 -0
  297. /package/{lib → lib-dts}/index.d.ts.map +0 -0
  298. /package/{lib → lib-dts}/start.d.ts +0 -0
  299. /package/{lib → lib-dts}/start.d.ts.map +0 -0
@@ -0,0 +1,545 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import * as ts from 'typescript';
4
+ import { InternalError, Sort, Text } from '@rushstack/node-core-library';
5
+ import { IndentedWriter } from '../generators/IndentedWriter';
6
+ var IndentDocCommentState;
7
+ (function (IndentDocCommentState) {
8
+ /**
9
+ * `indentDocComment` was not requested for this subtree.
10
+ */
11
+ IndentDocCommentState[IndentDocCommentState["Inactive"] = 0] = "Inactive";
12
+ /**
13
+ * `indentDocComment` was requested and we are looking for the opening `/` `*`
14
+ */
15
+ IndentDocCommentState[IndentDocCommentState["AwaitingOpenDelimiter"] = 1] = "AwaitingOpenDelimiter";
16
+ /**
17
+ * `indentDocComment` was requested and we are looking for the closing `*` `/`
18
+ */
19
+ IndentDocCommentState[IndentDocCommentState["AwaitingCloseDelimiter"] = 2] = "AwaitingCloseDelimiter";
20
+ /**
21
+ * `indentDocComment` was requested and we have finished indenting the comment.
22
+ */
23
+ IndentDocCommentState[IndentDocCommentState["Done"] = 3] = "Done";
24
+ })(IndentDocCommentState || (IndentDocCommentState = {}));
25
+ /**
26
+ * Choices for SpanModification.indentDocComment.
27
+ */
28
+ export var IndentDocCommentScope;
29
+ (function (IndentDocCommentScope) {
30
+ /**
31
+ * Do not detect and indent comments.
32
+ */
33
+ IndentDocCommentScope[IndentDocCommentScope["None"] = 0] = "None";
34
+ /**
35
+ * Look for one doc comment in the {@link Span.prefix} text only.
36
+ */
37
+ IndentDocCommentScope[IndentDocCommentScope["PrefixOnly"] = 1] = "PrefixOnly";
38
+ /**
39
+ * Look for one doc comment potentially distributed across the Span and its children.
40
+ */
41
+ IndentDocCommentScope[IndentDocCommentScope["SpanAndChildren"] = 2] = "SpanAndChildren";
42
+ })(IndentDocCommentScope || (IndentDocCommentScope = {}));
43
+ /**
44
+ * Specifies various transformations that will be performed by Span.getModifiedText().
45
+ */
46
+ export class SpanModification {
47
+ constructor(span) {
48
+ /**
49
+ * If true, all of the child spans will be omitted from the Span.getModifiedText() output.
50
+ * @remarks
51
+ * Also, the modify() operation will not recurse into these spans.
52
+ */
53
+ this.omitChildren = false;
54
+ /**
55
+ * If true, then the Span.separator will be removed from the Span.getModifiedText() output.
56
+ */
57
+ this.omitSeparatorAfter = false;
58
+ /**
59
+ * If true, then Span.getModifiedText() will sort the immediate children according to their Span.sortKey
60
+ * property. The separators will also be fixed up to ensure correct indentation. If the Span.sortKey is undefined
61
+ * for some items, those items will not be moved, i.e. their array indexes will be unchanged.
62
+ */
63
+ this.sortChildren = false;
64
+ /**
65
+ * Optionally configures getModifiedText() to search for a "/*" doc comment and indent it.
66
+ * At most one comment is detected.
67
+ *
68
+ * @remarks
69
+ * The indentation can be applied to the `Span.modifier.prefix` only, or it can be applied to the
70
+ * full subtree of nodes (as needed for `ts.SyntaxKind.JSDocComment` trees). However the enabled
71
+ * scopes must not overlap.
72
+ *
73
+ * This feature is enabled selectively because (1) we do not want to accidentally match `/*` appearing
74
+ * in a string literal or other expression that is not a comment, and (2) parsing comments is relatively
75
+ * expensive.
76
+ */
77
+ this.indentDocComment = IndentDocCommentScope.None;
78
+ this._span = span;
79
+ this.reset();
80
+ }
81
+ /**
82
+ * Allows the Span.prefix text to be changed.
83
+ */
84
+ get prefix() {
85
+ return this._prefix !== undefined ? this._prefix : this._span.prefix;
86
+ }
87
+ set prefix(value) {
88
+ this._prefix = value;
89
+ }
90
+ /**
91
+ * Allows the Span.suffix text to be changed.
92
+ */
93
+ get suffix() {
94
+ return this._suffix !== undefined ? this._suffix : this._span.suffix;
95
+ }
96
+ set suffix(value) {
97
+ this._suffix = value;
98
+ }
99
+ /**
100
+ * Reverts any modifications made to this object.
101
+ */
102
+ reset() {
103
+ this.omitChildren = false;
104
+ this.omitSeparatorAfter = false;
105
+ this.sortChildren = false;
106
+ this.sortKey = undefined;
107
+ this._prefix = undefined;
108
+ this._suffix = undefined;
109
+ if (this._span.kind === ts.SyntaxKind.JSDocComment) {
110
+ this.indentDocComment = IndentDocCommentScope.SpanAndChildren;
111
+ }
112
+ }
113
+ /**
114
+ * Effectively deletes the Span from the tree, by skipping its children, skipping its separator,
115
+ * and setting its prefix/suffix to the empty string.
116
+ */
117
+ skipAll() {
118
+ this.prefix = '';
119
+ this.suffix = '';
120
+ this.omitChildren = true;
121
+ this.omitSeparatorAfter = true;
122
+ }
123
+ }
124
+ /**
125
+ * The Span class provides a simple way to rewrite TypeScript source files
126
+ * based on simple syntax transformations, i.e. without having to process deeper aspects
127
+ * of the underlying grammar. An example transformation might be deleting JSDoc comments
128
+ * from a source file.
129
+ *
130
+ * @remarks
131
+ * TypeScript's abstract syntax tree (AST) is represented using Node objects.
132
+ * The Node text ignores its surrounding whitespace, and does not have an ordering guarantee.
133
+ * For example, a JSDocComment node can be a child of a FunctionDeclaration node, even though
134
+ * the actual comment precedes the function in the input stream.
135
+ *
136
+ * The Span class is a wrapper for a single Node, that provides access to every character
137
+ * in the input stream, such that Span.getText() will exactly reproduce the corresponding
138
+ * full Node.getText() output.
139
+ *
140
+ * A Span is comprised of these parts, which appear in sequential order:
141
+ * - A prefix
142
+ * - A collection of child spans
143
+ * - A suffix
144
+ * - A separator (e.g. whitespace between this span and the next item in the tree)
145
+ *
146
+ * These parts can be modified via Span.modification. The modification is applied by
147
+ * calling Span.getModifiedText().
148
+ */
149
+ export class Span {
150
+ constructor(node) {
151
+ this.node = node;
152
+ this.startIndex = node.kind === ts.SyntaxKind.SourceFile ? node.getFullStart() : node.getStart();
153
+ this.endIndex = node.end;
154
+ this._separatorStartIndex = 0;
155
+ this._separatorEndIndex = 0;
156
+ this.children = [];
157
+ this.modification = new SpanModification(this);
158
+ let previousChildSpan = undefined;
159
+ for (const childNode of this.node.getChildren() || []) {
160
+ const childSpan = new Span(childNode);
161
+ childSpan._parent = this;
162
+ childSpan._previousSibling = previousChildSpan;
163
+ if (previousChildSpan) {
164
+ previousChildSpan._nextSibling = childSpan;
165
+ }
166
+ this.children.push(childSpan);
167
+ // Normalize the bounds so that a child is never outside its parent
168
+ if (childSpan.startIndex < this.startIndex) {
169
+ this.startIndex = childSpan.startIndex;
170
+ }
171
+ if (childSpan.endIndex > this.endIndex) {
172
+ // This has never been observed empirically, but here's how we would handle it
173
+ this.endIndex = childSpan.endIndex;
174
+ throw new InternalError('Unexpected AST case');
175
+ }
176
+ if (previousChildSpan) {
177
+ if (previousChildSpan.endIndex < childSpan.startIndex) {
178
+ // There is some leftover text after previous child -- assign it as the separator for
179
+ // the preceding span. If the preceding span has no suffix, then assign it to the
180
+ // deepest preceding span with no suffix. This heuristic simplifies the most
181
+ // common transformations, and otherwise it can be fished out using getLastInnerSeparator().
182
+ let separatorRecipient = previousChildSpan;
183
+ while (separatorRecipient.children.length > 0) {
184
+ const lastChild = separatorRecipient.children[separatorRecipient.children.length - 1];
185
+ if (lastChild.endIndex !== separatorRecipient.endIndex) {
186
+ // There is a suffix, so we cannot push the separator any further down, or else
187
+ // it would get printed before this suffix.
188
+ break;
189
+ }
190
+ separatorRecipient = lastChild;
191
+ }
192
+ separatorRecipient._separatorStartIndex = previousChildSpan.endIndex;
193
+ separatorRecipient._separatorEndIndex = childSpan.startIndex;
194
+ }
195
+ }
196
+ previousChildSpan = childSpan;
197
+ }
198
+ }
199
+ get kind() {
200
+ return this.node.kind;
201
+ }
202
+ /**
203
+ * The parent Span, if any.
204
+ * NOTE: This will be undefined for a root Span, even though the corresponding Node
205
+ * may have a parent in the AST.
206
+ */
207
+ get parent() {
208
+ return this._parent;
209
+ }
210
+ /**
211
+ * If the current object is this.parent.children[i], then previousSibling corresponds
212
+ * to this.parent.children[i-1] if it exists.
213
+ * NOTE: This will be undefined for a root Span, even though the corresponding Node
214
+ * may have a previous sibling in the AST.
215
+ */
216
+ get previousSibling() {
217
+ return this._previousSibling;
218
+ }
219
+ /**
220
+ * If the current object is this.parent.children[i], then previousSibling corresponds
221
+ * to this.parent.children[i+1] if it exists.
222
+ * NOTE: This will be undefined for a root Span, even though the corresponding Node
223
+ * may have a previous sibling in the AST.
224
+ */
225
+ get nextSibling() {
226
+ return this._nextSibling;
227
+ }
228
+ /**
229
+ * The text associated with the underlying Node, up to its first child.
230
+ */
231
+ get prefix() {
232
+ if (this.children.length) {
233
+ // Everything up to the first child
234
+ return this._getSubstring(this.startIndex, this.children[0].startIndex);
235
+ }
236
+ else {
237
+ return this._getSubstring(this.startIndex, this.endIndex);
238
+ }
239
+ }
240
+ /**
241
+ * The text associated with the underlying Node, after its last child.
242
+ * If there are no children, this is always an empty string.
243
+ */
244
+ get suffix() {
245
+ if (this.children.length) {
246
+ // Everything after the last child
247
+ return this._getSubstring(this.children[this.children.length - 1].endIndex, this.endIndex);
248
+ }
249
+ else {
250
+ return '';
251
+ }
252
+ }
253
+ /**
254
+ * Whitespace that appeared after this node, and before the "next" node in the tree.
255
+ * Here we mean "next" according to an inorder traversal, not necessarily a sibling.
256
+ */
257
+ get separator() {
258
+ return this._getSubstring(this._separatorStartIndex, this._separatorEndIndex);
259
+ }
260
+ /**
261
+ * Returns the separator of this Span, or else recursively calls getLastInnerSeparator()
262
+ * on the last child.
263
+ */
264
+ getLastInnerSeparator() {
265
+ if (this.separator) {
266
+ return this.separator;
267
+ }
268
+ if (this.children.length > 0) {
269
+ return this.children[this.children.length - 1].getLastInnerSeparator();
270
+ }
271
+ return '';
272
+ }
273
+ /**
274
+ * Returns the first parent node with the specified SyntaxKind, or undefined if there is no match.
275
+ */
276
+ findFirstParent(kindToMatch) {
277
+ let current = this;
278
+ while (current) {
279
+ if (current.kind === kindToMatch) {
280
+ return current;
281
+ }
282
+ current = current.parent;
283
+ }
284
+ return undefined;
285
+ }
286
+ /**
287
+ * Recursively invokes the callback on this Span and all its children. The callback
288
+ * can make changes to Span.modification for each node.
289
+ */
290
+ forEach(callback) {
291
+ callback(this);
292
+ for (const child of this.children) {
293
+ child.forEach(callback);
294
+ }
295
+ }
296
+ /**
297
+ * Returns the original unmodified text represented by this Span.
298
+ */
299
+ getText() {
300
+ let result = '';
301
+ result += this.prefix;
302
+ for (const child of this.children) {
303
+ result += child.getText();
304
+ }
305
+ result += this.suffix;
306
+ result += this.separator;
307
+ return result;
308
+ }
309
+ /**
310
+ * Returns the text represented by this Span, after applying all requested modifications.
311
+ */
312
+ getModifiedText() {
313
+ const writer = new IndentedWriter();
314
+ writer.trimLeadingSpaces = true;
315
+ this._writeModifiedText({
316
+ writer: writer,
317
+ separatorOverride: undefined,
318
+ indentDocCommentState: IndentDocCommentState.Inactive
319
+ });
320
+ return writer.getText();
321
+ }
322
+ writeModifiedText(output) {
323
+ this._writeModifiedText({
324
+ writer: output,
325
+ separatorOverride: undefined,
326
+ indentDocCommentState: IndentDocCommentState.Inactive
327
+ });
328
+ }
329
+ /**
330
+ * Returns a diagnostic dump of the tree, showing the prefix/suffix/separator for
331
+ * each node.
332
+ */
333
+ getDump(indent = '') {
334
+ let result = indent + ts.SyntaxKind[this.node.kind] + ': ';
335
+ if (this.prefix) {
336
+ result += ' pre=[' + this._getTrimmed(this.prefix) + ']';
337
+ }
338
+ if (this.suffix) {
339
+ result += ' suf=[' + this._getTrimmed(this.suffix) + ']';
340
+ }
341
+ if (this.separator) {
342
+ result += ' sep=[' + this._getTrimmed(this.separator) + ']';
343
+ }
344
+ result += '\n';
345
+ for (const child of this.children) {
346
+ result += child.getDump(indent + ' ');
347
+ }
348
+ return result;
349
+ }
350
+ /**
351
+ * Returns a diagnostic dump of the tree, showing the SpanModification settings for each nodde.
352
+ */
353
+ getModifiedDump(indent = '') {
354
+ let result = indent + ts.SyntaxKind[this.node.kind] + ': ';
355
+ if (this.prefix) {
356
+ result += ' pre=[' + this._getTrimmed(this.modification.prefix) + ']';
357
+ }
358
+ if (this.suffix) {
359
+ result += ' suf=[' + this._getTrimmed(this.modification.suffix) + ']';
360
+ }
361
+ if (this.separator) {
362
+ result += ' sep=[' + this._getTrimmed(this.separator) + ']';
363
+ }
364
+ if (this.modification.indentDocComment !== IndentDocCommentScope.None) {
365
+ result += ' indentDocComment=' + IndentDocCommentScope[this.modification.indentDocComment];
366
+ }
367
+ if (this.modification.omitChildren) {
368
+ result += ' omitChildren';
369
+ }
370
+ if (this.modification.omitSeparatorAfter) {
371
+ result += ' omitSeparatorAfter';
372
+ }
373
+ if (this.modification.sortChildren) {
374
+ result += ' sortChildren';
375
+ }
376
+ if (this.modification.sortKey !== undefined) {
377
+ result += ` sortKey="${this.modification.sortKey}"`;
378
+ }
379
+ result += '\n';
380
+ if (!this.modification.omitChildren) {
381
+ for (const child of this.children) {
382
+ result += child.getModifiedDump(indent + ' ');
383
+ }
384
+ }
385
+ else {
386
+ result += `${indent} (${this.children.length} children)\n`;
387
+ }
388
+ return result;
389
+ }
390
+ /**
391
+ * Recursive implementation of `getModifiedText()` and `writeModifiedText()`.
392
+ */
393
+ _writeModifiedText(options) {
394
+ // Apply indentation based on "{" and "}"
395
+ if (this.prefix === '{') {
396
+ options.writer.increaseIndent();
397
+ }
398
+ else if (this.prefix === '}') {
399
+ options.writer.decreaseIndent();
400
+ }
401
+ if (this.modification.indentDocComment !== IndentDocCommentScope.None) {
402
+ this._beginIndentDocComment(options);
403
+ }
404
+ this._write(this.modification.prefix, options);
405
+ if (this.modification.indentDocComment === IndentDocCommentScope.PrefixOnly) {
406
+ this._endIndentDocComment(options);
407
+ }
408
+ let sortedSubset;
409
+ if (!this.modification.omitChildren) {
410
+ if (this.modification.sortChildren) {
411
+ // We will only sort the items with a sortKey
412
+ const filtered = this.children.filter((x) => x.modification.sortKey !== undefined);
413
+ // Is there at least one of them?
414
+ if (filtered.length > 1) {
415
+ sortedSubset = filtered;
416
+ }
417
+ }
418
+ }
419
+ if (sortedSubset) {
420
+ // This is the complicated special case that sorts an arbitrary subset of the child nodes,
421
+ // preserving the surrounding nodes.
422
+ const sortedSubsetCount = sortedSubset.length;
423
+ // Remember the separator for the first and last ones
424
+ const firstSeparator = sortedSubset[0].getLastInnerSeparator();
425
+ const lastSeparator = sortedSubset[sortedSubsetCount - 1].getLastInnerSeparator();
426
+ Sort.sortBy(sortedSubset, (x) => x.modification.sortKey);
427
+ const childOptions = { ...options };
428
+ let sortedSubsetIndex = 0;
429
+ for (let index = 0; index < this.children.length; ++index) {
430
+ let current;
431
+ // Is this an item that we sorted?
432
+ if (this.children[index].modification.sortKey === undefined) {
433
+ // No, take the next item from the original array
434
+ current = this.children[index];
435
+ childOptions.separatorOverride = undefined;
436
+ }
437
+ else {
438
+ // Yes, take the next item from the sortedSubset
439
+ current = sortedSubset[sortedSubsetIndex++];
440
+ if (sortedSubsetIndex < sortedSubsetCount) {
441
+ childOptions.separatorOverride = firstSeparator;
442
+ }
443
+ else {
444
+ childOptions.separatorOverride = lastSeparator;
445
+ }
446
+ }
447
+ current._writeModifiedText(childOptions);
448
+ }
449
+ }
450
+ else {
451
+ // This is the normal case that does not need to sort children
452
+ const childrenLength = this.children.length;
453
+ if (!this.modification.omitChildren) {
454
+ if (options.separatorOverride !== undefined) {
455
+ // Special case where the separatorOverride is passed down to the "last inner separator" span
456
+ for (let i = 0; i < childrenLength; ++i) {
457
+ const child = this.children[i];
458
+ if (
459
+ // Only the last child inherits the separatorOverride, because only it can contain
460
+ // the "last inner separator" span
461
+ i < childrenLength - 1 ||
462
+ // If this.separator is specified, then we will write separatorOverride below, so don't pass it along
463
+ this.separator) {
464
+ const childOptions = { ...options };
465
+ childOptions.separatorOverride = undefined;
466
+ child._writeModifiedText(childOptions);
467
+ }
468
+ else {
469
+ child._writeModifiedText(options);
470
+ }
471
+ }
472
+ }
473
+ else {
474
+ // The normal simple case
475
+ for (const child of this.children) {
476
+ child._writeModifiedText(options);
477
+ }
478
+ }
479
+ }
480
+ this._write(this.modification.suffix, options);
481
+ if (options.separatorOverride !== undefined) {
482
+ if (this.separator || childrenLength === 0) {
483
+ this._write(options.separatorOverride, options);
484
+ }
485
+ }
486
+ else {
487
+ if (!this.modification.omitSeparatorAfter) {
488
+ this._write(this.separator, options);
489
+ }
490
+ }
491
+ }
492
+ if (this.modification.indentDocComment === IndentDocCommentScope.SpanAndChildren) {
493
+ this._endIndentDocComment(options);
494
+ }
495
+ }
496
+ _beginIndentDocComment(options) {
497
+ if (options.indentDocCommentState !== IndentDocCommentState.Inactive) {
498
+ throw new InternalError('indentDocComment cannot be nested');
499
+ }
500
+ options.indentDocCommentState = IndentDocCommentState.AwaitingOpenDelimiter;
501
+ }
502
+ _endIndentDocComment(options) {
503
+ if (options.indentDocCommentState === IndentDocCommentState.AwaitingCloseDelimiter) {
504
+ throw new InternalError('missing "*/" delimiter for comment block');
505
+ }
506
+ options.indentDocCommentState = IndentDocCommentState.Inactive;
507
+ }
508
+ /**
509
+ * Writes one chunk of `text` to the `options.writer`, applying the `indentDocComment` rewriting.
510
+ */
511
+ _write(text, options) {
512
+ let parsedText = text;
513
+ if (options.indentDocCommentState === IndentDocCommentState.AwaitingOpenDelimiter) {
514
+ let index = parsedText.indexOf('/*');
515
+ if (index >= 0) {
516
+ index += '/*'.length;
517
+ options.writer.write(parsedText.substring(0, index));
518
+ parsedText = parsedText.substring(index);
519
+ options.indentDocCommentState = IndentDocCommentState.AwaitingCloseDelimiter;
520
+ options.writer.increaseIndent(' ');
521
+ }
522
+ }
523
+ if (options.indentDocCommentState === IndentDocCommentState.AwaitingCloseDelimiter) {
524
+ let index = parsedText.indexOf('*/');
525
+ if (index >= 0) {
526
+ index += '*/'.length;
527
+ options.writer.write(parsedText.substring(0, index));
528
+ parsedText = parsedText.substring(index);
529
+ options.indentDocCommentState = IndentDocCommentState.Done;
530
+ options.writer.decreaseIndent();
531
+ }
532
+ }
533
+ options.writer.write(parsedText);
534
+ }
535
+ _getTrimmed(text) {
536
+ return Text.truncateWithEllipsis(Text.convertToLf(text), 100);
537
+ }
538
+ _getSubstring(startIndex, endIndex) {
539
+ if (startIndex === endIndex) {
540
+ return '';
541
+ }
542
+ return this.node.getSourceFile().text.substring(startIndex, endIndex);
543
+ }
544
+ }
545
+ //# sourceMappingURL=Span.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Span.js","sourceRoot":"","sources":["../../src/analyzer/Span.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQ9D,IAAK,qBAiBJ;AAjBD,WAAK,qBAAqB;IACxB;;OAEG;IACH,yEAAY,CAAA;IACZ;;OAEG;IACH,mGAAyB,CAAA;IACzB;;OAEG;IACH,qGAA0B,CA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AAM,CAAC,cAAc,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAEO,aAAa,CAAC,UAAkB,EAAE,QAAgB;QACxD,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACxE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as ts from 'typescript';\n\nimport { InternalError, Sort, Text } from '@rushstack/node-core-library';\n\nimport { IndentedWriter } from '../generators/IndentedWriter';\n\ninterface IWriteModifiedTextOptions {\n writer: IndentedWriter;\n separatorOverride: string | undefined;\n indentDocCommentState: IndentDocCommentState;\n}\n\nenum IndentDocCommentState {\n /**\n * `indentDocComment` was not requested for this subtree.\n */\n Inactive = 0,\n /**\n * `indentDocComment` was requested and we are looking for the opening `/` `*`\n */\n AwaitingOpenDelimiter = 1,\n /**\n * `indentDocComment` was requested and we are looking for the closing `*` `/`\n */\n AwaitingCloseDelimiter = 2,\n /**\n * `indentDocComment` was requested and we have finished indenting the comment.\n */\n Done = 3\n}\n\n/**\n * Choices for SpanModification.indentDocComment.\n */\nexport enum IndentDocCommentScope {\n /**\n * Do not detect and indent comments.\n */\n None = 0,\n\n /**\n * Look for one doc comment in the {@link Span.prefix} text only.\n */\n PrefixOnly = 1,\n\n /**\n * Look for one doc comment potentially distributed across the Span and its children.\n */\n SpanAndChildren = 2\n}\n\n/**\n * Specifies various transformations that will be performed by Span.getModifiedText().\n */\nexport class SpanModification {\n /**\n * If true, all of the child spans will be omitted from the Span.getModifiedText() output.\n * @remarks\n * Also, the modify() operation will not recurse into these spans.\n */\n public omitChildren: boolean = false;\n\n /**\n * If true, then the Span.separator will be removed from the Span.getModifiedText() output.\n */\n public omitSeparatorAfter: boolean = false;\n\n /**\n * If true, then Span.getModifiedText() will sort the immediate children according to their Span.sortKey\n * property. The separators will also be fixed up to ensure correct indentation. If the Span.sortKey is undefined\n * for some items, those items will not be moved, i.e. their array indexes will be unchanged.\n */\n public sortChildren: boolean = false;\n\n /**\n * Used if the parent span has Span.sortChildren=true.\n */\n public sortKey: string | undefined;\n\n /**\n * Optionally configures getModifiedText() to search for a \"/*\" doc comment and indent it.\n * At most one comment is detected.\n *\n * @remarks\n * The indentation can be applied to the `Span.modifier.prefix` only, or it can be applied to the\n * full subtree of nodes (as needed for `ts.SyntaxKind.JSDocComment` trees). However the enabled\n * scopes must not overlap.\n *\n * This feature is enabled selectively because (1) we do not want to accidentally match `/*` appearing\n * in a string literal or other expression that is not a comment, and (2) parsing comments is relatively\n * expensive.\n */\n public indentDocComment: IndentDocCommentScope = IndentDocCommentScope.None;\n\n private readonly _span: Span;\n private _prefix: string | undefined;\n private _suffix: string | undefined;\n\n public constructor(span: Span) {\n this._span = span;\n this.reset();\n }\n\n /**\n * Allows the Span.prefix text to be changed.\n */\n public get prefix(): string {\n return this._prefix !== undefined ? this._prefix : this._span.prefix;\n }\n\n public set prefix(value: string) {\n this._prefix = value;\n }\n\n /**\n * Allows the Span.suffix text to be changed.\n */\n public get suffix(): string {\n return this._suffix !== undefined ? this._suffix : this._span.suffix;\n }\n\n public set suffix(value: string) {\n this._suffix = value;\n }\n\n /**\n * Reverts any modifications made to this object.\n */\n public reset(): void {\n this.omitChildren = false;\n this.omitSeparatorAfter = false;\n this.sortChildren = false;\n this.sortKey = undefined;\n this._prefix = undefined;\n this._suffix = undefined;\n if (this._span.kind === ts.SyntaxKind.JSDocComment) {\n this.indentDocComment = IndentDocCommentScope.SpanAndChildren;\n }\n }\n\n /**\n * Effectively deletes the Span from the tree, by skipping its children, skipping its separator,\n * and setting its prefix/suffix to the empty string.\n */\n public skipAll(): void {\n this.prefix = '';\n this.suffix = '';\n this.omitChildren = true;\n this.omitSeparatorAfter = true;\n }\n}\n\n/**\n * The Span class provides a simple way to rewrite TypeScript source files\n * based on simple syntax transformations, i.e. without having to process deeper aspects\n * of the underlying grammar. An example transformation might be deleting JSDoc comments\n * from a source file.\n *\n * @remarks\n * TypeScript's abstract syntax tree (AST) is represented using Node objects.\n * The Node text ignores its surrounding whitespace, and does not have an ordering guarantee.\n * For example, a JSDocComment node can be a child of a FunctionDeclaration node, even though\n * the actual comment precedes the function in the input stream.\n *\n * The Span class is a wrapper for a single Node, that provides access to every character\n * in the input stream, such that Span.getText() will exactly reproduce the corresponding\n * full Node.getText() output.\n *\n * A Span is comprised of these parts, which appear in sequential order:\n * - A prefix\n * - A collection of child spans\n * - A suffix\n * - A separator (e.g. whitespace between this span and the next item in the tree)\n *\n * These parts can be modified via Span.modification. The modification is applied by\n * calling Span.getModifiedText().\n */\nexport class Span {\n public readonly node: ts.Node;\n\n // To improve performance, substrings are not allocated until actually needed\n public readonly startIndex: number;\n public readonly endIndex: number;\n\n public readonly children: Span[];\n\n public readonly modification: SpanModification;\n\n private _parent: Span | undefined;\n private _previousSibling: Span | undefined;\n private _nextSibling: Span | undefined;\n\n private _separatorStartIndex: number;\n private _separatorEndIndex: number;\n\n public constructor(node: ts.Node) {\n this.node = node;\n this.startIndex = node.kind === ts.SyntaxKind.SourceFile ? node.getFullStart() : node.getStart();\n this.endIndex = node.end;\n this._separatorStartIndex = 0;\n this._separatorEndIndex = 0;\n this.children = [];\n this.modification = new SpanModification(this);\n\n let previousChildSpan: Span | undefined = undefined;\n\n for (const childNode of this.node.getChildren() || []) {\n const childSpan: Span = new Span(childNode);\n childSpan._parent = this;\n childSpan._previousSibling = previousChildSpan;\n\n if (previousChildSpan) {\n previousChildSpan._nextSibling = childSpan;\n }\n\n this.children.push(childSpan);\n\n // Normalize the bounds so that a child is never outside its parent\n if (childSpan.startIndex < this.startIndex) {\n this.startIndex = childSpan.startIndex;\n }\n\n if (childSpan.endIndex > this.endIndex) {\n // This has never been observed empirically, but here's how we would handle it\n this.endIndex = childSpan.endIndex;\n throw new InternalError('Unexpected AST case');\n }\n\n if (previousChildSpan) {\n if (previousChildSpan.endIndex < childSpan.startIndex) {\n // There is some leftover text after previous child -- assign it as the separator for\n // the preceding span. If the preceding span has no suffix, then assign it to the\n // deepest preceding span with no suffix. This heuristic simplifies the most\n // common transformations, and otherwise it can be fished out using getLastInnerSeparator().\n let separatorRecipient: Span = previousChildSpan;\n while (separatorRecipient.children.length > 0) {\n const lastChild: Span = separatorRecipient.children[separatorRecipient.children.length - 1];\n if (lastChild.endIndex !== separatorRecipient.endIndex) {\n // There is a suffix, so we cannot push the separator any further down, or else\n // it would get printed before this suffix.\n break;\n }\n separatorRecipient = lastChild;\n }\n separatorRecipient._separatorStartIndex = previousChildSpan.endIndex;\n separatorRecipient._separatorEndIndex = childSpan.startIndex;\n }\n }\n\n previousChildSpan = childSpan;\n }\n }\n\n public get kind(): ts.SyntaxKind {\n return this.node.kind;\n }\n\n /**\n * The parent Span, if any.\n * NOTE: This will be undefined for a root Span, even though the corresponding Node\n * may have a parent in the AST.\n */\n public get parent(): Span | undefined {\n return this._parent;\n }\n\n /**\n * If the current object is this.parent.children[i], then previousSibling corresponds\n * to this.parent.children[i-1] if it exists.\n * NOTE: This will be undefined for a root Span, even though the corresponding Node\n * may have a previous sibling in the AST.\n */\n public get previousSibling(): Span | undefined {\n return this._previousSibling;\n }\n\n /**\n * If the current object is this.parent.children[i], then previousSibling corresponds\n * to this.parent.children[i+1] if it exists.\n * NOTE: This will be undefined for a root Span, even though the corresponding Node\n * may have a previous sibling in the AST.\n */\n public get nextSibling(): Span | undefined {\n return this._nextSibling;\n }\n\n /**\n * The text associated with the underlying Node, up to its first child.\n */\n public get prefix(): string {\n if (this.children.length) {\n // Everything up to the first child\n return this._getSubstring(this.startIndex, this.children[0].startIndex);\n } else {\n return this._getSubstring(this.startIndex, this.endIndex);\n }\n }\n\n /**\n * The text associated with the underlying Node, after its last child.\n * If there are no children, this is always an empty string.\n */\n public get suffix(): string {\n if (this.children.length) {\n // Everything after the last child\n return this._getSubstring(this.children[this.children.length - 1].endIndex, this.endIndex);\n } else {\n return '';\n }\n }\n\n /**\n * Whitespace that appeared after this node, and before the \"next\" node in the tree.\n * Here we mean \"next\" according to an inorder traversal, not necessarily a sibling.\n */\n public get separator(): string {\n return this._getSubstring(this._separatorStartIndex, this._separatorEndIndex);\n }\n\n /**\n * Returns the separator of this Span, or else recursively calls getLastInnerSeparator()\n * on the last child.\n */\n public getLastInnerSeparator(): string {\n if (this.separator) {\n return this.separator;\n }\n if (this.children.length > 0) {\n return this.children[this.children.length - 1].getLastInnerSeparator();\n }\n return '';\n }\n\n /**\n * Returns the first parent node with the specified SyntaxKind, or undefined if there is no match.\n */\n public findFirstParent(kindToMatch: ts.SyntaxKind): Span | undefined {\n let current: Span | undefined = this;\n\n while (current) {\n if (current.kind === kindToMatch) {\n return current;\n }\n current = current.parent;\n }\n\n return undefined;\n }\n\n /**\n * Recursively invokes the callback on this Span and all its children. The callback\n * can make changes to Span.modification for each node.\n */\n public forEach(callback: (span: Span) => void): void {\n callback(this);\n for (const child of this.children) {\n child.forEach(callback);\n }\n }\n\n /**\n * Returns the original unmodified text represented by this Span.\n */\n public getText(): string {\n let result: string = '';\n result += this.prefix;\n\n for (const child of this.children) {\n result += child.getText();\n }\n\n result += this.suffix;\n result += this.separator;\n\n return result;\n }\n\n /**\n * Returns the text represented by this Span, after applying all requested modifications.\n */\n public getModifiedText(): string {\n const writer: IndentedWriter = new IndentedWriter();\n writer.trimLeadingSpaces = true;\n\n this._writeModifiedText({\n writer: writer,\n separatorOverride: undefined,\n indentDocCommentState: IndentDocCommentState.Inactive\n });\n\n return writer.getText();\n }\n\n public writeModifiedText(output: IndentedWriter): void {\n this._writeModifiedText({\n writer: output,\n separatorOverride: undefined,\n indentDocCommentState: IndentDocCommentState.Inactive\n });\n }\n\n /**\n * Returns a diagnostic dump of the tree, showing the prefix/suffix/separator for\n * each node.\n */\n public getDump(indent: string = ''): string {\n let result: string = indent + ts.SyntaxKind[this.node.kind] + ': ';\n\n if (this.prefix) {\n result += ' pre=[' + this._getTrimmed(this.prefix) + ']';\n }\n if (this.suffix) {\n result += ' suf=[' + this._getTrimmed(this.suffix) + ']';\n }\n if (this.separator) {\n result += ' sep=[' + this._getTrimmed(this.separator) + ']';\n }\n result += '\\n';\n\n for (const child of this.children) {\n result += child.getDump(indent + ' ');\n }\n\n return result;\n }\n\n /**\n * Returns a diagnostic dump of the tree, showing the SpanModification settings for each nodde.\n */\n public getModifiedDump(indent: string = ''): string {\n let result: string = indent + ts.SyntaxKind[this.node.kind] + ': ';\n\n if (this.prefix) {\n result += ' pre=[' + this._getTrimmed(this.modification.prefix) + ']';\n }\n if (this.suffix) {\n result += ' suf=[' + this._getTrimmed(this.modification.suffix) + ']';\n }\n if (this.separator) {\n result += ' sep=[' + this._getTrimmed(this.separator) + ']';\n }\n if (this.modification.indentDocComment !== IndentDocCommentScope.None) {\n result += ' indentDocComment=' + IndentDocCommentScope[this.modification.indentDocComment];\n }\n if (this.modification.omitChildren) {\n result += ' omitChildren';\n }\n if (this.modification.omitSeparatorAfter) {\n result += ' omitSeparatorAfter';\n }\n if (this.modification.sortChildren) {\n result += ' sortChildren';\n }\n if (this.modification.sortKey !== undefined) {\n result += ` sortKey=\"${this.modification.sortKey}\"`;\n }\n result += '\\n';\n\n if (!this.modification.omitChildren) {\n for (const child of this.children) {\n result += child.getModifiedDump(indent + ' ');\n }\n } else {\n result += `${indent} (${this.children.length} children)\\n`;\n }\n\n return result;\n }\n\n /**\n * Recursive implementation of `getModifiedText()` and `writeModifiedText()`.\n */\n private _writeModifiedText(options: IWriteModifiedTextOptions): void {\n // Apply indentation based on \"{\" and \"}\"\n if (this.prefix === '{') {\n options.writer.increaseIndent();\n } else if (this.prefix === '}') {\n options.writer.decreaseIndent();\n }\n\n if (this.modification.indentDocComment !== IndentDocCommentScope.None) {\n this._beginIndentDocComment(options);\n }\n\n this._write(this.modification.prefix, options);\n\n if (this.modification.indentDocComment === IndentDocCommentScope.PrefixOnly) {\n this._endIndentDocComment(options);\n }\n\n let sortedSubset: Span[] | undefined;\n\n if (!this.modification.omitChildren) {\n if (this.modification.sortChildren) {\n // We will only sort the items with a sortKey\n const filtered: Span[] = this.children.filter((x) => x.modification.sortKey !== undefined);\n\n // Is there at least one of them?\n if (filtered.length > 1) {\n sortedSubset = filtered;\n }\n }\n }\n\n if (sortedSubset) {\n // This is the complicated special case that sorts an arbitrary subset of the child nodes,\n // preserving the surrounding nodes.\n\n const sortedSubsetCount: number = sortedSubset.length;\n // Remember the separator for the first and last ones\n const firstSeparator: string = sortedSubset[0].getLastInnerSeparator();\n const lastSeparator: string = sortedSubset[sortedSubsetCount - 1].getLastInnerSeparator();\n\n Sort.sortBy(sortedSubset, (x) => x.modification.sortKey);\n\n const childOptions: IWriteModifiedTextOptions = { ...options };\n\n let sortedSubsetIndex: number = 0;\n for (let index: number = 0; index < this.children.length; ++index) {\n let current: Span;\n\n // Is this an item that we sorted?\n if (this.children[index].modification.sortKey === undefined) {\n // No, take the next item from the original array\n current = this.children[index];\n childOptions.separatorOverride = undefined;\n } else {\n // Yes, take the next item from the sortedSubset\n current = sortedSubset[sortedSubsetIndex++];\n\n if (sortedSubsetIndex < sortedSubsetCount) {\n childOptions.separatorOverride = firstSeparator;\n } else {\n childOptions.separatorOverride = lastSeparator;\n }\n }\n\n current._writeModifiedText(childOptions);\n }\n } else {\n // This is the normal case that does not need to sort children\n const childrenLength: number = this.children.length;\n\n if (!this.modification.omitChildren) {\n if (options.separatorOverride !== undefined) {\n // Special case where the separatorOverride is passed down to the \"last inner separator\" span\n for (let i: number = 0; i < childrenLength; ++i) {\n const child: Span = this.children[i];\n\n if (\n // Only the last child inherits the separatorOverride, because only it can contain\n // the \"last inner separator\" span\n i < childrenLength - 1 ||\n // If this.separator is specified, then we will write separatorOverride below, so don't pass it along\n this.separator\n ) {\n const childOptions: IWriteModifiedTextOptions = { ...options };\n childOptions.separatorOverride = undefined;\n child._writeModifiedText(childOptions);\n } else {\n child._writeModifiedText(options);\n }\n }\n } else {\n // The normal simple case\n for (const child of this.children) {\n child._writeModifiedText(options);\n }\n }\n }\n\n this._write(this.modification.suffix, options);\n\n if (options.separatorOverride !== undefined) {\n if (this.separator || childrenLength === 0) {\n this._write(options.separatorOverride, options);\n }\n } else {\n if (!this.modification.omitSeparatorAfter) {\n this._write(this.separator, options);\n }\n }\n }\n\n if (this.modification.indentDocComment === IndentDocCommentScope.SpanAndChildren) {\n this._endIndentDocComment(options);\n }\n }\n\n private _beginIndentDocComment(options: IWriteModifiedTextOptions): void {\n if (options.indentDocCommentState !== IndentDocCommentState.Inactive) {\n throw new InternalError('indentDocComment cannot be nested');\n }\n options.indentDocCommentState = IndentDocCommentState.AwaitingOpenDelimiter;\n }\n\n private _endIndentDocComment(options: IWriteModifiedTextOptions): void {\n if (options.indentDocCommentState === IndentDocCommentState.AwaitingCloseDelimiter) {\n throw new InternalError('missing \"*/\" delimiter for comment block');\n }\n options.indentDocCommentState = IndentDocCommentState.Inactive;\n }\n\n /**\n * Writes one chunk of `text` to the `options.writer`, applying the `indentDocComment` rewriting.\n */\n private _write(text: string, options: IWriteModifiedTextOptions): void {\n let parsedText: string = text;\n\n if (options.indentDocCommentState === IndentDocCommentState.AwaitingOpenDelimiter) {\n let index: number = parsedText.indexOf('/*');\n if (index >= 0) {\n index += '/*'.length;\n options.writer.write(parsedText.substring(0, index));\n parsedText = parsedText.substring(index);\n options.indentDocCommentState = IndentDocCommentState.AwaitingCloseDelimiter;\n\n options.writer.increaseIndent(' ');\n }\n }\n\n if (options.indentDocCommentState === IndentDocCommentState.AwaitingCloseDelimiter) {\n let index: number = parsedText.indexOf('*/');\n if (index >= 0) {\n index += '*/'.length;\n options.writer.write(parsedText.substring(0, index));\n parsedText = parsedText.substring(index);\n options.indentDocCommentState = IndentDocCommentState.Done;\n\n options.writer.decreaseIndent();\n }\n }\n\n options.writer.write(parsedText);\n }\n\n private _getTrimmed(text: string): string {\n return Text.truncateWithEllipsis(Text.convertToLf(text), 100);\n }\n\n private _getSubstring(startIndex: number, endIndex: number): string {\n if (startIndex === endIndex) {\n return '';\n }\n return this.node.getSourceFile().text.substring(startIndex, endIndex);\n }\n}\n"]}