@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.
- package/.eslintrc.js +12 -12
- package/.github/workflows/ci.yaml +22 -0
- package/.github/workflows/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +742 -718
- package/apexdocs.config.ts +13 -13
- package/docs/{README.md → __old/README.md} +1 -1
- package/docs/{restapi.json → __old/restapi.json} +589 -589
- package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
- package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
- package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
- package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
- package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
- package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
- package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
- package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
- package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
- package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
- package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
- package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
- package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
- package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
- package/examples/includes/header.md +3 -3
- package/examples/plain-markdown/.forceignore +12 -0
- package/examples/plain-markdown/README.md +301 -0
- package/examples/plain-markdown/config/project-scratch-def.json +5 -0
- package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
- package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
- package/examples/plain-markdown/package-lock.json +665 -0
- package/examples/plain-markdown/package.json +24 -0
- package/examples/plain-markdown/sfdx-project.json +12 -0
- package/examples/plain-markdown/template.md +3 -0
- package/jest.config.js +5 -5
- package/lib/adapters/apex-types.d.ts +5 -0
- package/lib/adapters/apex-types.js +34 -0
- package/lib/adapters/apex-types.js.map +1 -0
- package/lib/adapters/documentables.d.ts +6 -0
- package/lib/adapters/documentables.js +41 -0
- package/lib/adapters/documentables.js.map +1 -0
- package/lib/adapters/fields-and-properties.d.ts +3 -0
- package/lib/adapters/fields-and-properties.js +10 -0
- package/lib/adapters/fields-and-properties.js.map +1 -0
- package/lib/adapters/methods-and-constructors.d.ts +4 -0
- package/lib/adapters/methods-and-constructors.js +49 -0
- package/lib/adapters/methods-and-constructors.js.map +1 -0
- package/lib/adapters/references.d.ts +5 -0
- package/lib/adapters/references.js +82 -0
- package/lib/adapters/references.js.map +1 -0
- package/lib/adapters/type-utils.d.ts +2 -0
- package/lib/adapters/type-utils.js +8 -0
- package/lib/adapters/type-utils.js.map +1 -0
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +79 -76
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +156 -130
- package/lib/cli/generate.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -17
- package/lib/model/apex-bundle.d.ts +6 -6
- package/lib/model/apex-bundle.js +10 -10
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
- package/lib/model/inheritance.d.ts +8 -8
- package/lib/model/inheritance.js +2 -2
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +46 -46
- package/lib/model/manifest.js.map +1 -1
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +109 -106
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
- package/lib/model/markdown-generation-util/index.d.ts +3 -3
- package/lib/model/markdown-generation-util/index.js +19 -19
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
- package/lib/model/markdown-home-file.d.ts +11 -11
- package/lib/model/markdown-home-file.js +56 -53
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +136 -133
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/apex-doc-types.d.ts +19 -19
- package/lib/model/openapi/apex-doc-types.js +4 -4
- package/lib/model/openapi/open-api-types.d.ts +93 -93
- package/lib/model/openapi/open-api-types.js +2 -2
- package/lib/model/openapi/open-api.d.ts +16 -16
- package/lib/model/openapi/open-api.js +33 -33
- package/lib/model/openapi/openapi-type-file.d.ts +7 -7
- package/lib/model/openapi/openapi-type-file.js +16 -16
- package/lib/model/outputFile.d.ts +10 -10
- package/lib/model/outputFile.js +28 -28
- package/lib/model/types-repository.d.ts +16 -16
- package/lib/model/types-repository.js +53 -53
- package/lib/service/apex-file-reader.d.ts +14 -14
- package/lib/service/apex-file-reader.js +48 -45
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +47 -24
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +56 -33
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +16 -13
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/metadata-processor.d.ts +3 -3
- package/lib/service/metadata-processor.js +16 -16
- package/lib/service/parser.d.ts +21 -21
- package/lib/service/parser.js +137 -134
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.d.ts +9 -9
- package/lib/service/state.js +19 -19
- package/lib/service/walkers/class-walker.d.ts +4 -4
- package/lib/service/walkers/class-walker.js +32 -32
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/walker-factory.d.ts +5 -5
- package/lib/service/walkers/walker-factory.js +20 -20
- package/lib/service/walkers/walker.d.ts +19 -19
- package/lib/service/walkers/walker.js +16 -16
- package/lib/settings.d.ts +70 -64
- package/lib/settings.js +99 -88
- package/lib/settings.js.map +1 -1
- package/lib/templating/compile.d.ts +7 -0
- package/lib/templating/compile.js +98 -0
- package/lib/templating/compile.js.map +1 -0
- package/lib/templating/helpers.d.ts +2 -0
- package/lib/templating/helpers.js +18 -0
- package/lib/templating/helpers.js.map +1 -0
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
- package/lib/test-helpers/AnnotationBuilder.js +30 -30
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
- package/lib/test-helpers/DocCommentBuilder.js +37 -37
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
- package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
- package/lib/test-helpers/SettingsBuilder.js +26 -26
- package/lib/transpiler/factory.d.ts +6 -6
- package/lib/transpiler/factory.js +34 -31
- package/lib/transpiler/factory.js.map +1 -1
- package/lib/transpiler/file-container.d.ts +6 -6
- package/lib/transpiler/file-container.js +15 -15
- package/lib/transpiler/generator-choices.d.ts +1 -1
- package/lib/transpiler/generator-choices.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
- package/lib/transpiler/processor-type-transpiler.js +8 -8
- package/lib/transpiler/transpiler.d.ts +5 -5
- package/lib/transpiler/transpiler.js +29 -26
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +60 -57
- package/lib/util/logger.js.map +1 -1
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/package.json +79 -78
- package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
- package/src/adapters/__tests__/references.spec.ts +115 -0
- package/src/adapters/apex-types.ts +67 -0
- package/src/adapters/documentables.ts +58 -0
- package/src/adapters/fields-and-properties.ts +14 -0
- package/src/adapters/methods-and-constructors.ts +78 -0
- package/src/adapters/references.ts +113 -0
- package/src/adapters/type-utils.ts +5 -0
- package/src/adapters/types.d.ts +8 -0
- package/src/cli/generate.ts +3 -0
- package/src/model/__tests__/manifest.spec.ts +1 -0
- package/src/model/manifest.ts +3 -3
- package/src/model/markdown-file.ts +1 -1
- package/src/model/openapi/open-api-types.ts +2 -2
- package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
- package/src/service/__tests__/manifest-factory.spec.ts +1 -2
- package/src/settings.ts +15 -0
- package/src/templating/__tests__/compile.spec.ts +741 -0
- package/src/templating/compile.ts +187 -0
- package/src/templating/helpers.ts +14 -0
- package/src/templating/types.d.ts +104 -0
- package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
- package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
- package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
- package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
- package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
- package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
- package/src/transpiler/openapi/parsers/Builder.ts +1 -1
- package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
- package/src/util/error-logger.ts +4 -4
- package/src/util/logger.ts +3 -3
- package/tsconfig.json +21 -20
- package/tslint.json +5 -5
- package/lib/model/manifest-diff.d.ts +0 -27
- package/lib/model/manifest-diff.js +0 -69
- package/lib/model/manifest-diff.js.map +0 -1
- package/src/model/__tests__/manifest-diff.spec.ts +0 -139
- package/src/model/manifest-diff.ts +0 -94
- /package/docs/{index.html → __old/index.html} +0 -0
- /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
- /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
- /package/docs/{types → __old/types}/README.md +0 -0
- /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./type-declaration-util"), exports);
|
|
18
|
-
__exportStar(require("./method-declaration-util"), exports);
|
|
19
|
-
__exportStar(require("./field-declaration-util"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./type-declaration-util"), exports);
|
|
18
|
+
__exportStar(require("./method-declaration-util"), exports);
|
|
19
|
+
__exportStar(require("./field-declaration-util"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConstructorMirror } from '@cparra/apex-reflection';
|
|
2
|
-
import { MarkdownFile } from '../markdown-file';
|
|
3
|
-
import { MethodMirrorWithInheritance } from '../inheritance';
|
|
4
|
-
export declare function declareMethod(markdownFile: MarkdownFile, methods: ConstructorMirror[] | MethodMirrorWithInheritance[], startingHeadingLevel: number, className?: string): void;
|
|
1
|
+
import { ConstructorMirror } from '@cparra/apex-reflection';
|
|
2
|
+
import { MarkdownFile } from '../markdown-file';
|
|
3
|
+
import { MethodMirrorWithInheritance } from '../inheritance';
|
|
4
|
+
export declare function declareMethod(markdownFile: MarkdownFile, methods: ConstructorMirror[] | MethodMirrorWithInheritance[], startingHeadingLevel: number, className?: string): void;
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.declareMethod = void 0;
|
|
4
|
-
const doc_comment_annotation_util_1 = require("./doc-comment-annotation-util");
|
|
5
|
-
function declareMethod(markdownFile, methods, startingHeadingLevel, className = '') {
|
|
6
|
-
methods.forEach((currentMethod) => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
const signatureName = isMethod(currentMethod)
|
|
9
|
-
? `${currentMethod.typeReference.rawDeclaration} ${currentMethod.name}`
|
|
10
|
-
: className;
|
|
11
|
-
markdownFile.addTitle(`\`${buildSignature(currentMethod.access_modifier, signatureName, currentMethod)}\``, startingHeadingLevel + 2);
|
|
12
|
-
// Inheritance tag
|
|
13
|
-
if (isMethod(currentMethod)) {
|
|
14
|
-
const asMethodMirror = currentMethod;
|
|
15
|
-
if (asMethodMirror.inherited) {
|
|
16
|
-
markdownFile.addBlankLine();
|
|
17
|
-
markdownFile.addText('*Inherited*');
|
|
18
|
-
markdownFile.addBlankLine();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
currentMethod.annotations.forEach((annotation) => {
|
|
22
|
-
markdownFile.addBlankLine();
|
|
23
|
-
markdownFile.addText(`\`${annotation.type.toUpperCase()}\``);
|
|
24
|
-
});
|
|
25
|
-
if ((_a = currentMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
|
|
26
|
-
markdownFile.addBlankLine();
|
|
27
|
-
markdownFile.addText(currentMethod.docComment.description);
|
|
28
|
-
markdownFile.addBlankLine();
|
|
29
|
-
}
|
|
30
|
-
if (currentMethod.parameters.length) {
|
|
31
|
-
addParameters(markdownFile, currentMethod, startingHeadingLevel);
|
|
32
|
-
}
|
|
33
|
-
if (isMethod(currentMethod)) {
|
|
34
|
-
addReturns(markdownFile, currentMethod, startingHeadingLevel);
|
|
35
|
-
}
|
|
36
|
-
addThrowsBlock(markdownFile, currentMethod, startingHeadingLevel);
|
|
37
|
-
(0, doc_comment_annotation_util_1.addCustomDocCommentAnnotations)(markdownFile, currentMethod);
|
|
38
|
-
(0, doc_comment_annotation_util_1.addMermaid)(markdownFile, currentMethod);
|
|
39
|
-
if ((_b = currentMethod.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) {
|
|
40
|
-
addExample(markdownFile, currentMethod, startingHeadingLevel);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
markdownFile.addHorizontalRule();
|
|
44
|
-
}
|
|
45
|
-
exports.declareMethod = declareMethod;
|
|
46
|
-
function buildSignature(accessModifier, name, parameterAware) {
|
|
47
|
-
let signature = `${name}(`;
|
|
48
|
-
if (isMethod(parameterAware) && parameterAware.memberModifiers.length) {
|
|
49
|
-
signature =
|
|
50
|
-
accessModifier +
|
|
51
|
-
' ' +
|
|
52
|
-
parameterAware.memberModifiers.join(' ') +
|
|
53
|
-
' ' +
|
|
54
|
-
signature;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
signature = accessModifier + ' ' + signature;
|
|
58
|
-
}
|
|
59
|
-
const signatureParameters = parameterAware.parameters.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`);
|
|
60
|
-
signature += signatureParameters.join(', ');
|
|
61
|
-
return `${signature})`;
|
|
62
|
-
}
|
|
63
|
-
function addParameters(markdownFile, methodModel, startingHeadingLevel) {
|
|
64
|
-
var _a, _b;
|
|
65
|
-
if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.length)) {
|
|
66
|
-
// If there are no parameters defined in the docs then we don't want to display this section
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
markdownFile.addTitle('Parameters', startingHeadingLevel + 3);
|
|
70
|
-
markdownFile.initializeTable('Param', 'Description');
|
|
71
|
-
(_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.paramAnnotations.forEach((paramAnnotation) => {
|
|
72
|
-
const paramName = paramAnnotation.paramName;
|
|
73
|
-
const paramDescription = paramAnnotation.bodyLines.join(' ');
|
|
74
|
-
markdownFile.addTableRow(`\`${paramName}\``, paramDescription);
|
|
75
|
-
});
|
|
76
|
-
markdownFile.addBlankLine();
|
|
77
|
-
}
|
|
78
|
-
function addReturns(markdownFile, methodModel, startingHeadingLevel) {
|
|
79
|
-
var _a, _b;
|
|
80
|
-
if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation)) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
markdownFile.addTitle('Returns', startingHeadingLevel + 3);
|
|
84
|
-
markdownFile.initializeTable('Type', 'Description');
|
|
85
|
-
markdownFile.addTableRow(`\`${methodModel.typeReference.rawDeclaration}\``, (_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.returnAnnotation.bodyLines.join(' '));
|
|
86
|
-
markdownFile.addBlankLine();
|
|
87
|
-
}
|
|
88
|
-
function addThrowsBlock(markdownFile, docCommentAware, startingHeadingLevel) {
|
|
89
|
-
var _a, _b;
|
|
90
|
-
if (!((_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.length)) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
markdownFile.addTitle('Throws', startingHeadingLevel + 3);
|
|
94
|
-
markdownFile.initializeTable('Exception', 'Description');
|
|
95
|
-
(_b = docCommentAware.docComment) === null || _b === void 0 ? void 0 : _b.throwsAnnotations.forEach((annotation) => {
|
|
96
|
-
const exceptionName = annotation.exceptionName;
|
|
97
|
-
const exceptionDescription = annotation.bodyLines.join(' ');
|
|
98
|
-
markdownFile.addTableRow(`\`${exceptionName}\``, exceptionDescription);
|
|
99
|
-
});
|
|
100
|
-
markdownFile.addBlankLine();
|
|
101
|
-
}
|
|
102
|
-
function addExample(markdownFile, docCommentAware, startingHeadingLevel) {
|
|
103
|
-
var _a;
|
|
104
|
-
markdownFile.addTitle('Example', startingHeadingLevel + 3);
|
|
105
|
-
markdownFile.startCodeBlock();
|
|
106
|
-
(_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.exampleAnnotation.bodyLines.forEach((line) => {
|
|
107
|
-
markdownFile.addText(line, false);
|
|
108
|
-
});
|
|
109
|
-
markdownFile.endCodeBlock();
|
|
110
|
-
markdownFile.addBlankLine();
|
|
111
|
-
}
|
|
112
|
-
function isMethod(method) {
|
|
113
|
-
return method.typeReference !== undefined;
|
|
114
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.declareMethod = void 0;
|
|
4
|
+
const doc_comment_annotation_util_1 = require("./doc-comment-annotation-util");
|
|
5
|
+
function declareMethod(markdownFile, methods, startingHeadingLevel, className = '') {
|
|
6
|
+
methods.forEach((currentMethod) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const signatureName = isMethod(currentMethod)
|
|
9
|
+
? `${currentMethod.typeReference.rawDeclaration} ${currentMethod.name}`
|
|
10
|
+
: className;
|
|
11
|
+
markdownFile.addTitle(`\`${buildSignature(currentMethod.access_modifier, signatureName, currentMethod)}\``, startingHeadingLevel + 2);
|
|
12
|
+
// Inheritance tag
|
|
13
|
+
if (isMethod(currentMethod)) {
|
|
14
|
+
const asMethodMirror = currentMethod;
|
|
15
|
+
if (asMethodMirror.inherited) {
|
|
16
|
+
markdownFile.addBlankLine();
|
|
17
|
+
markdownFile.addText('*Inherited*');
|
|
18
|
+
markdownFile.addBlankLine();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
currentMethod.annotations.forEach((annotation) => {
|
|
22
|
+
markdownFile.addBlankLine();
|
|
23
|
+
markdownFile.addText(`\`${annotation.type.toUpperCase()}\``);
|
|
24
|
+
});
|
|
25
|
+
if ((_a = currentMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
|
|
26
|
+
markdownFile.addBlankLine();
|
|
27
|
+
markdownFile.addText(currentMethod.docComment.description);
|
|
28
|
+
markdownFile.addBlankLine();
|
|
29
|
+
}
|
|
30
|
+
if (currentMethod.parameters.length) {
|
|
31
|
+
addParameters(markdownFile, currentMethod, startingHeadingLevel);
|
|
32
|
+
}
|
|
33
|
+
if (isMethod(currentMethod)) {
|
|
34
|
+
addReturns(markdownFile, currentMethod, startingHeadingLevel);
|
|
35
|
+
}
|
|
36
|
+
addThrowsBlock(markdownFile, currentMethod, startingHeadingLevel);
|
|
37
|
+
(0, doc_comment_annotation_util_1.addCustomDocCommentAnnotations)(markdownFile, currentMethod);
|
|
38
|
+
(0, doc_comment_annotation_util_1.addMermaid)(markdownFile, currentMethod);
|
|
39
|
+
if ((_b = currentMethod.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) {
|
|
40
|
+
addExample(markdownFile, currentMethod, startingHeadingLevel);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
markdownFile.addHorizontalRule();
|
|
44
|
+
}
|
|
45
|
+
exports.declareMethod = declareMethod;
|
|
46
|
+
function buildSignature(accessModifier, name, parameterAware) {
|
|
47
|
+
let signature = `${name}(`;
|
|
48
|
+
if (isMethod(parameterAware) && parameterAware.memberModifiers.length) {
|
|
49
|
+
signature =
|
|
50
|
+
accessModifier +
|
|
51
|
+
' ' +
|
|
52
|
+
parameterAware.memberModifiers.join(' ') +
|
|
53
|
+
' ' +
|
|
54
|
+
signature;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
signature = accessModifier + ' ' + signature;
|
|
58
|
+
}
|
|
59
|
+
const signatureParameters = parameterAware.parameters.map((param) => `${param.typeReference.rawDeclaration} ${param.name}`);
|
|
60
|
+
signature += signatureParameters.join(', ');
|
|
61
|
+
return `${signature})`;
|
|
62
|
+
}
|
|
63
|
+
function addParameters(markdownFile, methodModel, startingHeadingLevel) {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.length)) {
|
|
66
|
+
// If there are no parameters defined in the docs then we don't want to display this section
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
markdownFile.addTitle('Parameters', startingHeadingLevel + 3);
|
|
70
|
+
markdownFile.initializeTable('Param', 'Description');
|
|
71
|
+
(_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.paramAnnotations.forEach((paramAnnotation) => {
|
|
72
|
+
const paramName = paramAnnotation.paramName;
|
|
73
|
+
const paramDescription = paramAnnotation.bodyLines.join(' ');
|
|
74
|
+
markdownFile.addTableRow(`\`${paramName}\``, paramDescription);
|
|
75
|
+
});
|
|
76
|
+
markdownFile.addBlankLine();
|
|
77
|
+
}
|
|
78
|
+
function addReturns(markdownFile, methodModel, startingHeadingLevel) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
markdownFile.addTitle('Returns', startingHeadingLevel + 3);
|
|
84
|
+
markdownFile.initializeTable('Type', 'Description');
|
|
85
|
+
markdownFile.addTableRow(`\`${methodModel.typeReference.rawDeclaration}\``, (_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.returnAnnotation.bodyLines.join(' '));
|
|
86
|
+
markdownFile.addBlankLine();
|
|
87
|
+
}
|
|
88
|
+
function addThrowsBlock(markdownFile, docCommentAware, startingHeadingLevel) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
if (!((_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.length)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
markdownFile.addTitle('Throws', startingHeadingLevel + 3);
|
|
94
|
+
markdownFile.initializeTable('Exception', 'Description');
|
|
95
|
+
(_b = docCommentAware.docComment) === null || _b === void 0 ? void 0 : _b.throwsAnnotations.forEach((annotation) => {
|
|
96
|
+
const exceptionName = annotation.exceptionName;
|
|
97
|
+
const exceptionDescription = annotation.bodyLines.join(' ');
|
|
98
|
+
markdownFile.addTableRow(`\`${exceptionName}\``, exceptionDescription);
|
|
99
|
+
});
|
|
100
|
+
markdownFile.addBlankLine();
|
|
101
|
+
}
|
|
102
|
+
function addExample(markdownFile, docCommentAware, startingHeadingLevel) {
|
|
103
|
+
var _a;
|
|
104
|
+
markdownFile.addTitle('Example', startingHeadingLevel + 3);
|
|
105
|
+
markdownFile.startCodeBlock();
|
|
106
|
+
(_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.exampleAnnotation.bodyLines.forEach((line) => {
|
|
107
|
+
markdownFile.addText(line, false);
|
|
108
|
+
});
|
|
109
|
+
markdownFile.endCodeBlock();
|
|
110
|
+
markdownFile.addBlankLine();
|
|
111
|
+
}
|
|
112
|
+
function isMethod(method) {
|
|
113
|
+
return method.typeReference !== undefined;
|
|
114
|
+
}
|
|
115
115
|
//# sourceMappingURL=method-declaration-util.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MarkdownFile } from '../markdown-file';
|
|
2
|
-
import { Type } from '@cparra/apex-reflection';
|
|
3
|
-
export declare function declareType(markdownFile: MarkdownFile, typeMirror: Type): void;
|
|
1
|
+
import { MarkdownFile } from '../markdown-file';
|
|
2
|
+
import { Type } from '@cparra/apex-reflection';
|
|
3
|
+
export declare function declareType(markdownFile: MarkdownFile, typeMirror: Type): void;
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.declareType = void 0;
|
|
4
|
-
const doc_comment_annotation_util_1 = require("./doc-comment-annotation-util");
|
|
5
|
-
const types_repository_1 = require("../types-repository");
|
|
6
|
-
function declareType(markdownFile, typeMirror) {
|
|
7
|
-
var _a;
|
|
8
|
-
typeMirror.annotations.forEach((currentAnnotation) => {
|
|
9
|
-
markdownFile.addBlankLine();
|
|
10
|
-
markdownFile.addText(`\`${currentAnnotation.type.toUpperCase()}\``);
|
|
11
|
-
});
|
|
12
|
-
if ((_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines) {
|
|
13
|
-
markdownFile.addBlankLine();
|
|
14
|
-
for (const currentLine of typeMirror.docComment.descriptionLines) {
|
|
15
|
-
markdownFile.addText(currentLine);
|
|
16
|
-
}
|
|
17
|
-
markdownFile.addBlankLine();
|
|
18
|
-
}
|
|
19
|
-
if (typeMirror.type_name === 'class') {
|
|
20
|
-
addInheritanceSectionForClass(typeMirror, markdownFile);
|
|
21
|
-
}
|
|
22
|
-
if (typeMirror.type_name === 'interface') {
|
|
23
|
-
addInheritanceSectionForInterface(typeMirror, markdownFile);
|
|
24
|
-
}
|
|
25
|
-
(0, doc_comment_annotation_util_1.addCustomDocCommentAnnotations)(markdownFile, typeMirror);
|
|
26
|
-
(0, doc_comment_annotation_util_1.addMermaid)(markdownFile, typeMirror);
|
|
27
|
-
}
|
|
28
|
-
exports.declareType = declareType;
|
|
29
|
-
function addInheritanceSectionForClass(typeMirror, markdownFile) {
|
|
30
|
-
const typeAsClass = typeMirror;
|
|
31
|
-
if (typeAsClass.extended_class) {
|
|
32
|
-
markdownFile.addBlankLine();
|
|
33
|
-
markdownFile.addText('**Inheritance**');
|
|
34
|
-
markdownFile.addBlankLine();
|
|
35
|
-
addParent(markdownFile, typeAsClass);
|
|
36
|
-
markdownFile.addText(typeMirror.name);
|
|
37
|
-
markdownFile.addBlankLine();
|
|
38
|
-
}
|
|
39
|
-
if (typeAsClass.implemented_interfaces.length) {
|
|
40
|
-
markdownFile.addBlankLine();
|
|
41
|
-
markdownFile.addText('**Implemented types**');
|
|
42
|
-
markdownFile.addBlankLine();
|
|
43
|
-
for (let i = 0; i < typeAsClass.implemented_interfaces.length; i++) {
|
|
44
|
-
const currentName = typeAsClass.implemented_interfaces[i];
|
|
45
|
-
markdownFile.addLink(currentName);
|
|
46
|
-
if (i < typeAsClass.implemented_interfaces.length - 1) {
|
|
47
|
-
markdownFile.addText(', ');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
markdownFile.addBlankLine();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function addInheritanceSectionForInterface(typeMirror, markdownFile) {
|
|
54
|
-
const typeAsInterface = typeMirror;
|
|
55
|
-
if (typeAsInterface.extended_interfaces.length) {
|
|
56
|
-
markdownFile.addBlankLine();
|
|
57
|
-
markdownFile.addText('**Extended types**');
|
|
58
|
-
markdownFile.addBlankLine();
|
|
59
|
-
for (let i = 0; i < typeAsInterface.extended_interfaces.length; i++) {
|
|
60
|
-
const currentName = typeAsInterface.extended_interfaces[i];
|
|
61
|
-
markdownFile.addLink(currentName);
|
|
62
|
-
if (i < typeAsInterface.extended_interfaces.length - 1) {
|
|
63
|
-
markdownFile.addText(', ');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function addParent(markdownFile, classMirror) {
|
|
69
|
-
if (!classMirror.extended_class) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const parentType = types_repository_1.TypesRepository.getInstance().getFromScopedByName(classMirror.extended_class);
|
|
73
|
-
if (!parentType) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (parentType.type_name === 'class') {
|
|
77
|
-
addParent(markdownFile, parentType);
|
|
78
|
-
}
|
|
79
|
-
markdownFile.addLink(parentType.name);
|
|
80
|
-
markdownFile.addText(' > ');
|
|
81
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.declareType = void 0;
|
|
4
|
+
const doc_comment_annotation_util_1 = require("./doc-comment-annotation-util");
|
|
5
|
+
const types_repository_1 = require("../types-repository");
|
|
6
|
+
function declareType(markdownFile, typeMirror) {
|
|
7
|
+
var _a;
|
|
8
|
+
typeMirror.annotations.forEach((currentAnnotation) => {
|
|
9
|
+
markdownFile.addBlankLine();
|
|
10
|
+
markdownFile.addText(`\`${currentAnnotation.type.toUpperCase()}\``);
|
|
11
|
+
});
|
|
12
|
+
if ((_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines) {
|
|
13
|
+
markdownFile.addBlankLine();
|
|
14
|
+
for (const currentLine of typeMirror.docComment.descriptionLines) {
|
|
15
|
+
markdownFile.addText(currentLine);
|
|
16
|
+
}
|
|
17
|
+
markdownFile.addBlankLine();
|
|
18
|
+
}
|
|
19
|
+
if (typeMirror.type_name === 'class') {
|
|
20
|
+
addInheritanceSectionForClass(typeMirror, markdownFile);
|
|
21
|
+
}
|
|
22
|
+
if (typeMirror.type_name === 'interface') {
|
|
23
|
+
addInheritanceSectionForInterface(typeMirror, markdownFile);
|
|
24
|
+
}
|
|
25
|
+
(0, doc_comment_annotation_util_1.addCustomDocCommentAnnotations)(markdownFile, typeMirror);
|
|
26
|
+
(0, doc_comment_annotation_util_1.addMermaid)(markdownFile, typeMirror);
|
|
27
|
+
}
|
|
28
|
+
exports.declareType = declareType;
|
|
29
|
+
function addInheritanceSectionForClass(typeMirror, markdownFile) {
|
|
30
|
+
const typeAsClass = typeMirror;
|
|
31
|
+
if (typeAsClass.extended_class) {
|
|
32
|
+
markdownFile.addBlankLine();
|
|
33
|
+
markdownFile.addText('**Inheritance**');
|
|
34
|
+
markdownFile.addBlankLine();
|
|
35
|
+
addParent(markdownFile, typeAsClass);
|
|
36
|
+
markdownFile.addText(typeMirror.name);
|
|
37
|
+
markdownFile.addBlankLine();
|
|
38
|
+
}
|
|
39
|
+
if (typeAsClass.implemented_interfaces.length) {
|
|
40
|
+
markdownFile.addBlankLine();
|
|
41
|
+
markdownFile.addText('**Implemented types**');
|
|
42
|
+
markdownFile.addBlankLine();
|
|
43
|
+
for (let i = 0; i < typeAsClass.implemented_interfaces.length; i++) {
|
|
44
|
+
const currentName = typeAsClass.implemented_interfaces[i];
|
|
45
|
+
markdownFile.addLink(currentName);
|
|
46
|
+
if (i < typeAsClass.implemented_interfaces.length - 1) {
|
|
47
|
+
markdownFile.addText(', ');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
markdownFile.addBlankLine();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function addInheritanceSectionForInterface(typeMirror, markdownFile) {
|
|
54
|
+
const typeAsInterface = typeMirror;
|
|
55
|
+
if (typeAsInterface.extended_interfaces.length) {
|
|
56
|
+
markdownFile.addBlankLine();
|
|
57
|
+
markdownFile.addText('**Extended types**');
|
|
58
|
+
markdownFile.addBlankLine();
|
|
59
|
+
for (let i = 0; i < typeAsInterface.extended_interfaces.length; i++) {
|
|
60
|
+
const currentName = typeAsInterface.extended_interfaces[i];
|
|
61
|
+
markdownFile.addLink(currentName);
|
|
62
|
+
if (i < typeAsInterface.extended_interfaces.length - 1) {
|
|
63
|
+
markdownFile.addText(', ');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function addParent(markdownFile, classMirror) {
|
|
69
|
+
if (!classMirror.extended_class) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const parentType = types_repository_1.TypesRepository.getInstance().getFromScopedByName(classMirror.extended_class);
|
|
73
|
+
if (!parentType) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (parentType.type_name === 'class') {
|
|
77
|
+
addParent(markdownFile, parentType);
|
|
78
|
+
}
|
|
79
|
+
markdownFile.addLink(parentType.name);
|
|
80
|
+
markdownFile.addText(' > ');
|
|
81
|
+
}
|
|
82
82
|
//# sourceMappingURL=type-declaration-util.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { MarkdownFile } from './markdown-file';
|
|
3
|
-
export declare class MarkdownHomeFile extends MarkdownFile {
|
|
4
|
-
fileName: string;
|
|
5
|
-
types: Type[];
|
|
6
|
-
constructor(fileName: string, types: Type[], headerContent?: string);
|
|
7
|
-
private addTypeEntries;
|
|
8
|
-
private addTypeEntry;
|
|
9
|
-
private group;
|
|
10
|
-
private getClassGroup;
|
|
11
|
-
}
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
import { MarkdownFile } from './markdown-file';
|
|
3
|
+
export declare class MarkdownHomeFile extends MarkdownFile {
|
|
4
|
+
fileName: string;
|
|
5
|
+
types: Type[];
|
|
6
|
+
constructor(fileName: string, types: Type[], headerContent?: string);
|
|
7
|
+
private addTypeEntries;
|
|
8
|
+
private addTypeEntry;
|
|
9
|
+
private group;
|
|
10
|
+
private getClassGroup;
|
|
11
|
+
}
|
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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.MarkdownHomeFile = void 0;
|
|
7
|
+
const class_file_generatorHelper_1 = __importDefault(require("../transpiler/markdown/class-file-generatorHelper"));
|
|
8
|
+
const markdown_file_1 = require("./markdown-file");
|
|
9
|
+
const string_utils_1 = require("../util/string-utils");
|
|
10
|
+
const settings_1 = require("../settings");
|
|
11
|
+
class MarkdownHomeFile extends markdown_file_1.MarkdownFile {
|
|
12
|
+
constructor(fileName, types, headerContent) {
|
|
13
|
+
super(fileName, '');
|
|
14
|
+
this.fileName = fileName;
|
|
15
|
+
this.types = types;
|
|
16
|
+
if (headerContent) {
|
|
17
|
+
this.addText(headerContent);
|
|
18
|
+
}
|
|
19
|
+
this.addTitle(settings_1.Settings.getInstance().getTitle());
|
|
20
|
+
this.addTypeEntries(types);
|
|
21
|
+
}
|
|
22
|
+
addTypeEntries(types) {
|
|
23
|
+
const groupedClasses = this.group(types);
|
|
24
|
+
groupedClasses.forEach((value, key) => {
|
|
25
|
+
this.addTitle(key, 2);
|
|
26
|
+
value.forEach((typeMirror) => {
|
|
27
|
+
this.addTypeEntry(typeMirror);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
addTypeEntry(typeMirror) {
|
|
32
|
+
var _a;
|
|
33
|
+
this.addBlankLine();
|
|
34
|
+
this.addTitle(class_file_generatorHelper_1.default.getFileLink(typeMirror), 3);
|
|
35
|
+
this.addBlankLine();
|
|
36
|
+
if ((_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines) {
|
|
37
|
+
const description = typeMirror.docComment.descriptionLines.reduce((previous, current) => previous + current + '\n', '');
|
|
38
|
+
this.addText((0, string_utils_1.truncate)(description, 300));
|
|
39
|
+
this.addBlankLine();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
group(classes) {
|
|
43
|
+
return classes.reduce((groups, currentClass) => {
|
|
44
|
+
const key = this.getClassGroup(currentClass);
|
|
45
|
+
const group = groups.get(key) || [];
|
|
46
|
+
group.push(currentClass);
|
|
47
|
+
groups.set(key, group);
|
|
48
|
+
return groups;
|
|
49
|
+
}, new Map());
|
|
50
|
+
}
|
|
51
|
+
getClassGroup(classModel) {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
return ((_c = (_b = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group')) === null || _b === void 0 ? void 0 : _b.body) !== null && _c !== void 0 ? _c : settings_1.Settings.getInstance().getDefaultGroupName());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.MarkdownHomeFile = MarkdownHomeFile;
|
|
54
57
|
//# sourceMappingURL=markdown-home-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-home-file.js","sourceRoot":"","sources":["../../src/model/markdown-home-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-home-file.js","sourceRoot":"","sources":["../../src/model/markdown-home-file.ts"],"names":[],"mappings":";;;;;;AACA,mHAAyF;AACzF,mDAA+C;AAC/C,uDAAgD;AAChD,0CAAuC;AAEvC,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAmB,QAAgB,EAAS,KAAa,EAAE,aAAsB;QAC/E,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QADH,aAAQ,GAAR,QAAQ,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAEvD,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7B;QACD,IAAI,CAAC,QAAQ,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAEO,cAAc,CAAC,KAAa;QAClC,MAAM,cAAc,GAAwB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9D,cAAc,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,GAAW,EAAE,EAAE;YACpD,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACtB,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBAC3B,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,YAAY,CAAC,UAAgB;;QACnC,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,oCAAwB,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,IAAI,MAAA,UAAU,CAAC,UAAU,0CAAE,gBAAgB,EAAE;YAC3C,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAC/D,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,QAAQ,GAAG,OAAO,GAAG,IAAI,EAChD,EAAE,CACH,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,IAAA,uBAAQ,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,YAAY,EAAE,CAAC;SACrB;IACH,CAAC;IAEO,KAAK,CAAC,OAAe;QAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAW,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IAChB,CAAC;IAEO,aAAa,CAAC,UAAgB;;QACpC,OAAO,CACL,MAAA,MAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,0CAAE,IAAI,mCAC1F,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAC7C,CAAC;IACJ,CAAC;CACF;AAnDD,4CAmDC"}
|