@cparra/apexdocs 2.24.0 → 2.25.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.github/workflows/ci.yaml +22 -0
  3. package/.github/workflows/close_stale.yml +22 -22
  4. package/.prettierrc.js +7 -7
  5. package/LICENSE +21 -21
  6. package/README.md +742 -718
  7. package/apexdocs.config.ts +13 -13
  8. package/docs/{README.md → __old/README.md} +1 -1
  9. package/docs/{restapi.json → __old/restapi.json} +589 -589
  10. package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
  11. package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
  12. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  13. package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
  14. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  15. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  16. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  17. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  18. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  19. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  20. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  21. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  22. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  23. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  24. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  25. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  26. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  27. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  28. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  29. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  30. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  31. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  32. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  33. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  34. package/examples/includes/header.md +3 -3
  35. package/examples/plain-markdown/.forceignore +12 -0
  36. package/examples/plain-markdown/README.md +301 -0
  37. package/examples/plain-markdown/config/project-scratch-def.json +5 -0
  38. package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
  39. package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
  40. package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
  41. package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
  42. package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
  43. package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
  44. package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
  45. package/examples/plain-markdown/package-lock.json +665 -0
  46. package/examples/plain-markdown/package.json +24 -0
  47. package/examples/plain-markdown/sfdx-project.json +12 -0
  48. package/examples/plain-markdown/template.md +3 -0
  49. package/jest.config.js +5 -5
  50. package/lib/adapters/apex-types.d.ts +5 -0
  51. package/lib/adapters/apex-types.js +34 -0
  52. package/lib/adapters/apex-types.js.map +1 -0
  53. package/lib/adapters/documentables.d.ts +6 -0
  54. package/lib/adapters/documentables.js +41 -0
  55. package/lib/adapters/documentables.js.map +1 -0
  56. package/lib/adapters/fields-and-properties.d.ts +3 -0
  57. package/lib/adapters/fields-and-properties.js +10 -0
  58. package/lib/adapters/fields-and-properties.js.map +1 -0
  59. package/lib/adapters/methods-and-constructors.d.ts +4 -0
  60. package/lib/adapters/methods-and-constructors.js +49 -0
  61. package/lib/adapters/methods-and-constructors.js.map +1 -0
  62. package/lib/adapters/references.d.ts +5 -0
  63. package/lib/adapters/references.js +82 -0
  64. package/lib/adapters/references.js.map +1 -0
  65. package/lib/adapters/type-utils.d.ts +2 -0
  66. package/lib/adapters/type-utils.js +8 -0
  67. package/lib/adapters/type-utils.js.map +1 -0
  68. package/lib/application/Apexdocs.d.ts +13 -13
  69. package/lib/application/Apexdocs.js +79 -76
  70. package/lib/application/Apexdocs.js.map +1 -1
  71. package/lib/cli/generate.d.ts +2 -2
  72. package/lib/cli/generate.js +156 -130
  73. package/lib/cli/generate.js.map +1 -1
  74. package/lib/index.d.ts +1 -1
  75. package/lib/index.js +17 -17
  76. package/lib/model/apex-bundle.d.ts +6 -6
  77. package/lib/model/apex-bundle.js +10 -10
  78. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  79. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  80. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  81. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  82. package/lib/model/inheritance.d.ts +8 -8
  83. package/lib/model/inheritance.js +2 -2
  84. package/lib/model/manifest.d.ts +22 -22
  85. package/lib/model/manifest.js +46 -46
  86. package/lib/model/manifest.js.map +1 -1
  87. package/lib/model/markdown-file.d.ts +16 -16
  88. package/lib/model/markdown-file.js +109 -106
  89. package/lib/model/markdown-file.js.map +1 -1
  90. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  91. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
  92. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  93. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  94. package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
  95. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  96. package/lib/model/markdown-generation-util/index.js +19 -19
  97. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  98. package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
  99. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  100. package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
  101. package/lib/model/markdown-home-file.d.ts +11 -11
  102. package/lib/model/markdown-home-file.js +56 -53
  103. package/lib/model/markdown-home-file.js.map +1 -1
  104. package/lib/model/markdown-type-file.d.ts +26 -26
  105. package/lib/model/markdown-type-file.js +136 -133
  106. package/lib/model/markdown-type-file.js.map +1 -1
  107. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  108. package/lib/model/openapi/apex-doc-types.js +4 -4
  109. package/lib/model/openapi/open-api-types.d.ts +93 -93
  110. package/lib/model/openapi/open-api-types.js +2 -2
  111. package/lib/model/openapi/open-api.d.ts +16 -16
  112. package/lib/model/openapi/open-api.js +33 -33
  113. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  114. package/lib/model/openapi/openapi-type-file.js +16 -16
  115. package/lib/model/outputFile.d.ts +10 -10
  116. package/lib/model/outputFile.js +28 -28
  117. package/lib/model/types-repository.d.ts +16 -16
  118. package/lib/model/types-repository.js +53 -53
  119. package/lib/service/apex-file-reader.d.ts +14 -14
  120. package/lib/service/apex-file-reader.js +48 -45
  121. package/lib/service/apex-file-reader.js.map +1 -1
  122. package/lib/service/file-system.d.ts +14 -14
  123. package/lib/service/file-system.js +47 -24
  124. package/lib/service/file-system.js.map +1 -1
  125. package/lib/service/file-writer.d.ts +6 -6
  126. package/lib/service/file-writer.js +56 -33
  127. package/lib/service/file-writer.js.map +1 -1
  128. package/lib/service/manifest-factory.d.ts +10 -10
  129. package/lib/service/manifest-factory.js +16 -13
  130. package/lib/service/manifest-factory.js.map +1 -1
  131. package/lib/service/metadata-processor.d.ts +3 -3
  132. package/lib/service/metadata-processor.js +16 -16
  133. package/lib/service/parser.d.ts +21 -21
  134. package/lib/service/parser.js +137 -134
  135. package/lib/service/parser.js.map +1 -1
  136. package/lib/service/state.d.ts +9 -9
  137. package/lib/service/state.js +19 -19
  138. package/lib/service/walkers/class-walker.d.ts +4 -4
  139. package/lib/service/walkers/class-walker.js +32 -32
  140. package/lib/service/walkers/enum-walker.d.ts +4 -4
  141. package/lib/service/walkers/enum-walker.js +10 -10
  142. package/lib/service/walkers/interface-walker.d.ts +4 -4
  143. package/lib/service/walkers/interface-walker.js +14 -14
  144. package/lib/service/walkers/walker-factory.d.ts +5 -5
  145. package/lib/service/walkers/walker-factory.js +20 -20
  146. package/lib/service/walkers/walker.d.ts +19 -19
  147. package/lib/service/walkers/walker.js +16 -16
  148. package/lib/settings.d.ts +70 -64
  149. package/lib/settings.js +99 -88
  150. package/lib/settings.js.map +1 -1
  151. package/lib/templating/compile.d.ts +7 -0
  152. package/lib/templating/compile.js +98 -0
  153. package/lib/templating/compile.js.map +1 -0
  154. package/lib/templating/helpers.d.ts +2 -0
  155. package/lib/templating/helpers.js +18 -0
  156. package/lib/templating/helpers.js.map +1 -0
  157. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  158. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  159. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  160. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  161. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  162. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  163. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  164. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  165. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  166. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  167. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
  168. package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
  169. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
  170. package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
  171. package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
  172. package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
  173. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  174. package/lib/test-helpers/SettingsBuilder.js +26 -26
  175. package/lib/transpiler/factory.d.ts +6 -6
  176. package/lib/transpiler/factory.js +34 -31
  177. package/lib/transpiler/factory.js.map +1 -1
  178. package/lib/transpiler/file-container.d.ts +6 -6
  179. package/lib/transpiler/file-container.js +15 -15
  180. package/lib/transpiler/generator-choices.d.ts +1 -1
  181. package/lib/transpiler/generator-choices.js +2 -2
  182. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
  183. package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
  184. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  185. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  186. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  187. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
  188. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
  189. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  190. package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
  191. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
  192. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
  193. package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
  194. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
  195. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
  196. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
  197. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
  198. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
  199. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
  200. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
  201. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
  202. package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
  203. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
  204. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
  205. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
  206. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
  207. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
  208. package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
  209. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
  210. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
  211. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
  212. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
  213. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
  214. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
  215. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  216. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
  217. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
  218. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
  219. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  220. package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
  221. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  222. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  223. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  224. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  225. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  226. package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
  227. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  228. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  229. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  230. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  231. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
  232. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  233. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  234. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  235. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  236. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  237. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  238. package/lib/transpiler/processor-type-transpiler.js +8 -8
  239. package/lib/transpiler/transpiler.d.ts +5 -5
  240. package/lib/transpiler/transpiler.js +29 -26
  241. package/lib/transpiler/transpiler.js.map +1 -1
  242. package/lib/util/error-logger.d.ts +8 -8
  243. package/lib/util/error-logger.js +89 -89
  244. package/lib/util/error-logger.js.map +1 -1
  245. package/lib/util/logger.d.ts +21 -21
  246. package/lib/util/logger.js +60 -57
  247. package/lib/util/logger.js.map +1 -1
  248. package/lib/util/string-utils.d.ts +2 -2
  249. package/lib/util/string-utils.js +14 -14
  250. package/package.json +79 -78
  251. package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
  252. package/src/adapters/__tests__/references.spec.ts +115 -0
  253. package/src/adapters/apex-types.ts +67 -0
  254. package/src/adapters/documentables.ts +58 -0
  255. package/src/adapters/fields-and-properties.ts +14 -0
  256. package/src/adapters/methods-and-constructors.ts +78 -0
  257. package/src/adapters/references.ts +113 -0
  258. package/src/adapters/type-utils.ts +5 -0
  259. package/src/adapters/types.d.ts +8 -0
  260. package/src/cli/generate.ts +3 -0
  261. package/src/model/__tests__/manifest.spec.ts +1 -0
  262. package/src/model/manifest.ts +3 -3
  263. package/src/model/markdown-file.ts +1 -1
  264. package/src/model/openapi/open-api-types.ts +2 -2
  265. package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
  266. package/src/service/__tests__/manifest-factory.spec.ts +1 -2
  267. package/src/settings.ts +15 -0
  268. package/src/templating/__tests__/compile.spec.ts +741 -0
  269. package/src/templating/compile.ts +187 -0
  270. package/src/templating/helpers.ts +14 -0
  271. package/src/templating/types.d.ts +104 -0
  272. package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
  273. package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
  274. package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
  275. package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
  276. package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
  277. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
  278. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
  279. package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
  280. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
  281. package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
  282. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
  283. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
  284. package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
  285. package/src/transpiler/openapi/parsers/Builder.ts +1 -1
  286. package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
  287. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
  288. package/src/util/error-logger.ts +4 -4
  289. package/src/util/logger.ts +3 -3
  290. package/tsconfig.json +21 -20
  291. package/tslint.json +5 -5
  292. package/lib/model/manifest-diff.d.ts +0 -27
  293. package/lib/model/manifest-diff.js +0 -69
  294. package/lib/model/manifest-diff.js.map +0 -1
  295. package/src/model/__tests__/manifest-diff.spec.ts +0 -139
  296. package/src/model/manifest-diff.ts +0 -94
  297. /package/docs/{index.html → __old/index.html} +0 -0
  298. /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
  299. /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
  300. /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
  301. /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
  302. /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
  303. /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
  304. /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
  305. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
  306. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
  307. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
  308. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
  309. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
  310. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
  311. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
  312. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
  313. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
  314. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
  315. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
  316. /package/docs/{types → __old/types}/README.md +0 -0
  317. /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.compile = void 0;
