@cparra/apexdocs 2.22.0 → 2.23.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/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +718 -682
- package/apexdocs.config.ts +13 -11
- package/docs/README.md +1 -1
- package/docs/restapi.json +589 -589
- package/docs/types/Classes/nspc.ChildClass.md +21 -18
- package/docs/types/Main/nspc.SampleClass.md +13 -13
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -41
- 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/jest.config.js +5 -5
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +76 -76
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +130 -122
- 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-diff.d.ts +27 -27
- package/lib/model/manifest-diff.js +68 -68
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +46 -46
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +106 -106
- 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 +43 -43
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +54 -62
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- 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 +53 -53
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +133 -141
- 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 +45 -45
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +24 -24
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +33 -33
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +13 -13
- 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 +134 -134
- 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/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/enum-walker.js.map +1 -1
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/interface-walker.js.map +1 -1
- 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 -16
- package/lib/service/walkers/walker.js +16 -9
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +64 -53
- package/lib/settings.js +88 -78
- package/lib/settings.js.map +1 -1
- 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/MethodMirrorBuilder.d.ts +10 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +36 -36
- 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 +31 -31
- 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 +8 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +55 -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 -10
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -27
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -23
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +74 -74
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +166 -166
- 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 +225 -225
- 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 +26 -26
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +57 -57
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/package.json +78 -78
- package/src/cli/generate.ts +8 -0
- package/src/model/markdown-generation-util/field-declaration-util.ts +3 -9
- package/src/model/markdown-type-file.ts +4 -10
- package/src/service/walkers/class-walker.ts +6 -7
- package/src/service/walkers/enum-walker.ts +0 -1
- package/src/service/walkers/interface-walker.ts +1 -1
- package/src/service/walkers/walker.ts +8 -1
- package/src/settings.ts +21 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -2
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +26 -3
- package/tsconfig.json +20 -20
- package/tslint.json +5 -5
- package/ROADMAP.md +0 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DocComment } from '@cparra/apex-reflection';
|
|
2
|
-
import { MarkdownFile } from '../markdown-file';
|
|
3
|
-
interface DocCommentAware {
|
|
4
|
-
docComment?: DocComment;
|
|
5
|
-
}
|
|
6
|
-
export declare function addMermaid(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
7
|
-
export declare function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
8
|
-
export {};
|
|
1
|
+
import { DocComment } from '@cparra/apex-reflection';
|
|
2
|
+
import { MarkdownFile } from '../markdown-file';
|
|
3
|
+
interface DocCommentAware {
|
|
4
|
+
docComment?: DocComment;
|
|
5
|
+
}
|
|
6
|
+
export declare function addMermaid(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
7
|
+
export declare function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
8
|
+
export {};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addCustomDocCommentAnnotations = exports.addMermaid = void 0;
|
|
4
|
-
const class_file_generatorHelper_1 = require("../../transpiler/markdown/class-file-generatorHelper");
|
|
5
|
-
function addMermaid(markdownFile, docCommentAware) {
|
|
6
|
-
var _a;
|
|
7
|
-
const mermaid = (_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'mermaid');
|
|
8
|
-
if (!mermaid) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
markdownFile.addBlankLine();
|
|
12
|
-
markdownFile.startCodeBlock('mermaid');
|
|
13
|
-
mermaid.bodyLines.forEach((line) => {
|
|
14
|
-
markdownFile.addText(line, false);
|
|
15
|
-
});
|
|
16
|
-
markdownFile.endCodeBlock();
|
|
17
|
-
markdownFile.addBlankLine();
|
|
18
|
-
}
|
|
19
|
-
exports.addMermaid = addMermaid;
|
|
20
|
-
function addCustomDocCommentAnnotations(markdownFile, docCommentAware) {
|
|
21
|
-
var _a;
|
|
22
|
-
(_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => currentAnnotation.name !== 'description').filter((currentAnnotation) => currentAnnotation.name !== 'mermaid').forEach((currentAnnotation) => {
|
|
23
|
-
markdownFile.addBlankLine();
|
|
24
|
-
markdownFile.addText(buildDocAnnotationText(currentAnnotation));
|
|
25
|
-
markdownFile.addBlankLine();
|
|
26
|
-
});
|
|
27
|
-
function splitAndCapitalize(text) {
|
|
28
|
-
const words = text.split(/[-_]+/);
|
|
29
|
-
const capitalizedWords = [];
|
|
30
|
-
for (const word of words) {
|
|
31
|
-
capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
|
|
32
|
-
}
|
|
33
|
-
return capitalizedWords.join(' ');
|
|
34
|
-
}
|
|
35
|
-
function buildDocAnnotationText(annotation) {
|
|
36
|
-
let annotationBodyText = annotation.body;
|
|
37
|
-
if (annotation.name.toLowerCase() === 'see') {
|
|
38
|
-
annotationBodyText = class_file_generatorHelper_1.default.getFileLinkByTypeName(annotation.body);
|
|
39
|
-
}
|
|
40
|
-
return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.addCustomDocCommentAnnotations = addCustomDocCommentAnnotations;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addCustomDocCommentAnnotations = exports.addMermaid = void 0;
|
|
4
|
+
const class_file_generatorHelper_1 = require("../../transpiler/markdown/class-file-generatorHelper");
|
|
5
|
+
function addMermaid(markdownFile, docCommentAware) {
|
|
6
|
+
var _a;
|
|
7
|
+
const mermaid = (_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'mermaid');
|
|
8
|
+
if (!mermaid) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
markdownFile.addBlankLine();
|
|
12
|
+
markdownFile.startCodeBlock('mermaid');
|
|
13
|
+
mermaid.bodyLines.forEach((line) => {
|
|
14
|
+
markdownFile.addText(line, false);
|
|
15
|
+
});
|
|
16
|
+
markdownFile.endCodeBlock();
|
|
17
|
+
markdownFile.addBlankLine();
|
|
18
|
+
}
|
|
19
|
+
exports.addMermaid = addMermaid;
|
|
20
|
+
function addCustomDocCommentAnnotations(markdownFile, docCommentAware) {
|
|
21
|
+
var _a;
|
|
22
|
+
(_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => currentAnnotation.name !== 'description').filter((currentAnnotation) => currentAnnotation.name !== 'mermaid').forEach((currentAnnotation) => {
|
|
23
|
+
markdownFile.addBlankLine();
|
|
24
|
+
markdownFile.addText(buildDocAnnotationText(currentAnnotation));
|
|
25
|
+
markdownFile.addBlankLine();
|
|
26
|
+
});
|
|
27
|
+
function splitAndCapitalize(text) {
|
|
28
|
+
const words = text.split(/[-_]+/);
|
|
29
|
+
const capitalizedWords = [];
|
|
30
|
+
for (const word of words) {
|
|
31
|
+
capitalizedWords.push(word.charAt(0).toUpperCase() + word.slice(1));
|
|
32
|
+
}
|
|
33
|
+
return capitalizedWords.join(' ');
|
|
34
|
+
}
|
|
35
|
+
function buildDocAnnotationText(annotation) {
|
|
36
|
+
let annotationBodyText = annotation.body;
|
|
37
|
+
if (annotation.name.toLowerCase() === 'see') {
|
|
38
|
+
annotationBodyText = class_file_generatorHelper_1.default.getFileLinkByTypeName(annotation.body);
|
|
39
|
+
}
|
|
40
|
+
return `**${splitAndCapitalize(annotation.name)}** ${annotationBodyText}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.addCustomDocCommentAnnotations = addCustomDocCommentAnnotations;
|
|
44
44
|
//# sourceMappingURL=doc-comment-annotation-util.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MarkdownFile } from '../markdown-file';
|
|
2
|
-
import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance } from '../inheritance';
|
|
3
|
-
export declare function declareField(markdownFile: MarkdownFile, fields: FieldMirrorWithInheritance[] | PropertyMirrorWithInheritance[], startingHeadingLevel: number, grouped?: boolean): void;
|
|
1
|
+
import { MarkdownFile } from '../markdown-file';
|
|
2
|
+
import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance } from '../inheritance';
|
|
3
|
+
export declare function declareField(markdownFile: MarkdownFile, fields: FieldMirrorWithInheritance[] | PropertyMirrorWithInheritance[], startingHeadingLevel: number, grouped?: boolean): void;
|
|
@@ -1,63 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.declareField = void 0;
|
|
4
|
-
function declareField(markdownFile, fields, startingHeadingLevel, grouped = false) {
|
|
5
|
-
markdownFile.addBlankLine();
|
|
6
|
-
fields
|
|
7
|
-
|
|
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
|
-
mirrorModel.
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (mirrorModel.inherited) {
|
|
56
|
-
listItemText += '(*Inherited*)';
|
|
57
|
-
}
|
|
58
|
-
listItemText += `${annotations} ${description}`;
|
|
59
|
-
markdownFile.addListItem(listItemText);
|
|
60
|
-
markdownFile.addBlankLine();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.declareField = void 0;
|
|
4
|
+
function declareField(markdownFile, fields, startingHeadingLevel, grouped = false) {
|
|
5
|
+
markdownFile.addBlankLine();
|
|
6
|
+
fields.forEach((propertyModel) => {
|
|
7
|
+
addFieldSection(markdownFile, propertyModel, startingHeadingLevel, grouped);
|
|
8
|
+
});
|
|
9
|
+
markdownFile.addHorizontalRule();
|
|
10
|
+
}
|
|
11
|
+
exports.declareField = declareField;
|
|
12
|
+
function addFieldSection(markdownFile, mirrorModel, startingHeadingLevel, grouped) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
if (!grouped) {
|
|
15
|
+
markdownFile.addTitle(`\`${mirrorModel.access_modifier} ${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\``, startingHeadingLevel + 2);
|
|
16
|
+
markdownFile.addBlankLine();
|
|
17
|
+
if (mirrorModel.inherited) {
|
|
18
|
+
markdownFile.addText('*Inherited*');
|
|
19
|
+
}
|
|
20
|
+
mirrorModel.annotations.forEach((annotation) => {
|
|
21
|
+
markdownFile.addText(`\`${annotation.type.toUpperCase()}\` `);
|
|
22
|
+
});
|
|
23
|
+
if ((_a = mirrorModel.docComment) === null || _a === void 0 ? void 0 : _a.description) {
|
|
24
|
+
markdownFile.addBlankLine();
|
|
25
|
+
markdownFile.addText(mirrorModel.docComment.description);
|
|
26
|
+
}
|
|
27
|
+
markdownFile.addBlankLine();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
let annotations = '';
|
|
31
|
+
const hasAnnotations = !!mirrorModel.annotations.length;
|
|
32
|
+
if (hasAnnotations) {
|
|
33
|
+
annotations += ' [';
|
|
34
|
+
}
|
|
35
|
+
mirrorModel.annotations.forEach((annotation) => {
|
|
36
|
+
annotations += `\`${annotation.type.toUpperCase()}\` `;
|
|
37
|
+
});
|
|
38
|
+
if (hasAnnotations) {
|
|
39
|
+
annotations += ']';
|
|
40
|
+
}
|
|
41
|
+
// If grouped we want to display these as a list
|
|
42
|
+
let description = '';
|
|
43
|
+
if ((_b = mirrorModel.docComment) === null || _b === void 0 ? void 0 : _b.description) {
|
|
44
|
+
description = ` - ${(_c = mirrorModel.docComment) === null || _c === void 0 ? void 0 : _c.description}`;
|
|
45
|
+
}
|
|
46
|
+
let listItemText = `\`${mirrorModel.access_modifier} ${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\``;
|
|
47
|
+
if (mirrorModel.inherited) {
|
|
48
|
+
listItemText += '(*Inherited*)';
|
|
49
|
+
}
|
|
50
|
+
listItemText += `${annotations} ${description}`;
|
|
51
|
+
markdownFile.addListItem(listItemText);
|
|
52
|
+
markdownFile.addBlankLine();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
63
55
|
//# sourceMappingURL=field-declaration-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/field-declaration-util.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAC1B,YAA0B,EAC1B,MAAsE,EACtE,oBAA4B,EAC5B,OAAO,GAAG,KAAK;IAEf,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM
|
|
1
|
+
{"version":3,"file":"field-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/field-declaration-util.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAC1B,YAA0B,EAC1B,MAAsE,EACtE,oBAA4B,EAC5B,OAAO,GAAG,KAAK;IAEf,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;QAC/B,eAAe,CAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,iBAAiB,EAAE,CAAC;AACnC,CAAC;AAZD,oCAYC;AAED,SAAS,eAAe,CACtB,YAA0B,EAC1B,WAA4B,EAC5B,oBAA4B,EAC5B,OAAgB;;IAEhB,IAAI,CAAC,OAAO,EAAE;QACZ,YAAY,CAAC,QAAQ,CACnB,KAAK,WAAW,CAAC,eAAe,IAAI,WAAW,CAAC,IAAI,UAAU,WAAW,CAAC,aAAa,CAAC,cAAc,IAAI,EAC1G,oBAAoB,GAAG,CAAC,CACzB,CAAC;QACF,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,IAAI,WAAW,CAAC,SAAS,EAAE;YACzB,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SACrC;QAED,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAC7C,YAAY,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QAEH,IAAI,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE;YACvC,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;SAC1D;QACD,YAAY,CAAC,YAAY,EAAE,CAAC;KAC7B;SAAM;QACL,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;QACxD,IAAI,cAAc,EAAE;YAClB,WAAW,IAAI,IAAI,CAAC;SACrB;QACD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAC7C,WAAW,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,IAAI,cAAc,EAAE;YAClB,WAAW,IAAI,GAAG,CAAC;SACpB;QAED,gDAAgD;QAChD,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,IAAI,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE;YACvC,WAAW,GAAG,MAAM,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE,CAAC;SAC3D;QAED,IAAI,YAAY,GAAG,KAAK,WAAW,CAAC,eAAe,IAAI,WAAW,CAAC,IAAI,UAAU,WAAW,CAAC,aAAa,CAAC,cAAc,IAAI,CAAC;QAC9H,IAAI,WAAW,CAAC,SAAS,EAAE;YACzB,YAAY,IAAI,eAAe,CAAC;SACjC;QACD,YAAY,IAAI,GAAG,WAAW,IAAI,WAAW,EAAE,CAAC;QAEhD,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACvC,YAAY,CAAC,YAAY,EAAE,CAAC;KAC7B;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './type-declaration-util';
|
|
2
|
-
export * from './method-declaration-util';
|
|
3
|
-
export * from './field-declaration-util';
|
|
1
|
+
export * from './type-declaration-util';
|
|
2
|
+
export * from './method-declaration-util';
|
|
3
|
+
export * from './field-declaration-util';
|
|
@@ -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;
|