@ng-doc/builder 19.0.1 → 19.1.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 +4 -1
- package/engine/nunjucks/filters.js.map +1 -1
- package/helpers/get-js-doc.d.ts +5 -0
- package/helpers/get-js-doc.js +31 -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/index.d.ts +1 -0
- package/helpers/typescript/index.js +1 -0
- package/helpers/typescript/index.js.map +1 -1
- package/package.json +5 -4
- package/templates/api/interface-declaration.html.nunj +10 -0
- package/templates/helpers/call-signature.html.nunj +70 -0
|
@@ -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,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;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, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceCallSignatures, getInterfaceMethods, getInterfaceProperties, getJsDocDescription, getJsDocParam, getJsDocTag, getJsDocTags, getMemberParent, getMethodChain, getOverriddenMember, getPropertyChain, groupAccessors, hasJsDocTag, 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,10 @@
|
|
|
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.unique = exports.objectKeys = exports.kebabCase = 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.hasJsDocTag = exports.groupAccessors = exports.getPropertyChain = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getJsDocTags = exports.getJsDocTag = exports.getJsDocParam = exports.getJsDocDescription = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDeclarationType = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = 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.accessorPresentation = void 0;
|
|
4
|
+
exports.unique = exports.objectKeys = exports.kebabCase = 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.hasJsDocTag = exports.groupAccessors = 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.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
5
|
var helpers_1 = require("../../helpers");
|
|
6
6
|
Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
|
|
7
|
+
Object.defineProperty(exports, "callSignaturePresentation", { enumerable: true, get: function () { return helpers_1.callSignaturePresentation; } });
|
|
7
8
|
Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
|
|
8
9
|
Object.defineProperty(exports, "declarationImport", { enumerable: true, get: function () { return helpers_1.declarationImport; } });
|
|
9
10
|
Object.defineProperty(exports, "displayReturnType", { enumerable: true, get: function () { return helpers_1.displayReturnType; } });
|
|
@@ -16,6 +17,7 @@ Object.defineProperty(exports, "filterUselessMembers", { enumerable: true, get:
|
|
|
16
17
|
Object.defineProperty(exports, "firstNodeWithComment", { enumerable: true, get: function () { return helpers_1.firstNodeWithComment; } });
|
|
17
18
|
Object.defineProperty(exports, "functionPresentation", { enumerable: true, get: function () { return helpers_1.functionPresentation; } });
|
|
18
19
|
Object.defineProperty(exports, "getAccessorChain", { enumerable: true, get: function () { return helpers_1.getAccessorChain; } });
|
|
20
|
+
Object.defineProperty(exports, "getCallSignatureChain", { enumerable: true, get: function () { return helpers_1.getCallSignatureChain; } });
|
|
19
21
|
Object.defineProperty(exports, "getClassAccessors", { enumerable: true, get: function () { return helpers_1.getClassAccessors; } });
|
|
20
22
|
Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
|
|
21
23
|
Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
|
|
@@ -23,6 +25,7 @@ Object.defineProperty(exports, "getDeclarationType", { enumerable: true, get: fu
|
|
|
23
25
|
Object.defineProperty(exports, "getImplementedMember", { enumerable: true, get: function () { return helpers_1.getImplementedMember; } });
|
|
24
26
|
Object.defineProperty(exports, "getInheritedParent", { enumerable: true, get: function () { return helpers_1.getInheritedParent; } });
|
|
25
27
|
Object.defineProperty(exports, "getInterfaceAccessors", { enumerable: true, get: function () { return helpers_1.getInterfaceAccessors; } });
|
|
28
|
+
Object.defineProperty(exports, "getInterfaceCallSignatures", { enumerable: true, get: function () { return helpers_1.getInterfaceCallSignatures; } });
|
|
26
29
|
Object.defineProperty(exports, "getInterfaceMethods", { enumerable: true, get: function () { return helpers_1.getInterfaceMethods; } });
|
|
27
30
|
Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get: function () { return helpers_1.getInterfaceProperties; } });
|
|
28
31
|
Object.defineProperty(exports, "getJsDocDescription", { enumerable: true, get: function () { return helpers_1.getJsDocDescription; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/filters.ts"],"names":[],"mappings":";AAAA,yGAAyG;;;AAEzG,
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/filters.ts"],"names":[],"mappings":";AAAA,yGAAyG;;;AAEzG,yCA8CuB;AA7CrB,+GAAA,oBAAoB,OAAA;AACpB,oHAAA,yBAAyB,OAAA;AACzB,kHAAA,uBAAuB,OAAA;AACvB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,sGAAA,WAAW,OAAA;AACX,6GAAA,kBAAkB,OAAA;AAClB,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,2GAAA,gBAAgB,OAAA;AAChB,gHAAA,qBAAqB,OAAA;AACrB,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,6GAAA,kBAAkB,OAAA;AAClB,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AACpB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AACrB,qHAAA,0BAA0B,OAAA;AAC1B,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,8GAAA,mBAAmB,OAAA;AACnB,wGAAA,aAAa,OAAA;AACb,sGAAA,WAAW,OAAA;AACX,uGAAA,YAAY,OAAA;AACZ,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AACX,yGAAA,cAAc,OAAA;AACd,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,gHAAA,qBAAqB,OAAA;AACrB,2GAAA,gBAAgB,OAAA;AAChB,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AAEtB,+CAAuD;AAA9C,2GAAA,gBAAgB,OAAA;AACzB,qCAAsE;AAA7D,+FAAA,OAAO,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,8FAAA,MAAM,OAAA"}
|
package/helpers/get-js-doc.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
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
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
*
|
|
4
9
|
* @param node
|
package/helpers/get-js-doc.js
CHANGED
|
@@ -1,24 +1,47 @@
|
|
|
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");
|
|
11
|
+
const tsdoc_2 = require("@microsoft/tsdoc");
|
|
9
12
|
const core_1 = require("@ng-doc/core");
|
|
10
13
|
const markdown_to_html_1 = require("./markdown-to-html");
|
|
14
|
+
class Formatter {
|
|
15
|
+
static renderDocNode(docNode) {
|
|
16
|
+
let result = '';
|
|
17
|
+
if (docNode) {
|
|
18
|
+
if (docNode instanceof tsdoc_2.DocExcerpt) {
|
|
19
|
+
result += docNode.content.toString();
|
|
20
|
+
}
|
|
21
|
+
for (const childNode of docNode.getChildNodes()) {
|
|
22
|
+
result += Formatter.renderDocNode(childNode);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
static renderDocNodes(docNodes) {
|
|
28
|
+
let result = '';
|
|
29
|
+
for (const docNode of docNodes) {
|
|
30
|
+
result += Formatter.renderDocNode(docNode);
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Formatter = Formatter;
|
|
11
36
|
/**
|
|
12
37
|
*
|
|
13
38
|
* @param node
|
|
14
39
|
*/
|
|
15
40
|
function getJsDocDescription(node) {
|
|
16
41
|
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();
|
|
42
|
+
const tsdocParser = new tsdoc_1.TSDocParser();
|
|
43
|
+
const parserContext = tsdocParser.parseString(jsDocs[0]?.getText() ?? '');
|
|
44
|
+
return (0, markdown_to_html_1.markdownToHtml)(Formatter.renderDocNodes(parserContext.docComment.summarySection.getChildNodes())).trim();
|
|
22
45
|
}
|
|
23
46
|
/**
|
|
24
47
|
*
|
|
@@ -90,32 +113,9 @@ function hasJsDocTag(node, tagName) {
|
|
|
90
113
|
*/
|
|
91
114
|
function getJsDocParam(node, paramName) {
|
|
92
115
|
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('');
|
|
116
|
+
const tsdocParser = new tsdoc_1.TSDocParser();
|
|
117
|
+
const parserContext = tsdocParser.parseString(jsDocs[0]?.getText() ?? '');
|
|
118
|
+
const param = Formatter.renderDocNodes(parserContext.docComment.params.tryGetBlockByName(paramName)?.getChildNodes() ?? []);
|
|
99
119
|
return (0, markdown_to_html_1.markdownToHtml)(param).trim();
|
|
100
120
|
}
|
|
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
121
|
//# 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":";;;AAkCA,kDAQC;AAOD,kCAUC;AAOD,oCAUC;AAMD,0CAqBC;AAOD,kCAQC;AAOD,sCAUC;AAvID,4CAA+C;AAC/C,4CAA4D;AAC5D,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,CAAC,OAAO,CAAC,QAA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GAAG,IAAI,mBAAW,EAAE,CAAC;IACtC,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE1E,MAAM,KAAK,GAAG,SAAS,CAAC,cAAc,CACpC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CACpF,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,oDAgB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,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,SAAS,eAAe,CAAC,IAAsB;IAC7C,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,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"}
|
|
@@ -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);
|
|
@@ -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,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,qDAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/builder",
|
|
3
|
-
"version": "19.0
|
|
3
|
+
"version": "19.1.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.1.0",
|
|
15
|
+
"@ng-doc/utils": "19.1.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 %}
|
|
@@ -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 %}
|