7
+ const handlebars_1 = __importDefault(require("handlebars"));
8
+ const helpers_1 = require("./helpers");
9
+ const type_level_apex_doc_partial_template_1 = require("../transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template");
10
+ const methods_partial_template_1 = require("../transpiler/markdown/plain-markdown/methods-partial-template");
11
+ const constructors_partial_template_1 = require("../transpiler/markdown/plain-markdown/constructors-partial-template");
12
+ const fieldsPartialTemplate_1 = require("../transpiler/markdown/plain-markdown/fieldsPartialTemplate");
13
+ const documentable_partial_template_1 = require("../transpiler/markdown/plain-markdown/documentable-partial-template");
14
+ function compile(template, source, options) {
15
+ handlebars_1.default.registerPartial('typeLevelApexDocPartialTemplate', type_level_apex_doc_partial_template_1.typeLevelApexDocPartialTemplate);
16
+ handlebars_1.default.registerPartial('documentablePartialTemplate', documentable_partial_template_1.documentablePartialTemplate);
17
+ handlebars_1.default.registerPartial('methodsPartialTemplate', methods_partial_template_1.methodsPartialTemplate);
18
+ handlebars_1.default.registerPartial('constructorsPartialTemplate', constructors_partial_template_1.constructorsPartialTemplate);
19
+ handlebars_1.default.registerPartial('fieldsPartialTemplate', fieldsPartialTemplate_1.fieldsPartialTemplate);
20
+ handlebars_1.default.registerHelper('splitAndCapitalize', helpers_1.splitAndCapitalize);
21
+ const prepared = Object.assign(Object.assign({}, prepare(source, options)), { namespace: (0, helpers_1.namespace)() });
22
+ const compiled = handlebars_1.default.compile(template);
23
+ return (compiled(prepared)
24
+ .trim()
25
+ // clean up extra newlines
26
+ .replace(/\n{3,}/g, '\n\n'));
27
+ }
28
+ exports.compile = compile;
29
+ function prepare(source, { renderableContentConverter, codeBlockConverter }) {
30
+ const base = Object.assign(Object.assign(Object.assign({}, source), prepareDocumentable(source, renderableContentConverter, codeBlockConverter)), prepareBaseType(source, renderableContentConverter));
31
+ if (isEnumSource(source)) {
32
+ return Object.assign(Object.assign({}, base), prepareEnum(source, renderableContentConverter));
33
+ }
34
+ else if (isInterfaceSource(source)) {
35
+ return Object.assign(Object.assign({}, base), prepareInterface(source, renderableContentConverter, codeBlockConverter));
36
+ }
37
+ else {
38
+ return Object.assign(Object.assign({}, base), prepareClass(source, renderableContentConverter, codeBlockConverter));
39
+ }
40
+ }
41
+ function prepareDocumentable(source, renderableContentConverter, codeBlockConverter) {
42
+ var _a;
43
+ return {
44
+ description: renderableContentConverter(source.description),
45
+ mermaid: source.mermaid ? codeBlockConverter('mermaid', source.mermaid) : undefined,
46
+ example: source.example ? codeBlockConverter('apex', source.example) : undefined,
47
+ customTags: (_a = source.customTags) === null || _a === void 0 ? void 0 : _a.map((tag) => ({
48
+ name: tag.name,
49
+ value: renderableContentConverter(tag.description),
50
+ })),
51
+ };
52
+ }
53
+ function prepareBaseType(source, renderableContentConverter) {
54
+ var _a;
55
+ return {
56
+ sees: (_a = source.sees) === null || _a === void 0 ? void 0 : _a.map((see) => renderableContentConverter([see])),
57
+ };
58
+ }
59
+ function prepareEnum(source, renderableContentConverter) {
60
+ return {
61
+ values: source.values.map((value) => ({
62
+ value: value.value,
63
+ description: renderableContentConverter(value.description),
64
+ })),
65
+ };
66
+ }
67
+ function prepareInterface(source, renderableContentConverter, codeBlockConverter) {
68
+ var _a, _b;
69
+ return {
70
+ extends: (_a = source.extends) === null || _a === void 0 ? void 0 : _a.map((ext) => renderableContentConverter([ext])),
71
+ methods: (_b = source.methods) === null || _b === void 0 ? void 0 : _b.map((method) => mapMethod(method, renderableContentConverter, codeBlockConverter)),
72
+ };
73
+ }
74
+ function prepareClass(source, renderableContentConverter, codeBlockConverter) {
75
+ var _a, _b, _c, _d;
76
+ return {
77
+ implements: (_a = source.implements) === null || _a === void 0 ? void 0 : _a.map((impl) => renderableContentConverter([impl])),
78
+ extends: source.extends ? renderableContentConverter([source.extends]) : undefined,
79
+ constructors: (_b = source.constructors) === null || _b === void 0 ? void 0 : _b.map((constructor) => mapConstructor(constructor, renderableContentConverter, codeBlockConverter)),
80
+ methods: (_c = source.methods) === null || _c === void 0 ? void 0 : _c.map((method) => mapMethod(method, renderableContentConverter, codeBlockConverter)),
81
+ fields: (_d = source.fields) === null || _d === void 0 ? void 0 : _d.map((field) => (Object.assign(Object.assign(Object.assign({}, field), prepareDocumentable(field, renderableContentConverter, codeBlockConverter)), { type: renderableContentConverter([field.type]) }))),
82
+ };
83
+ }
84
+ function mapMethod(method, renderableContentConverter, codeBlockConverter) {
85
+ var _a, _b, _c, _d;
86
+ return Object.assign(Object.assign(Object.assign({}, method), prepareDocumentable(method, renderableContentConverter, codeBlockConverter)), { returnType: Object.assign(Object.assign({}, method), { type: ((_a = method.returnType) === null || _a === void 0 ? void 0 : _a.type) ? renderableContentConverter([method.returnType.type]) : undefined, description: renderableContentConverter((_b = method.returnType) === null || _b === void 0 ? void 0 : _b.description) }), throws: (_c = method.throws) === null || _c === void 0 ? void 0 : _c.map((thrown) => (Object.assign(Object.assign({}, thrown), { type: renderableContentConverter([thrown.type]), description: renderableContentConverter(thrown.description) }))), parameters: (_d = method.parameters) === null || _d === void 0 ? void 0 : _d.map((param) => (Object.assign(Object.assign({}, param), { type: renderableContentConverter([param.type]), description: renderableContentConverter(param.description) }))) });
87
+ }
88
+ function mapConstructor(constructor, renderableContentConverter, codeBlockConverter) {
89
+ var _a, _b;
90
+ return Object.assign(Object.assign(Object.assign({}, constructor), prepareDocumentable(constructor, renderableContentConverter, codeBlockConverter)), { parameters: (_a = constructor.parameters) === null || _a === void 0 ? void 0 : _a.map((param) => (Object.assign(Object.assign({}, param), { type: renderableContentConverter([param.type]), description: renderableContentConverter(param.description) }))), throws: (_b = constructor.throws) === null || _b === void 0 ? void 0 : _b.map((thrown) => (Object.assign(Object.assign({}, thrown), { type: renderableContentConverter([thrown.type]), description: renderableContentConverter(thrown.description) }))) });
91
+ }
92
+ function isEnumSource(source) {
93
+ return source.__type === 'enum';
94
+ }
95
+ function isInterfaceSource(source) {
96
+ return source.__type === 'interface';
97
+ }
98
+ //# sourceMappingURL=compile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/templating/compile.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAo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AAkB,CAAC,KACnF,UAAU,EAAE,MAAA,WAAW,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iCAC9C,KAAK,KACR,IAAI,EAAE,0BAA0B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAC9C,WAAW,EAAE,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC,IAC1D,CAAC,EACH,MAAM,EAAE,MAAA,WAAW,CAAC,MAAM,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,iCACvC,MAAM,KACT,IAAI,EAAE,0BAA0B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAC/C,WAAW,EAAE,0BAA0B,CAAC,MAAM,CAAC,WAAW,CAAC,IAC3D,CAAC,IACH;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,MAA0B;IAC9C,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAClC,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA0B;IACnD,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const splitAndCapitalize: (text: string) => string;
2
+ export declare const namespace: () => string | undefined;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.namespace = exports.splitAndCapitalize = void 0;
4
+ const settings_1 = require("../settings");
5
+ const splitAndCapitalize = (text) => {
6
+ const words = text.split(/[-_]+/);
7
+ const capitalizedWords = [];
8
+ for (const word of words) {
9
+ capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
10
+ }
11
+ return capitalizedWords.join(' ');
12
+ };
13
+ exports.splitAndCapitalize = splitAndCapitalize;
14
+ const namespace = () => {
15
+ return settings_1.Settings.getInstance().getNamespace();
16
+ };
17
+ exports.namespace = namespace;
18
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/templating/helpers.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAEhC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrE;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC;AAPW,QAAA,kBAAkB,sBAO7B;AAEK,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,mBAAQ,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB"}
@@ -1,12 +1,12 @@
1
- import { Annotation, AnnotationElementValue } from '@cparra/apex-reflection';
2
- /**
3
- * Builder class to create Annotation objects.
4
- * For testing purposes only.
5
- */
6
- export declare class AnnotationBuilder {
7
- private name;
8
- private elementValues;
9
- withName(name: string): AnnotationBuilder;
10
- addElementValue(elementValue: AnnotationElementValue): AnnotationBuilder;
11
- build(): Annotation;
12
- }
1
+ import { Annotation, AnnotationElementValue } from '@cparra/apex-reflection';
2
+ /**
3
+ * Builder class to create Annotation objects.
4
+ * For testing purposes only.
5
+ */
6
+ export declare class AnnotationBuilder {
7
+ private name;
8
+ private elementValues;
9
+ withName(name: string): AnnotationBuilder;
10
+ addElementValue(elementValue: AnnotationElementValue): AnnotationBuilder;
11
+ build(): Annotation;
12
+ }
@@ -1,31 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnnotationBuilder = void 0;
4
- /**
5
- * Builder class to create Annotation objects.
6
- * For testing purposes only.
7
- */
8
- class AnnotationBuilder {
9
- constructor() {
10
- this.name = 'restresource';
11
- this.elementValues = [];
12
- }
13
- withName(name) {
14
- this.name = name;
15
- return this;
16
- }
17
- addElementValue(elementValue) {
18
- this.elementValues.push(elementValue);
19
- return this;
20
- }
21
- build() {
22
- return {
23
- rawDeclaration: '',
24
- name: this.name,
25
- type: this.name,
26
- elementValues: this.elementValues,
27
- };
28
- }
29
- }
30
- exports.AnnotationBuilder = AnnotationBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnnotationBuilder = void 0;
4
+ /**
5
+ * Builder class to create Annotation objects.
6
+ * For testing purposes only.
7
+ */
8
+ class AnnotationBuilder {
9
+ constructor() {
10
+ this.name = 'restresource';
11
+ this.elementValues = [];
12
+ }
13
+ withName(name) {
14
+ this.name = name;
15
+ return this;
16
+ }
17
+ addElementValue(elementValue) {
18
+ this.elementValues.push(elementValue);
19
+ return this;
20
+ }
21
+ build() {
22
+ return {
23
+ rawDeclaration: '',
24
+ name: this.name,
25
+ type: this.name,
26
+ elementValues: this.elementValues,
27
+ };
28
+ }
29
+ }
30
+ exports.AnnotationBuilder = AnnotationBuilder;
31
31
  //# sourceMappingURL=AnnotationBuilder.js.map
