@ng-doc/builder 19.0.1 → 19.2.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/engine/builders/helpers/get-playground-metadata.js +1 -0
- package/engine/builders/helpers/get-playground-metadata.js.map +1 -1
- package/engine/nunjucks/filters.d.ts +1 -1
- package/engine/nunjucks/filters.js +8 -1
- package/engine/nunjucks/filters.js.map +1 -1
- package/helpers/get-js-doc.d.ts +12 -6
- package/helpers/get-js-doc.js +61 -31
- package/helpers/get-js-doc.js.map +1 -1
- package/helpers/presentation.d.ts +6 -1
- package/helpers/presentation.js +23 -0
- package/helpers/presentation.js.map +1 -1
- package/helpers/typescript/call-signature/get-call-signature-chain.d.ts +6 -0
- package/helpers/typescript/call-signature/get-call-signature-chain.js +25 -0
- package/helpers/typescript/call-signature/get-call-signature-chain.js.map +1 -0
- package/helpers/typescript/call-signature/get-call-signature-name.d.ts +6 -0
- package/helpers/typescript/call-signature/get-call-signature-name.js +11 -0
- package/helpers/typescript/call-signature/get-call-signature-name.js.map +1 -0
- package/helpers/typescript/call-signature/get-interface-call-signatures.d.ts +6 -0
- package/helpers/typescript/call-signature/get-interface-call-signatures.js +23 -0
- package/helpers/typescript/call-signature/get-interface-call-signatures.js.map +1 -0
- package/helpers/typescript/call-signature/index.d.ts +2 -0
- package/helpers/typescript/call-signature/index.js +6 -0
- package/helpers/typescript/call-signature/index.js.map +1 -0
- package/helpers/typescript/first-node-with-comment.d.ts +2 -2
- package/helpers/typescript/first-node-with-comment.js +2 -1
- package/helpers/typescript/first-node-with-comment.js.map +1 -1
- package/helpers/typescript/index.d.ts +2 -0
- package/helpers/typescript/index.js +2 -0
- package/helpers/typescript/index.js.map +1 -1
- package/helpers/typescript/is-named.d.ts +7 -0
- package/helpers/typescript/is-named.js +13 -0
- package/helpers/typescript/is-named.js.map +1 -0
- package/helpers/typescript/property/get-defined-in-parent.d.ts +24 -0
- package/helpers/typescript/property/get-defined-in-parent.js +38 -0
- package/helpers/typescript/property/get-defined-in-parent.js.map +1 -0
- package/helpers/typescript/property/get-property-chain.js +5 -1
- package/helpers/typescript/property/get-property-chain.js.map +1 -1
- package/helpers/typescript/property/get-type-alias-properties.d.ts +12 -0
- package/helpers/typescript/property/get-type-alias-properties.js +63 -0
- package/helpers/typescript/property/get-type-alias-properties.js.map +1 -0
- package/helpers/typescript/property/index.d.ts +2 -0
- package/helpers/typescript/property/index.js +2 -0
- package/helpers/typescript/property/index.js.map +1 -1
- package/package.json +5 -4
- package/templates/api/interface-declaration.html.nunj +10 -0
- package/templates/api/type-alias-declaration.html.nunj +8 -0
- package/templates/helpers/call-signature.html.nunj +70 -0
- package/templates/helpers/properties.html.nunj +8 -3
|
@@ -33,6 +33,7 @@ function controlsToProperties(controls) {
|
|
|
33
33
|
type: typeof value === 'string' ? value : value.type,
|
|
34
34
|
description: typeof value === 'string' ? undefined : value.description ?? undefined,
|
|
35
35
|
options: typeof value === 'string' ? undefined : value.options ?? undefined,
|
|
36
|
+
isManual: true,
|
|
36
37
|
};
|
|
37
38
|
return properties;
|
|
38
39
|
}, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-playground-metadata.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/builders/helpers/get-playground-metadata.ts"],"names":[],"mappings":";;AAgBA,sDA2BC;AAxCD,8CAK0B;AAG1B;;;;GAIG;AACH,SAAgB,qBAAqB,CACnC,IAAe,EACf,gBAAyC;IAEzC,MAAM,UAAU,GAAG,IAAA,kCAAwB,EAAC,gBAAgB,CAAC,CAAC;IAE9D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,IAAA,2BAAiB,EAAC,UAAU,CAAC,CAAC,MAAM,CACzC,CAAC,QAAiD,EAAE,EAAU,EAAE,EAAE;YAChE,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,UAAU,GAAwC,IAAA,2BAAiB,EAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBAE1F,IAAI,UAAU,EAAE,CAAC;oBACf,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAA,iCAAuB,EACpC,EAAE,EACF,UAAU,EACV,oBAAoB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CAC7D,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC,EACD,EAAE,CACH,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAC3B,QAA+D;IAE/D,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACpC,CACE,UAAqC,EACrC,CAAC,IAAI,EAAE,KAAK,CAAkD,EAC9D,EAAE;QACF,UAAU,CAAC,IAAI,CAAC,GAAG;YACjB,SAAS,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI;YACjE,IAAI,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI;YACpD,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,SAAS;YACnF,OAAO,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;
|
|
1
|
+
{"version":3,"file":"get-playground-metadata.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/builders/helpers/get-playground-metadata.ts"],"names":[],"mappings":";;AAgBA,sDA2BC;AAxCD,8CAK0B;AAG1B;;;;GAIG;AACH,SAAgB,qBAAqB,CACnC,IAAe,EACf,gBAAyC;IAEzC,MAAM,UAAU,GAAG,IAAA,kCAAwB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CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;YAC3E,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,EACD,EAAE,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { accessorPresentation, constructorPresentation, declarationImport, displayReturnType, displayType, excludeByJsDocTags, extractSelectors, filterByScope, filterByStatic, filterUselessMembers, firstNodeWithComment, functionPresentation, getAccessorChain, getClassAccessors, getClassMethods, getClassProperties, getDeclarationType, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceMethods, getInterfaceProperties, getJsDocDescription, getJsDocParam, getJsDocTag, getJsDocTags, getMemberParent, getMethodChain, getOverriddenMember, getPropertyChain, groupAccessors, hasJsDocTag, markdownToHtml, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, sortNavigationEntries, toTemplateString, typeAliasPresentation, variablePresentation, } from '../../helpers';
|
|
1
|
+
export { accessorPresentation, callSignaturePresentation, constructorPresentation, declarationImport, displayReturnType, displayType, excludeByJsDocTags, extractSelectors, filterByScope, filterByStatic, filterUselessMembers, firstNodeWithComment, functionPresentation, getAccessorChain, getCallSignatureChain, getClassAccessors, getClassMethods, getClassProperties, getDeclarationType, getDefinedInParent, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceCallSignatures, getInterfaceMethods, getInterfaceProperties, getJsDocDescription, getJsDocParam, getJsDocTag, getJsDocTags, getMemberParent, getMethodChain, getOverriddenMember, getPropertyChain, getTypeAliasProperties, groupAccessors, hasJsDocTag, isNamed, markdownToHtml, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, sortNavigationEntries, toTemplateString, typeAliasPresentation, variablePresentation, } from '../../helpers';
|
|
2
2
|
export { createImportPath } from '../builders/helpers';
|
|
3
3
|
export { isRoute, kebabCase, objectKeys, unique } from '@ng-doc/core';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Just re-export filters from this file, they will be included to the template renderer automatically */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.isRoute = exports.createImportPath = exports.variablePresentation = exports.typeAliasPresentation = exports.toTemplateString = exports.sortNavigationEntries = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.markdownToHtml = exports.isNamed = exports.hasJsDocTag = exports.groupAccessors = exports.getTypeAliasProperties = exports.getPropertyChain = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getJsDocTags = exports.getJsDocTag = exports.getJsDocParam = exports.getJsDocDescription = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceCallSignatures = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDefinedInParent = exports.getDeclarationType = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getCallSignatureChain = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterUselessMembers = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.excludeByJsDocTags = exports.displayType = exports.displayReturnType = exports.declarationImport = exports.constructorPresentation = exports.callSignaturePresentation = exports.accessorPresentation = void 0;
|
|
5
|
+
exports.unique = exports.objectKeys = exports.kebabCase = void 0;
|
|
5
6
|
var helpers_1 = require("../../helpers");
|
|
6
7
|
Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
|
|
8
|
+
Object.defineProperty(exports, "callSignaturePresentation", { enumerable: true, get: function () { return helpers_1.callSignaturePresentation; } });
|
|
7
9
|
Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
|
|
8
10
|
Object.defineProperty(exports, "declarationImport", { enumerable: true, get: function () { return helpers_1.declarationImport; } });
|
|
9
11
|
Object.defineProperty(exports, "displayReturnType", { enumerable: true, get: function () { return helpers_1.displayReturnType; } });
|
|
@@ -16,13 +18,16 @@ Object.defineProperty(exports, "filterUselessMembers", { enumerable: true, get:
|
|
|
16
18
|
Object.defineProperty(exports, "firstNodeWithComment", { enumerable: true, get: function () { return helpers_1.firstNodeWithComment; } });
|
|
17
19
|
Object.defineProperty(exports, "functionPresentation", { enumerable: true, get: function () { return helpers_1.functionPresentation; } });
|
|
18
20
|
Object.defineProperty(exports, "getAccessorChain", { enumerable: true, get: function () { return helpers_1.getAccessorChain; } });
|
|
21
|
+
Object.defineProperty(exports, "getCallSignatureChain", { enumerable: true, get: function () { return helpers_1.getCallSignatureChain; } });
|
|
19
22
|
Object.defineProperty(exports, "getClassAccessors", { enumerable: true, get: function () { return helpers_1.getClassAccessors; } });
|
|
20
23
|
Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
|
|
21
24
|
Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
|
|
22
25
|
Object.defineProperty(exports, "getDeclarationType", { enumerable: true, get: function () { return helpers_1.getDeclarationType; } });
|
|
26
|
+
Object.defineProperty(exports, "getDefinedInParent", { enumerable: true, get: function () { return helpers_1.getDefinedInParent; } });
|
|
23
27
|
Object.defineProperty(exports, "getImplementedMember", { enumerable: true, get: function () { return helpers_1.getImplementedMember; } });
|
|
24
28
|
Object.defineProperty(exports, "getInheritedParent", { enumerable: true, get: function () { return helpers_1.getInheritedParent; } });
|
|
25
29
|
Object.defineProperty(exports, "getInterfaceAccessors", { enumerable: true, get: function () { return helpers_1.getInterfaceAccessors; } });
|
|
30
|
+
Object.defineProperty(exports, "getInterfaceCallSignatures", { enumerable: true, get: function () { return helpers_1.getInterfaceCallSignatures; } });
|
|
26
31
|
Object.defineProperty(exports, "getInterfaceMethods", { enumerable: true, get: function () { return helpers_1.getInterfaceMethods; } });
|
|
27
32
|
Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get: function () { return helpers_1.getInterfaceProperties; } });
|
|
28
33
|
Object.defineProperty(exports, "getJsDocDescription", { enumerable: true, get: function () { return helpers_1.getJsDocDescription; } });
|
|
@@ -33,8 +38,10 @@ Object.defineProperty(exports, "getMemberParent", { enumerable: true, get: funct
|
|
|
33
38
|
Object.defineProperty(exports, "getMethodChain", { enumerable: true, get: function () { return helpers_1.getMethodChain; } });
|
|
34
39
|
Object.defineProperty(exports, "getOverriddenMember", { enumerable: true, get: function () { return helpers_1.getOverriddenMember; } });
|
|
35
40
|
Object.defineProperty(exports, "getPropertyChain", { enumerable: true, get: function () { return helpers_1.getPropertyChain; } });
|
|
41
|
+
Object.defineProperty(exports, "getTypeAliasProperties", { enumerable: true, get: function () { return helpers_1.getTypeAliasProperties; } });
|
|
36
42
|
Object.defineProperty(exports, "groupAccessors", { enumerable: true, get: function () { return helpers_1.groupAccessors; } });
|
|
37
43
|
Object.defineProperty(exports, "hasJsDocTag", { enumerable: true, get: function () { return helpers_1.hasJsDocTag; } });
|
|
44
|
+
Object.defineProperty(exports, "isNamed", { enumerable: true, get: function () { return helpers_1.isNamed; } });
|
|
38
45
|
Object.defineProperty(exports, "markdownToHtml", { enumerable: true, get: function () { return helpers_1.markdownToHtml; } });
|
|
39
46
|
Object.defineProperty(exports, "methodPresentation", { enumerable: true, get: function () { return helpers_1.methodPresentation; } });
|
|
40
47
|
Object.defineProperty(exports, "noEmpty", { enumerable: true, get: function () { return helpers_1.noEmpty; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/filters.ts"],"names":[],"mappings":";AAAA,yGAAyG
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/filters.ts"],"names":[],"mappings":";AAAA,yGAAyG;;;;AAEzG,yCAiDuB;AAhDrB,+GAAA,oBAAoB,OAAA;AACpB,oHAAA,yBAAyB,OAAA;AACzB,kHAAA,uBAAuB,OAAA;AACvB,4GAAA,iB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AA7D,+FAAA,OAAO,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,8FAAA,MAAM,OAAA"}
|
package/helpers/get-js-doc.d.ts
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
+
import { type DocNode } from '@microsoft/tsdoc';
|
|
1
2
|
import { JSDocableNode } from 'ts-morph';
|
|
3
|
+
export declare class Formatter {
|
|
4
|
+
static renderDocNode(docNode: DocNode): string;
|
|
5
|
+
static renderDocNodes(docNodes: readonly DocNode[]): string;
|
|
6
|
+
private static filterOutStatusTag;
|
|
7
|
+
}
|
|
2
8
|
/**
|
|
3
9
|
*
|
|
4
10
|
* @param node
|
|
5
11
|
*/
|
|
6
|
-
export declare function getJsDocDescription(node: JSDocableNode): string;
|
|
12
|
+
export declare function getJsDocDescription(node: JSDocableNode | undefined): string;
|
|
7
13
|
/**
|
|
8
14
|
*
|
|
9
15
|
* @param node
|
|
10
16
|
* @param tagName
|
|
11
17
|
*/
|
|
12
|
-
export declare function getJsDocTag(node: JSDocableNode, tagName: string): string;
|
|
18
|
+
export declare function getJsDocTag(node: JSDocableNode | undefined, tagName: string): string;
|
|
13
19
|
/**
|
|
14
20
|
*
|
|
15
21
|
* @param node
|
|
16
22
|
* @param tagName
|
|
17
23
|
*/
|
|
18
|
-
export declare function getJsDocTags(node: JSDocableNode, tagName: string): string[];
|
|
24
|
+
export declare function getJsDocTags(node: JSDocableNode | undefined, tagName: string): string[];
|
|
19
25
|
/**
|
|
20
26
|
*
|
|
21
27
|
* @param node
|
|
22
28
|
*/
|
|
23
|
-
export declare function getAllJsDocTags(node: JSDocableNode): Record<string, string[]>;
|
|
29
|
+
export declare function getAllJsDocTags(node: JSDocableNode | undefined): Record<string, string[]>;
|
|
24
30
|
/**
|
|
25
31
|
*
|
|
26
32
|
* @param node
|
|
27
33
|
* @param tagName
|
|
28
34
|
*/
|
|
29
|
-
export declare function hasJsDocTag(node: JSDocableNode, tagName: string): boolean;
|
|
35
|
+
export declare function hasJsDocTag(node: JSDocableNode | undefined, tagName: string): boolean;
|
|
30
36
|
/**
|
|
31
37
|
*
|
|
32
38
|
* @param node
|
|
33
39
|
* @param paramName
|
|
34
40
|
*/
|
|
35
|
-
export declare function getJsDocParam(node: JSDocableNode, paramName: string): string;
|
|
41
|
+
export declare function getJsDocParam(node: JSDocableNode | undefined, paramName: string): string;
|
package/helpers/get-js-doc.js
CHANGED
|
@@ -1,24 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Formatter = void 0;
|
|
3
4
|
exports.getJsDocDescription = getJsDocDescription;
|
|
4
5
|
exports.getJsDocTag = getJsDocTag;
|
|
5
6
|
exports.getJsDocTags = getJsDocTags;
|
|
6
7
|
exports.getAllJsDocTags = getAllJsDocTags;
|
|
7
8
|
exports.hasJsDocTag = hasJsDocTag;
|
|
8
9
|
exports.getJsDocParam = getJsDocParam;
|
|
10
|
+
const tsdoc_1 = require("@microsoft/tsdoc");
|
|
9
11
|
const core_1 = require("@ng-doc/core");
|
|
10
12
|
const markdown_to_html_1 = require("./markdown-to-html");
|
|
13
|
+
class Formatter {
|
|
14
|
+
static renderDocNode(docNode) {
|
|
15
|
+
let result = '';
|
|
16
|
+
if (docNode) {
|
|
17
|
+
if (docNode instanceof tsdoc_1.DocExcerpt) {
|
|
18
|
+
result += docNode.content.toString();
|
|
19
|
+
}
|
|
20
|
+
for (const childNode of Formatter.filterOutStatusTag(docNode.getChildNodes())) {
|
|
21
|
+
result += Formatter.renderDocNode(childNode);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
static renderDocNodes(docNodes) {
|
|
27
|
+
let result = '';
|
|
28
|
+
for (const docNode of docNodes) {
|
|
29
|
+
result += Formatter.renderDocNode(docNode);
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
static filterOutStatusTag(docNodes) {
|
|
34
|
+
if (docNodes.length < 2)
|
|
35
|
+
return docNodes;
|
|
36
|
+
const result = [];
|
|
37
|
+
for (let i = 0; i < docNodes.length; i += 2) {
|
|
38
|
+
const node1 = docNodes.at(i), node2 = docNodes.at(i + 1);
|
|
39
|
+
if (node1 instanceof tsdoc_1.DocErrorText &&
|
|
40
|
+
node1.text === '@' &&
|
|
41
|
+
node2 instanceof tsdoc_1.DocPlainText &&
|
|
42
|
+
node2.text.startsWith('status:')) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (node1)
|
|
46
|
+
result.push(node1);
|
|
47
|
+
if (node2)
|
|
48
|
+
result.push(node2);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.Formatter = Formatter;
|
|
11
54
|
/**
|
|
12
55
|
*
|
|
13
56
|
* @param node
|
|
14
57
|
*/
|
|
15
58
|
function getJsDocDescription(node) {
|
|
59
|
+
if (!node)
|
|
60
|
+
return '';
|
|
16
61
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.join('');
|
|
21
|
-
return (0, markdown_to_html_1.markdownToHtml)(description).trim();
|
|
62
|
+
const tsdocParser = new tsdoc_1.TSDocParser();
|
|
63
|
+
const parserContext = tsdocParser.parseString(jsDocs[0]?.getText() ?? '');
|
|
64
|
+
return (0, markdown_to_html_1.markdownToHtml)(Formatter.renderDocNodes(parserContext.docComment.summarySection.getChildNodes())).trim();
|
|
22
65
|
}
|
|
23
66
|
/**
|
|
24
67
|
*
|
|
@@ -26,6 +69,8 @@ function getJsDocDescription(node) {
|
|
|
26
69
|
* @param tagName
|
|
27
70
|
*/
|
|
28
71
|
function getJsDocTag(node, tagName) {
|
|
72
|
+
if (!node)
|
|
73
|
+
return '';
|
|
29
74
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
30
75
|
const tag = jsDocs
|
|
31
76
|
.map((doc) => doc.getStructure())
|
|
@@ -41,6 +86,8 @@ function getJsDocTag(node, tagName) {
|
|
|
41
86
|
* @param tagName
|
|
42
87
|
*/
|
|
43
88
|
function getJsDocTags(node, tagName) {
|
|
89
|
+
if (!node)
|
|
90
|
+
return [];
|
|
44
91
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
45
92
|
const tags = jsDocs
|
|
46
93
|
.map((doc) => doc.getStructure())
|
|
@@ -55,6 +102,8 @@ function getJsDocTags(node, tagName) {
|
|
|
55
102
|
* @param node
|
|
56
103
|
*/
|
|
57
104
|
function getAllJsDocTags(node) {
|
|
105
|
+
if (!node)
|
|
106
|
+
return {};
|
|
58
107
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
59
108
|
const tags = jsDocs
|
|
60
109
|
.map((doc) => doc.getStructure())
|
|
@@ -76,6 +125,8 @@ function getAllJsDocTags(node) {
|
|
|
76
125
|
* @param tagName
|
|
77
126
|
*/
|
|
78
127
|
function hasJsDocTag(node, tagName) {
|
|
128
|
+
if (!node)
|
|
129
|
+
return false;
|
|
79
130
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
80
131
|
return jsDocs
|
|
81
132
|
.map((doc) => doc.getStructure())
|
|
@@ -89,33 +140,12 @@ function hasJsDocTag(node, tagName) {
|
|
|
89
140
|
* @param paramName
|
|
90
141
|
*/
|
|
91
142
|
function getJsDocParam(node, paramName) {
|
|
143
|
+
if (!node)
|
|
144
|
+
return '';
|
|
92
145
|
const jsDocs = (0, core_1.asArray)(node.getJsDocs()[0]);
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.filter(core_1.isPresent)
|
|
97
|
-
.map((tag) => getParameter(String(tag.text)).description)
|
|
98
|
-
.join('');
|
|
146
|
+
const tsdocParser = new tsdoc_1.TSDocParser();
|
|
147
|
+
const parserContext = tsdocParser.parseString(jsDocs[0]?.getText() ?? '');
|
|
148
|
+
const param = Formatter.renderDocNodes(parserContext.docComment.params.tryGetBlockByName(paramName)?.content?.getChildNodes() ?? []);
|
|
99
149
|
return (0, markdown_to_html_1.markdownToHtml)(param).trim();
|
|
100
150
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Returns the name and description of a parameter
|
|
103
|
-
* @example
|
|
104
|
-
* // input: "param1 - Test param1"
|
|
105
|
-
* // output: ['param1', 'Test param1']
|
|
106
|
-
*
|
|
107
|
-
* // input: "param1 Test param1"
|
|
108
|
-
* // output: ['param1', 'Test param1']
|
|
109
|
-
* @param docs
|
|
110
|
-
*/
|
|
111
|
-
function getParameter(docs) {
|
|
112
|
-
const match = docs.match(/(?<name>\w*)((\s?-\s?)|(\s))(?<description>.*)/);
|
|
113
|
-
if (!match || !match.groups) {
|
|
114
|
-
return { name: '', description: '' };
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
name: match.groups['name'].trim() ?? '',
|
|
118
|
-
description: match.groups['description'].trim() ?? '',
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
151
|
//# sourceMappingURL=get-js-doc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-js-doc.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/get-js-doc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-js-doc.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/get-js-doc.ts"],"names":[],"mappings":";;;AAgEA,kDASC;AAOD,kCAWC;AAOD,oCAWC;AAMD,0CAsBC;AAOD,kCASC;AAOD,sCAWC;AA3KD,4CAM0B;AAC1B,uCAAkD;AAGlD,yDAAoD;AAEpD,MAAa,SAAS;IACpB,MAAM,CAAC,aAAa,CAAC,OAAgB;QACnC,IAAI,MAAM,GAAW,EAAE,CAAC;QACxB,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,OAAO,YAAY,kBAAU,EAAE,CAAC;gBAClC,MAAM,IAAI,OAAO,CA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AAI,EAAE,CAAC,CAAC;IAE1E,MAAM,KAAK,GAAG,SAAS,CAAC,cAAc,CACpC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAC7F,CAAC;IAEF,OAAO,IAAA,iCAAc,EAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessorDeclaration, ConstructorDeclaration, FunctionDeclaration, MethodDeclaration, TypeAliasDeclaration, VariableDeclaration } from 'ts-morph';
|
|
1
|
+
import { AccessorDeclaration, CallSignatureDeclaration, ConstructorDeclaration, FunctionDeclaration, MethodDeclaration, TypeAliasDeclaration, VariableDeclaration } from 'ts-morph';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param constructor
|
|
@@ -14,6 +14,11 @@ export declare function accessorPresentation(accessor: AccessorDeclaration): str
|
|
|
14
14
|
* @param method
|
|
15
15
|
*/
|
|
16
16
|
export declare function methodPresentation(method: MethodDeclaration): string;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param callSignature
|
|
20
|
+
*/
|
|
21
|
+
export declare function callSignaturePresentation(callSignature: CallSignatureDeclaration): string;
|
|
17
22
|
/**
|
|
18
23
|
*
|
|
19
24
|
* @param fnc
|
package/helpers/presentation.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructorPresentation = constructorPresentation;
|
|
4
4
|
exports.accessorPresentation = accessorPresentation;
|
|
5
5
|
exports.methodPresentation = methodPresentation;
|
|
6
|
+
exports.callSignaturePresentation = callSignaturePresentation;
|
|
6
7
|
exports.functionPresentation = functionPresentation;
|
|
7
8
|
exports.typeAliasPresentation = typeAliasPresentation;
|
|
8
9
|
exports.variablePresentation = variablePresentation;
|
|
@@ -60,6 +61,21 @@ function methodPresentation(method) {
|
|
|
60
61
|
.join(' ');
|
|
61
62
|
return (0, format_code_1.formatCode)(presentation, 'TypeScript');
|
|
62
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param callSignature
|
|
67
|
+
*/
|
|
68
|
+
function callSignaturePresentation(callSignature) {
|
|
69
|
+
const parameters = callSignature.getParameters().map(parameterPresentation).join(', ');
|
|
70
|
+
const typeParameters = typeParametersPresentation(callSignature.getTypeParameters());
|
|
71
|
+
const presentation = [
|
|
72
|
+
`${typeParameters ? `<${typeParameters}>` : ''}(${parameters}):`,
|
|
73
|
+
`${(0, typescript_1.displayReturnType)(callSignature)};`,
|
|
74
|
+
]
|
|
75
|
+
.filter(core_1.isPresent)
|
|
76
|
+
.join(' ');
|
|
77
|
+
return (0, format_code_1.formatCode)(presentation, 'TypeScript');
|
|
78
|
+
}
|
|
63
79
|
/**
|
|
64
80
|
*
|
|
65
81
|
* @param fnc
|
|
@@ -156,4 +172,11 @@ function decoratorsPresentation(node) {
|
|
|
156
172
|
.map((d) => `@${d.getName()}()`)
|
|
157
173
|
.join(' ');
|
|
158
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @param typeParameters
|
|
178
|
+
*/
|
|
179
|
+
function typeParametersPresentation(typeParameters) {
|
|
180
|
+
return typeParameters.map((tp) => tp.getText()).join(', ');
|
|
181
|
+
}
|
|
159
182
|
//# sourceMappingURL=presentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/presentation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/presentation.ts"],"names":[],"mappings":";;AA0BA,0DAaC;AAMD,oDAgBC;AAMD,gDAcC;AAMD,8DAYC;AAMD,oDAYC;AAMD,sDAIC;AAMD,oDAUC;AA/ID,uCAAyC;AACzC,uCAgBkB;AAElB,+CA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,CAAC,UAAU,EAAE,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,IAAqB;IACnD,OAAO,IAAI;SACR,aAAa,EAAE;SACf,GAAG,CAAC,CAAC,CAAY,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;SAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,SAAS,0BAA0B,CAAC,cAA0C;IAC5E,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,EAA4B,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCallSignatureChain = getCallSignatureChain;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const for_all_interfaces_1 = require("../interface/for-all-interfaces");
|
|
6
|
+
const get_call_signature_name_1 = require("./get-call-signature-name");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param callSignature
|
|
10
|
+
*/
|
|
11
|
+
function getCallSignatureChain(callSignature) {
|
|
12
|
+
const parent = callSignature.getParent();
|
|
13
|
+
const callSignatures = [];
|
|
14
|
+
const name = (0, get_call_signature_name_1.getCallSignatureName)(callSignature);
|
|
15
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
16
|
+
(0, for_all_interfaces_1.forAllInterfaces)(parent, (int) => {
|
|
17
|
+
const callSignature = int.getCallSignature((cs) => (0, get_call_signature_name_1.getCallSignatureName)(cs) === name);
|
|
18
|
+
if (callSignature) {
|
|
19
|
+
callSignatures.push(callSignature);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return callSignatures;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=get-call-signature-chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-call-signature-chain.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/call-signature/get-call-signature-chain.ts"],"names":[],"mappings":";;AASA,sDAoBC;AA7BD,uCAAgF;AAEhF,wEAAmE;AACnE,uEAAiE;AAEjE;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,aAAuC;IAEvC,MAAM,MAAM,GAAqB,aAAa,CAAC,SAAS,EAAE,CAAC;IAC3D,MAAM,cAAc,GAA+B,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,IAAA,8CAAoB,EAAC,aAAa,CAAC,CAAC;IAEjD,IAAI,eAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,IAAA,qCAAgB,EAAC,MAAM,EAAE,CAAC,GAAyB,EAAE,EAAE;YACrD,MAAM,aAAa,GAAyC,GAAG,CAAC,gBAAgB,CAC9E,CAAC,EAAE,EAAE,EAAE,CAAC,IAAA,8CAAoB,EAAC,EAAE,CAAC,KAAK,IAAI,CAC1C,CAAC;YAEF,IAAI,aAAa,EAAE,CAAC;gBAClB,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCallSignatureName = getCallSignatureName;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param callSignature
|
|
7
|
+
*/
|
|
8
|
+
function getCallSignatureName(callSignature) {
|
|
9
|
+
return callSignature.getText().split(/(?<=\)):\s?/)[0];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=get-call-signature-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-call-signature-name.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/call-signature/get-call-signature-name.ts"],"names":[],"mappings":";;AAMA,oDAEC;AAND;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,aAAuC;IAC1E,OAAO,aAAa,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInterfaceCallSignatures = getInterfaceCallSignatures;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const interface_1 = require("../interface");
|
|
6
|
+
const get_call_signature_name_1 = require("./get-call-signature-name");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param int
|
|
10
|
+
*/
|
|
11
|
+
function getInterfaceCallSignatures(int) {
|
|
12
|
+
const callSignatures = new Map();
|
|
13
|
+
(0, interface_1.forAllInterfaces)(int, (i) => {
|
|
14
|
+
i.getCallSignatures().forEach((callSignature) => {
|
|
15
|
+
const name = (0, get_call_signature_name_1.getCallSignatureName)(callSignature);
|
|
16
|
+
if (!callSignatures.get(name)) {
|
|
17
|
+
callSignatures.set(name, callSignature);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
return (0, core_1.asArray)(callSignatures.values());
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=get-interface-call-signatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-interface-call-signatures.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/call-signature/get-interface-call-signatures.ts"],"names":[],"mappings":";;AAUA,gEAiBC;AA3BD,uCAAuC;AAGvC,4CAAgD;AAChD,uEAAiE;AAEjE;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,GAAyB;IAClE,MAAM,cAAc,GAA0C,IAAI,GAAG,EAGlE,CAAC;IAEJ,IAAA,4BAAgB,EAAC,GAAG,EAAE,CAAC,CAAuB,EAAE,EAAE;QAChD,CAAC,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC,aAAuC,EAAE,EAAE;YACxE,MAAM,IAAI,GAAW,IAAA,8CAAoB,EAAC,aAAa,CAAC,CAAC;YAEzD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,cAAO,EAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./get-call-signature-chain"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./get-interface-call-signatures"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/call-signature/index.ts"],"names":[],"mappings":";;;AAAA,qEAA2C;AAC3C,0EAAgD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Node } from 'ts-morph';
|
|
2
2
|
/**
|
|
3
3
|
* Returns first node that has JSDoc comment, will return first node, if there are no comment nodes
|
|
4
4
|
* @param nodes
|
|
5
5
|
*/
|
|
6
|
-
export declare function firstNodeWithComment<T extends
|
|
6
|
+
export declare function firstNodeWithComment<T extends Node>(nodes: T[]): T | undefined;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.firstNodeWithComment = firstNodeWithComment;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
4
5
|
/**
|
|
5
6
|
* Returns first node that has JSDoc comment, will return first node, if there are no comment nodes
|
|
6
7
|
* @param nodes
|
|
7
8
|
*/
|
|
8
9
|
function firstNodeWithComment(nodes) {
|
|
9
|
-
return nodes.find((n) => n.getJsDocs().length) ?? nodes[0];
|
|
10
|
+
return nodes.find((n) => ts_morph_1.Node.isJSDocable(n) && n.getJsDocs().length) ?? nodes[0];
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=first-node-with-comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-node-with-comment.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/first-node-with-comment.ts"],"names":[],"mappings":";;AAMA,oDAEC;
|
|
1
|
+
{"version":3,"file":"first-node-with-comment.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/first-node-with-comment.ts"],"names":[],"mappings":";;AAMA,oDAEC;AARD,uCAAgC;AAEhC;;;GAGG;AACH,SAAgB,oBAAoB,CAAiB,KAAU;IAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAO,EAAE,EAAE,CAAC,eAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './accessor';
|
|
2
|
+
export * from './call-signature';
|
|
2
3
|
export * from './class';
|
|
3
4
|
export * from './create-project';
|
|
4
5
|
export * from './declaration-import';
|
|
@@ -10,6 +11,7 @@ export * from './find-declarations';
|
|
|
10
11
|
export * from './first-node-with-comment';
|
|
11
12
|
export * from './get-object-expression-from-default';
|
|
12
13
|
export * from './interface';
|
|
14
|
+
export * from './is-named';
|
|
13
15
|
export * from './member';
|
|
14
16
|
export * from './method';
|
|
15
17
|
export * from './node';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./accessor"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./call-signature"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./class"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./create-project"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./declaration-import"), exports);
|
|
@@ -13,6 +14,7 @@ tslib_1.__exportStar(require("./find-declarations"), exports);
|
|
|
13
14
|
tslib_1.__exportStar(require("./first-node-with-comment"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./get-object-expression-from-default"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./interface"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./is-named"), exports);
|
|
16
18
|
tslib_1.__exportStar(require("./member"), exports);
|
|
17
19
|
tslib_1.__exportStar(require("./method"), exports);
|
|
18
20
|
tslib_1.__exportStar(require("./node"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,kDAAwB;AACxB,2DAAiC;AACjC,+DAAqC;AACrC,yDAA+B;AAC/B,mEAAyC;AACzC,4DAAkC;AAClC,6DAAmC;AACnC,8DAAoC;AACpC,oEAA0C;AAC1C,+EAAqD;AACrD,sDAA4B;AAC5B,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,qDAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,2DAAiC;AACjC,kDAAwB;AACxB,2DAAiC;AACjC,+DAAqC;AACrC,yDAA+B;AAC/B,mEAAyC;AACzC,4DAAkC;AAClC,6DAAmC;AACnC,8DAAoC;AACpC,oEAA0C;AAC1C,+EAAqD;AACrD,sDAA4B;AAC5B,qDAA2B;AAC3B,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,qDAA2B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNamed = isNamed;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
/**
|
|
6
|
+
* Helper for use in templates to check if a node has a name.
|
|
7
|
+
* @param node
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function isNamed(node) {
|
|
11
|
+
return ts_morph_1.Node.isNamed(node);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=is-named.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-named.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/is-named.ts"],"names":[],"mappings":";;AAOA,0BAEC;AATD,uCAAgC;AAEhC;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAsB;IAC5C,OAAO,eAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Node } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the parent node (TypeReference or TypeAliasDeclaration name)
|
|
4
|
+
* of a property that is defined in a type alias declaration.
|
|
5
|
+
*
|
|
6
|
+
* Specifically, this resolves type alias declarations that resolve to types
|
|
7
|
+
* that are "object-like", including:
|
|
8
|
+
* - IntersectionTypes,
|
|
9
|
+
* - TypeLiterals, and
|
|
10
|
+
* - TypeReferences (which resolve to IntersectionTypes or TypeLiterals)
|
|
11
|
+
*
|
|
12
|
+
* For other types (e.g. UnionType) it just defaults back to the existing
|
|
13
|
+
* rendering.
|
|
14
|
+
*
|
|
15
|
+
* @param property
|
|
16
|
+
* @param currentNode
|
|
17
|
+
|
|
18
|
+
* @note
|
|
19
|
+
* Similar to `getMemberParent` but handling type aliases declarations
|
|
20
|
+
* rather than member inheritance.
|
|
21
|
+
*
|
|
22
|
+
* @see libs/builder/helpers/typescript/member/get-member-parent.ts
|
|
23
|
+
*/
|
|
24
|
+
export declare function getDefinedInParent(property: Node, currentNode: Node): Node | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefinedInParent = getDefinedInParent;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the parent node (TypeReference or TypeAliasDeclaration name)
|
|
7
|
+
* of a property that is defined in a type alias declaration.
|
|
8
|
+
*
|
|
9
|
+
* Specifically, this resolves type alias declarations that resolve to types
|
|
10
|
+
* that are "object-like", including:
|
|
11
|
+
* - IntersectionTypes,
|
|
12
|
+
* - TypeLiterals, and
|
|
13
|
+
* - TypeReferences (which resolve to IntersectionTypes or TypeLiterals)
|
|
14
|
+
*
|
|
15
|
+
* For other types (e.g. UnionType) it just defaults back to the existing
|
|
16
|
+
* rendering.
|
|
17
|
+
*
|
|
18
|
+
* @param property
|
|
19
|
+
* @param currentNode
|
|
20
|
+
|
|
21
|
+
* @note
|
|
22
|
+
* Similar to `getMemberParent` but handling type aliases declarations
|
|
23
|
+
* rather than member inheritance.
|
|
24
|
+
*
|
|
25
|
+
* @see libs/builder/helpers/typescript/member/get-member-parent.ts
|
|
26
|
+
*/
|
|
27
|
+
function getDefinedInParent(property, currentNode) {
|
|
28
|
+
let propertyParent = property.getParent();
|
|
29
|
+
const excludeCurrentNode = (node) => node === currentNode ? undefined : node;
|
|
30
|
+
if (propertyParent?.isKind(ts_morph_1.SyntaxKind.TypeLiteral)) {
|
|
31
|
+
return excludeCurrentNode(getDefinedInParent(propertyParent, currentNode) ?? propertyParent);
|
|
32
|
+
}
|
|
33
|
+
if (propertyParent?.isKind(ts_morph_1.SyntaxKind.IntersectionType)) {
|
|
34
|
+
return excludeCurrentNode(getDefinedInParent(propertyParent, currentNode) ?? propertyParent);
|
|
35
|
+
}
|
|
36
|
+
return excludeCurrentNode(propertyParent);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=get-defined-in-parent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-defined-in-parent.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-defined-in-parent.ts"],"names":[],"mappings":";;AAwBA,gDAcC;AAtCD,uCAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,kBAAkB,CAAC,QAAc,EAAE,WAAiB;IAClE,IAAI,cAAc,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IAE1C,MAAM,kBAAkB,GAAG,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAE/F,IAAG,cAAc,EAAE,MAAM,CAAC,qBAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAClD,OAAO,kBAAkB,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,cAAc,CAAC,CAAC;IAC/F,CAAC;IAED,IAAG,cAAc,EAAE,MAAM,CAAC,qBAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACvD,OAAO,kBAAkB,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,cAAc,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -21,7 +21,7 @@ function getPropertyChain(property) {
|
|
|
21
21
|
});
|
|
22
22
|
// TODO: Add interfaces
|
|
23
23
|
}
|
|
24
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
24
|
+
else if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
25
25
|
(0, interface_1.forAllInterfaces)(parent, (int) => {
|
|
26
26
|
const prop = int.getProperty(name);
|
|
27
27
|
if (prop) {
|
|
@@ -29,6 +29,10 @@ function getPropertyChain(property) {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
else {
|
|
33
|
+
// type aliases etc don't have inheritance, so we just add the property itself
|
|
34
|
+
properties.push(property);
|
|
35
|
+
}
|
|
32
36
|
return properties;
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=get-property-chain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-property-chain.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-property-chain.ts"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"get-property-chain.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-property-chain.ts"],"names":[],"mappings":";;AAeA,4CAoCC;AAnDD,uCAMkB;AAElB,oCAAyC;AACzC,4CAAgD;AAEhD;;;GAGG;AACH,SAAgB,gBAAgB,CAC/B,QAAiD;IAEjD,MAAM,MAAM,GAAqB,QAAQ,CAAC,SAAS,EAAE,CAAC;IACtD,MAAM,IAAI,GAAW,QAAQ,CAAC,OAAO,EAAE,CAAC;IACxC,MAAM,UAAU,GAAmD,EAAE,CAAC;IAEtE,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,IAAA,qBAAa,EAAC,MAAM,EAAE,CAAC,GAAqB,EAAE,EAAE;YAC/C,MAAM,IAAI,GAAoC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAEpE,IAAI,IAAI,EAAE,CAAC;gBACV,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;QACF,CAAC,CAAC,CAAC;QAEH,uBAAuB;IAExB,CAAC;SAAM,IAAI,eAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QAEhD,IAAA,4BAAgB,EAAC,MAAM,EAAE,CAAC,GAAyB,EAAE,EAAE;YACtD,MAAM,IAAI,GAAkC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAElE,IAAI,IAAI,EAAE,CAAC;gBACV,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;QACF,CAAC,CAAC,CAAC;IAEJ,CAAC;SAAM,CAAC;QAEP,8EAA8E;QAC9E,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE3B,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TypeAliasDeclaration, PropertySignature } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
* Traverse all of the properties of a type alias declaration,
|
|
4
|
+
* returning an array of all of the properties.
|
|
5
|
+
*
|
|
6
|
+
* Specifically, this resolves type alias declarations that resolve to types
|
|
7
|
+
* that are "object-like", including:
|
|
8
|
+
* - IntersectionTypes,
|
|
9
|
+
* - TypeLiterals, and
|
|
10
|
+
* - TypeReferences (which resolve to IntersectionTypes or TypeLiterals)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTypeAliasProperties(ta: TypeAliasDeclaration): PropertySignature[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTypeAliasProperties = getTypeAliasProperties;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
/**
|
|
7
|
+
* Traverse all of the properties of a type alias declaration,
|
|
8
|
+
* returning an array of all of the properties.
|
|
9
|
+
*
|
|
10
|
+
* Specifically, this resolves type alias declarations that resolve to types
|
|
11
|
+
* that are "object-like", including:
|
|
12
|
+
* - IntersectionTypes,
|
|
13
|
+
* - TypeLiterals, and
|
|
14
|
+
* - TypeReferences (which resolve to IntersectionTypes or TypeLiterals)
|
|
15
|
+
*/
|
|
16
|
+
function getTypeAliasProperties(ta) {
|
|
17
|
+
const properties = new Map();
|
|
18
|
+
const signatures = [];
|
|
19
|
+
const getProperties = (typeNode) => {
|
|
20
|
+
if (typeNode.isKind(ts_morph_1.SyntaxKind.TypeLiteral)) {
|
|
21
|
+
const members = typeNode.getMembers();
|
|
22
|
+
members.forEach((member) => {
|
|
23
|
+
if (member.isKind(ts_morph_1.SyntaxKind.PropertySignature)) {
|
|
24
|
+
signatures.push(member);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else if (typeNode?.isKind(ts_morph_1.SyntaxKind.IntersectionType)) {
|
|
29
|
+
const types = typeNode.getTypeNodes();
|
|
30
|
+
types.forEach((typ) => {
|
|
31
|
+
getProperties(typ);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else if (typeNode.isKind(ts_morph_1.SyntaxKind.TypeReference)) {
|
|
35
|
+
const symbol = typeNode.getTypeName().getSymbol();
|
|
36
|
+
if (symbol) {
|
|
37
|
+
const declarations = symbol.getDeclarations();
|
|
38
|
+
declarations.forEach((decl) => {
|
|
39
|
+
if (decl.isKind(ts_morph_1.SyntaxKind.TypeLiteral)) {
|
|
40
|
+
getProperties(decl);
|
|
41
|
+
}
|
|
42
|
+
else if (decl.isKind(ts_morph_1.SyntaxKind.TypeAliasDeclaration)) {
|
|
43
|
+
const typeNode = decl.getTypeNode();
|
|
44
|
+
if (typeNode) {
|
|
45
|
+
getProperties(typeNode);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const typeNode = ta.getTypeNode();
|
|
53
|
+
if (typeNode) {
|
|
54
|
+
getProperties(typeNode);
|
|
55
|
+
}
|
|
56
|
+
signatures.forEach((property) => {
|
|
57
|
+
const name = property.getName();
|
|
58
|
+
// this may override the previous value (and we want the last one)
|
|
59
|
+
properties.set(name, property);
|
|
60
|
+
});
|
|
61
|
+
return (0, core_1.asArray)(properties.values());
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=get-type-alias-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-type-alias-properties.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-type-alias-properties.ts"],"names":[],"mappings":";;AAaA,wDAkDC;AA/DD,uCAAuC;AACvC,uCAAyF;AAEzF;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,EAAwB;IAE7D,MAAM,UAAU,GAAmC,IAAI,GAAG,EAA6B,CAAC;IAExF,MAAM,UAAU,GAAwB,EAAE,CAAC;IAE3C,MAAM,aAAa,GAAG,CAAC,QAAkB,EAAE,EAAE;QAC3C,IAAI,QAAQ,CAAC,MAAM,CAAC,qBAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;YACtC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACzB,IAAI,MAAM,CAAC,MAAM,CAAC,qBAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAChD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,QAAQ,EAAE,MAAM,CAAC,qBAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;YACtC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACpB,aAAa,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAA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
tslib_1.__exportStar(require("./get-class-properties"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./get-defined-in-parent"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./get-interface-properties"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./get-type-alias-properties"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./get-property-assignment"), exports);
|
|
7
9
|
tslib_1.__exportStar(require("./get-property-chain"), exports);
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,qEAA2C;AAC3C,oEAA0C;AAC1C,+DAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,kEAAwC;AACxC,qEAA2C;AAC3C,sEAA4C;AAC5C,oEAA0C;AAC1C,+DAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/builder",
|
|
3
|
-
"version": "19.0
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"builders": "./builders.json",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ng-doc/core": "19.0
|
|
15
|
-
"@ng-doc/utils": "19.0
|
|
14
|
+
"@ng-doc/core": "19.2.0",
|
|
15
|
+
"@ng-doc/utils": "19.2.0",
|
|
16
16
|
"@angular-devkit/architect": ">=0.1900.0 < 0.2000.0",
|
|
17
17
|
"@angular-devkit/build-angular": ">=19.0.0 < 20.0.0",
|
|
18
18
|
"minimatch": "9.0.1",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"tslib": "^2.6.2",
|
|
35
35
|
"ng-morph": "4.0.3",
|
|
36
36
|
"parsimmon": "^1.18.1",
|
|
37
|
-
"@parcel/watcher": "2.4.1"
|
|
37
|
+
"@parcel/watcher": "2.4.1",
|
|
38
|
+
"@microsoft/tsdoc": "0.15.1"
|
|
38
39
|
},
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"access": "public"
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
{% import "helpers/type.html.nunj" as typeMacro %}
|
|
4
4
|
{% import "helpers/methods.html.nunj" as methodsMacro %}
|
|
5
|
+
{% import "helpers/call-signature.html.nunj" as callSignatureMacro %}
|
|
5
6
|
{% import "helpers/properties.html.nunj" as propertiesMacro %}
|
|
6
7
|
{% import "helpers/accessors.html.nunj" as accessorsMacro %}
|
|
7
8
|
|
|
8
9
|
{% block overview %}
|
|
9
10
|
{%- set properties = declaration | getInterfaceProperties | excludeByJsDocTags('internal') | filterUselessMembers | sortByNodesName -%}
|
|
10
11
|
{%- set methods = declaration | getInterfaceMethods | excludeByJsDocTags('internal') | filterUselessMembers | sortByNodesName -%}
|
|
12
|
+
{%- set callSignatures = declaration | getInterfaceCallSignatures | excludeByJsDocTags('internal') -%}
|
|
11
13
|
{%- set accessors = declaration | getInterfaceAccessors | excludeByJsDocTags('internal') | filterUselessMembers | sortByNodesName -%}
|
|
12
14
|
|
|
13
15
|
{% if properties.length -%}
|
|
@@ -24,4 +26,12 @@
|
|
|
24
26
|
<h2>Methods</h2>
|
|
25
27
|
{{ methodsMacro.render(methods, declaration) }}
|
|
26
28
|
{%- endif %}
|
|
29
|
+
|
|
30
|
+
{% if callSignatures.length -%}
|
|
31
|
+
<h2>Call Signatures</h2>
|
|
32
|
+
|
|
33
|
+
{%- for c in callSignatures %}
|
|
34
|
+
{{ callSignatureMacro.render(c, declaration, "Call Signature #" + loop.index) }}
|
|
35
|
+
{% endfor -%}
|
|
36
|
+
{%- endif %}
|
|
27
37
|
{% endblock %}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{% extends "api/base.html.nunj" %}
|
|
2
2
|
|
|
3
|
+
{% import "helpers/properties.html.nunj" as propertiesMacro %}
|
|
3
4
|
{% import "helpers/code.html.nunj" as codeMacro %}
|
|
4
5
|
|
|
5
6
|
{% block overview %}
|
|
7
|
+
{%- set properties = declaration | getTypeAliasProperties | excludeByJsDocTags('internal') | filterUselessMembers | sortByNodesName -%}
|
|
8
|
+
|
|
9
|
+
{% if properties.length -%}
|
|
10
|
+
<h2>Properties</h2>
|
|
11
|
+
{{ propertiesMacro.render(properties, declaration, 'definedIn') }}
|
|
12
|
+
{%- endif %}
|
|
13
|
+
|
|
6
14
|
<h2>Presentation</h2>
|
|
7
15
|
{{ codeMacro.render(declaration | typeAliasPresentation, "typescript", false) }}
|
|
8
16
|
{% endblock %}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{% import "helpers/code.html.nunj" as codeMacro %}
|
|
2
|
+
{% import "helpers/type.html.nunj" as typeMacro %}
|
|
3
|
+
{% import "helpers/declaration-modifiers.html.nunj" as tagsMacro %}
|
|
4
|
+
{% import "helpers/parameters.html.nunj" as parametersMacro %}
|
|
5
|
+
{% import "helpers/no-content.html.nunj" as noContentMacro %}
|
|
6
|
+
{% import "helpers/status.html.nunj" as statusMacro %}
|
|
7
|
+
|
|
8
|
+
{% macro render(callSignature, origin, name) %}
|
|
9
|
+
{% set parameters = callSignature.getParameters() %}
|
|
10
|
+
{% set callSignatureChain = callSignature | getCallSignatureChain %}
|
|
11
|
+
{% set inheritedFrom = callSignature | getInheritedParent(origin) %}
|
|
12
|
+
{% set docNode = callSignatureChain | firstNodeWithComment %}
|
|
13
|
+
{% set overloads = callSignature.getOverloads() if callSignature.getOverloads else [] %}
|
|
14
|
+
{% set returnsTag = docNode | getJsDocTag('returns') %}
|
|
15
|
+
|
|
16
|
+
<table class="{{ statusMacro.class(callSignature) }}">
|
|
17
|
+
<thead>
|
|
18
|
+
<tr>
|
|
19
|
+
<th indexable="false">
|
|
20
|
+
<h3 dataSlugType="member">{{ name }}</h3>
|
|
21
|
+
<div class="ng-doc-node-details">
|
|
22
|
+
{%- if inheritedFrom %}
|
|
23
|
+
inherited from <code>{{ inheritedFrom.getName() }}</code>
|
|
24
|
+
{%- endif %}
|
|
25
|
+
</div>
|
|
26
|
+
</th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody>
|
|
30
|
+
<tr>
|
|
31
|
+
<td>
|
|
32
|
+
<div class="ng-doc-api-status">
|
|
33
|
+
{{ statusMacro.render(callSignature) }}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{% set description = docNode | getJsDocDescription %}
|
|
37
|
+
|
|
38
|
+
{{ description if description else noContentMacro.render('No documentation has been provided.') }}
|
|
39
|
+
|
|
40
|
+
{% include "parts/member-remarks.html.nunj" %}
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td>
|
|
45
|
+
<h5 class="no-anchor ng-doc-secondary-heading" indexable="false">Presentation</h5>
|
|
46
|
+
{{ codeMacro.render(callSignature | callSignaturePresentation, "typescript", false) }}
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td>
|
|
51
|
+
{%- if parameters.length %}
|
|
52
|
+
<h5 class="no-anchor ng-doc-secondary-heading" indexable="false">Parameters</h5>
|
|
53
|
+
{{ parametersMacro.render(parameters, docNode) }}
|
|
54
|
+
{%- endif %}
|
|
55
|
+
<h5 class="no-anchor ng-doc-secondary-heading" indexable="false">Returns</h5>
|
|
56
|
+
|
|
57
|
+
<div class="ng-doc-returns">
|
|
58
|
+
{{ typeMacro.returnType(callSignature) }}
|
|
59
|
+
{%- if returnsTag.length %}
|
|
60
|
+
<span> - </span>
|
|
61
|
+
{{ returnsTag | markdownToHtml }}
|
|
62
|
+
{%- endif %}
|
|
63
|
+
</div>
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
|
|
67
|
+
{% include "parts/member-examples.html.nunj" %}
|
|
68
|
+
</tbody>
|
|
69
|
+
</table>
|
|
70
|
+
{% endmacro %}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
{% import "helpers/status.html.nunj" as statusMacro %}
|
|
5
5
|
{% set examplesColSpan = 3 %}
|
|
6
6
|
|
|
7
|
-
{
|
|
7
|
+
{# mode='inheritedFrom' (classes/interfaces) or mode='definedIn' (type aliases) #}
|
|
8
|
+
{% macro render(properties, origin, mode='inheritedFrom') %}
|
|
8
9
|
<table class="ng-doc-api-table sticky first-colum-highlighted">
|
|
9
10
|
<thead>
|
|
10
11
|
<tr indexable="false">
|
|
@@ -16,6 +17,8 @@
|
|
|
16
17
|
<tbody>
|
|
17
18
|
{%- for property in properties %}
|
|
18
19
|
{% set propertyChain = property | getPropertyChain %}
|
|
20
|
+
{% set definedIn = property | getDefinedInParent(origin) %}
|
|
21
|
+
{% set definedInHasName = definedIn | isNamed %}
|
|
19
22
|
{% set inheritedFrom = property | getInheritedParent(origin) %}
|
|
20
23
|
{% set overriddenMember = property | getOverriddenMember %}
|
|
21
24
|
{% set implementedMember = property | getImplementedMember %}
|
|
@@ -26,7 +29,9 @@
|
|
|
26
29
|
{{ decoratorsMacro.render(property.getDecorators(), true) if property.getDecorators }}
|
|
27
30
|
<span>{{ property.getName() }}{{ tagsMacro.render(property, "badge") }}</span>
|
|
28
31
|
<div class="ng-doc-node-details">
|
|
29
|
-
{%- if
|
|
32
|
+
{%- if mode == 'definedIn' and definedIn and definedInHasName %}
|
|
33
|
+
defined in <code>{{ definedIn.getName() }}</code>
|
|
34
|
+
{%- elseif mode == 'inheritedFrom' and inheritedFrom %}
|
|
30
35
|
inherited from <code>{{ inheritedFrom.getName() }}</code>
|
|
31
36
|
{%- elseif overriddenMember %}
|
|
32
37
|
overrides
|
|
@@ -37,7 +42,7 @@
|
|
|
37
42
|
{%- endif %}
|
|
38
43
|
</div>
|
|
39
44
|
</td>
|
|
40
|
-
<td>{{ typeMacro.type(property) }}</td>
|
|
45
|
+
<td class="ng-doc-api-table-type">{{ typeMacro.type(property) }}</td>
|
|
41
46
|
<td>
|
|
42
47
|
<div class="ng-doc-api-status">
|
|
43
48
|
{{ statusMacro.render(property) }}
|