@@ -1,18 +1,18 @@
1
- import { Annotation, ClassMirror, DocComment, FieldMirror, MethodMirror } from '@cparra/apex-reflection';
2
- /**
3
- * Builder class to create ClassMirror objects.
4
- * For testing purposes only.
5
- */
6
- export declare class ClassMirrorBuilder {
7
- private name;
8
- private annotations;
9
- private docComment?;
10
- private methods;
11
- private fields;
12
- withName(name: string): ClassMirrorBuilder;
13
- addAnnotation(annotation: Annotation): ClassMirrorBuilder;
14
- withDocComment(docComment: DocComment): ClassMirrorBuilder;
15
- addMethod(method: MethodMirror): ClassMirrorBuilder;
16
- addFiled(field: FieldMirror): ClassMirrorBuilder;
17
- build(): ClassMirror;
18
- }
1
+ import { Annotation, ClassMirror, DocComment, FieldMirror, MethodMirror } from '@cparra/apex-reflection';
2
+ /**
3
+ * Builder class to create ClassMirror objects.
4
+ * For testing purposes only.
5
+ */
6
+ export declare class ClassMirrorBuilder {
7
+ private name;
8
+ private annotations;
9
+ private docComment?;
10
+ private methods;
11
+ private fields;
12
+ withName(name: string): ClassMirrorBuilder;
13
+ addAnnotation(annotation: Annotation): ClassMirrorBuilder;
14
+ withDocComment(docComment: DocComment): ClassMirrorBuilder;
15
+ addMethod(method: MethodMirror): ClassMirrorBuilder;
16
+ addFiled(field: FieldMirror): ClassMirrorBuilder;
17
+ build(): ClassMirror;
18
+ }
@@ -1,54 +1,54 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClassMirrorBuilder = void 0;
4
- /**
5
- * Builder class to create ClassMirror objects.
6
- * For testing purposes only.
7
- */
8
- class ClassMirrorBuilder {
9
- constructor() {
10
- this.name = 'SampleClass';
11
- this.annotations = [];
12
- this.methods = [];
13
- this.fields = [];
14
- }
15
- withName(name) {
16
- this.name = name;
17
- return this;
18
- }
19
- addAnnotation(annotation) {
20
- this.annotations.push(annotation);
21
- return this;
22
- }
23
- withDocComment(docComment) {
24
- this.docComment = docComment;
25
- return this;
26
- }
27
- addMethod(method) {
28
- this.methods.push(method);
29
- return this;
30
- }
31
- addFiled(field) {
32
- this.fields.push(field);
33
- return this;
34
- }
35
- build() {
36
- return {
37
- annotations: this.annotations,
38
- name: this.name,
39
- type_name: 'class',
40
- methods: this.methods,
41
- implemented_interfaces: [],
42
- properties: [],
43
- fields: this.fields,
44
- constructors: [],
45
- enums: [],
46
- interfaces: [],
47
- classes: [],
48
- access_modifier: 'public',
49
- docComment: this.docComment,
50
- };
51
- }
52
- }
53
- exports.ClassMirrorBuilder = ClassMirrorBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClassMirrorBuilder = void 0;
4
+ /**
5
+ * Builder class to create ClassMirror objects.
6
+ * For testing purposes only.
7
+ */
8
+ class ClassMirrorBuilder {
9
+ constructor() {
10
+ this.name = 'SampleClass';
11
+ this.annotations = [];
12
+ this.methods = [];
13
+ this.fields = [];
14
+ }
15
+ withName(name) {
16
+ this.name = name;
17
+ return this;
18
+ }
19
+ addAnnotation(annotation) {
20
+ this.annotations.push(annotation);
21
+ return this;
22
+ }
23
+ withDocComment(docComment) {
24
+ this.docComment = docComment;
25
+ return this;
26
+ }
27
+ addMethod(method) {
28
+ this.methods.push(method);
29
+ return this;
30
+ }
31
+ addFiled(field) {
32
+ this.fields.push(field);
33
+ return this;
34
+ }
35
+ build() {
36
+ return {
37
+ annotations: this.annotations,
38
+ name: this.name,
39
+ type_name: 'class',
40
+ methods: this.methods,
41
+ implemented_interfaces: [],
42
+ properties: [],
43
+ fields: this.fields,
44
+ constructors: [],
45
+ enums: [],
46
+ interfaces: [],
47
+ classes: [],
48
+ access_modifier: 'public',
49
+ docComment: this.docComment,
50
+ };
51
+ }
52
+ }
53
+ exports.ClassMirrorBuilder = ClassMirrorBuilder;
54
54
  //# sourceMappingURL=ClassMirrorBuilder.js.map
@@ -1,8 +1,8 @@
1
- import { DocCommentAnnotation } from '@cparra/apex-reflection';
2
- export declare class DocCommentAnnotationBuilder {
3
- private name;
4
- private bodyLines;
5
- withName(name: string): DocCommentAnnotationBuilder;
6
- withBodyLines(bodyLines: string[]): DocCommentAnnotationBuilder;
7
- build(): DocCommentAnnotation;
8
- }
1
+ import { DocCommentAnnotation } from '@cparra/apex-reflection';
2
+ export declare class DocCommentAnnotationBuilder {
3
+ private name;
4
+ private bodyLines;
5
+ withName(name: string): DocCommentAnnotationBuilder;
6
+ withBodyLines(bodyLines: string[]): DocCommentAnnotationBuilder;
7
+ build(): DocCommentAnnotation;
8
+ }
@@ -1,26 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocCommentAnnotationBuilder = void 0;
4
- class DocCommentAnnotationBuilder {
5
- constructor() {
6
- this.name = '';
7
- this.bodyLines = [];
8
- }
9
- withName(name) {
10
- this.name = name;
11
- return this;
12
- }
13
- withBodyLines(bodyLines) {
14
- this.bodyLines = bodyLines;
15
- return this;
16
- }
17
- build() {
18
- return {
19
- name: this.name,
20
- body: '',
21
- bodyLines: this.bodyLines,
22
- };
23
- }
24
- }
25
- exports.DocCommentAnnotationBuilder = DocCommentAnnotationBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocCommentAnnotationBuilder = void 0;
4
+ class DocCommentAnnotationBuilder {
5
+ constructor() {
6
+ this.name = '';
7
+ this.bodyLines = [];
8
+ }
9
+ withName(name) {
10
+ this.name = name;
11
+ return this;
12
+ }
13
+ withBodyLines(bodyLines) {
14
+ this.bodyLines = bodyLines;
15
+ return this;
16
+ }
17
+ build() {
18
+ return {
19
+ name: this.name,
20
+ body: '',
21
+ bodyLines: this.bodyLines,
22
+ };
23
+ }
24
+ }
25
+ exports.DocCommentAnnotationBuilder = DocCommentAnnotationBuilder;
26
26
  //# sourceMappingURL=DocCommentAnnotationBuilder.js.map
@@ -1,12 +1,12 @@
1
- import { DocComment, DocCommentAnnotation } from '@cparra/apex-reflection';
2
- /**
3
- * Builder class to create DocComment objects.
4
- * For testing purposes only.
5
- */
6
- export declare class DocCommentBuilder {
7
- private description?;
8
- private annotations;
9
- addAnnotation(annotation: DocCommentAnnotation): DocCommentBuilder;
10
- withDescription(description: string): DocCommentBuilder;
11
- build(): DocComment;
12
- }
1
+ import { DocComment, DocCommentAnnotation } from '@cparra/apex-reflection';
2
+ /**
3
+ * Builder class to create DocComment objects.
4
+ * For testing purposes only.
5
+ */
6
+ export declare class DocCommentBuilder {
7
+ private description?;
8
+ private annotations;
9
+ addAnnotation(annotation: DocCommentAnnotation): DocCommentBuilder;
10
+ withDescription(description: string): DocCommentBuilder;
11
+ build(): DocComment;
12
+ }
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocCommentBuilder = void 0;
4
- /**
5
- * Builder class to create DocComment objects.
6
- * For testing purposes only.
7
- */
8
- class DocCommentBuilder {
9
- constructor() {
10
- this.annotations = [];
11
- }
12
- addAnnotation(annotation) {
13
- this.annotations.push(annotation);
14
- return this;
15
- }
16
- withDescription(description) {
17
- this.description = description;
18
- return this;
19
- }
20
- build() {
21
- var _a;
22
- return {
23
- paramAnnotations: [],
24
- returnAnnotation: {
25
- bodyLines: [],
26
- },
27
- exampleAnnotation: {
28
- bodyLines: [],
29
- },
30
- throwsAnnotations: [],
31
- annotations: this.annotations,
32
- descriptionLines: [],
33
- description: (_a = this.description) !== null && _a !== void 0 ? _a : 'Sample Description',
34
- };
35
- }
36
- }
37
- exports.DocCommentBuilder = DocCommentBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocCommentBuilder = void 0;
4
+ /**
5
+ * Builder class to create DocComment objects.
6
+ * For testing purposes only.
7
+ */
8
+ class DocCommentBuilder {
9
+ constructor() {
10
+ this.annotations = [];
11
+ }
12
+ addAnnotation(annotation) {
13
+ this.annotations.push(annotation);
14
+ return this;
15
+ }
16
+ withDescription(description) {
17
+ this.description = description;
18
+ return this;
19
+ }
20
+ build() {
21
+ var _a;
22
+ return {
23
+ paramAnnotations: [],
24
+ returnAnnotation: {
25
+ bodyLines: [],
26
+ },
27
+ exampleAnnotation: {
28
+ bodyLines: [],
29
+ },
30
+ throwsAnnotations: [],
31
+ annotations: this.annotations,
32
+ descriptionLines: [],
33
+ description: (_a = this.description) !== null && _a !== void 0 ? _a : 'Sample Description',
34
+ };
35
+ }
36
+ }
37
+ exports.DocCommentBuilder = DocCommentBuilder;
38
38
  //# sourceMappingURL=DocCommentBuilder.js.map
@@ -1,18 +1,18 @@
1
- import { DocComment, FieldMirror } from '@cparra/apex-reflection';
2
- import { ReferencedType } from '@cparra/apex-reflection/index';
3
- type MemberModifier = 'static' | 'webservice' | 'final' | 'override' | 'testmethod' | 'transient';
4
- export declare class FieldMirrorBuilder {
5
- private docComment;
6
- private accessModifier;
7
- private name;
8
- private memberModifiers;
9
- private type;
10
- withAccessModifier(accessModifier: string): FieldMirrorBuilder;
11
- withName(name: string): FieldMirrorBuilder;
12
- withType(type: string): FieldMirrorBuilder;
13
- withReferencedType(type: ReferencedType): FieldMirrorBuilder;
14
- addMemberModifier(memberModifier: MemberModifier): FieldMirrorBuilder;
15
- withDocComment(docComment: DocComment): FieldMirrorBuilder;
16
- build(): FieldMirror;
17
- }
18
- export {};
1
+ import { DocComment, FieldMirror } from '@cparra/apex-reflection';
2
+ import { ReferencedType } from '@cparra/apex-reflection';
3
+ type MemberModifier = 'static' | 'webservice' | 'final' | 'override' | 'testmethod' | 'transient';
4
+ export declare class FieldMirrorBuilder {
5
+ private docComment;
6
+ private accessModifier;
7
+ private name;
8
+ private memberModifiers;
9
+ private type;
10
+ withAccessModifier(accessModifier: string): FieldMirrorBuilder;
11
+ withName(name: string): FieldMirrorBuilder;
12
+ withType(type: string): FieldMirrorBuilder;
13
+ withReferencedType(type: ReferencedType): FieldMirrorBuilder;
14
+ addMemberModifier(memberModifier: MemberModifier): FieldMirrorBuilder;
15
+ withDocComment(docComment: DocComment): FieldMirrorBuilder;
16
+ build(): FieldMirror;
17
+ }
18
+ export {};