@ng-doc/builder 15.0.0-beta.29 → 15.0.0-beta.30
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/.cache/libs/app/components/page-map/page-map.component.js +1 -0
- package/engine/.cache/libs/builder/engine/template-filters.js +8 -5
- package/engine/.cache/libs/builder/helpers/presentation.js +15 -1
- package/engine/.cache/libs/builder/helpers/typescript/accessor/accessor.js +2 -0
- package/engine/.cache/libs/builder/helpers/typescript/accessor/get-accessor-chain.js +49 -0
- package/engine/.cache/libs/builder/helpers/typescript/accessor/get-class-accessors.js +30 -0
- package/engine/.cache/libs/builder/helpers/typescript/accessor/get-interface-accessors.js +35 -0
- package/engine/.cache/libs/builder/helpers/typescript/accessor/group-accessors.js +22 -0
- package/engine/.cache/libs/builder/helpers/typescript/accessor/index.js +8 -0
- package/engine/.cache/libs/builder/helpers/typescript/index.js +2 -0
- package/engine/.cache/libs/builder/helpers/typescript/interface/get-interface-member.js +17 -0
- package/engine/.cache/libs/builder/helpers/typescript/member/find-member.js +26 -0
- package/engine/.cache/libs/builder/helpers/typescript/member/get-implemented-member.js +46 -0
- package/engine/.cache/libs/builder/helpers/typescript/member/get-overridden-member.js +29 -0
- package/engine/.cache/libs/builder/helpers/typescript/member/index.js +7 -0
- package/engine/.cache/libs/builder/helpers/typescript/member/member-type.js +2 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-method-chain.js +1 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/index.js +0 -2
- package/engine/.cache/libs/builder/helpers/typescript/property/get-property-chain.js +1 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/index.js +0 -2
- package/engine/template-filters.d.ts +1 -1
- package/engine/template-filters.js +8 -5
- package/engine/template-filters.js.map +1 -1
- package/helpers/presentation.d.ts +6 -1
- package/helpers/presentation.js +15 -1
- package/helpers/presentation.js.map +1 -1
- package/helpers/typescript/accessor/accessor.d.ts +5 -0
- package/helpers/typescript/accessor/accessor.js +3 -0
- package/helpers/typescript/accessor/accessor.js.map +1 -0
- package/helpers/typescript/accessor/get-accessor-chain.d.ts +7 -0
- package/helpers/typescript/accessor/get-accessor-chain.js +50 -0
- package/helpers/typescript/accessor/get-accessor-chain.js.map +1 -0
- package/helpers/typescript/accessor/get-class-accessors.d.ts +6 -0
- package/helpers/typescript/accessor/get-class-accessors.js +31 -0
- package/helpers/typescript/accessor/get-class-accessors.js.map +1 -0
- package/helpers/typescript/accessor/get-interface-accessors.d.ts +6 -0
- package/helpers/typescript/accessor/get-interface-accessors.js +36 -0
- package/helpers/typescript/accessor/get-interface-accessors.js.map +1 -0
- package/helpers/typescript/accessor/group-accessors.d.ts +7 -0
- package/helpers/typescript/accessor/group-accessors.js +23 -0
- package/helpers/typescript/accessor/group-accessors.js.map +1 -0
- package/helpers/typescript/accessor/index.d.ts +5 -0
- package/helpers/typescript/accessor/index.js +9 -0
- package/helpers/typescript/accessor/index.js.map +1 -0
- 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/interface/get-interface-member.d.ts +8 -0
- package/helpers/typescript/interface/get-interface-member.js +18 -0
- package/helpers/typescript/interface/get-interface-member.js.map +1 -0
- package/helpers/typescript/member/find-member.d.ts +4 -0
- package/helpers/typescript/member/find-member.js +28 -0
- package/helpers/typescript/member/find-member.js.map +1 -0
- package/helpers/typescript/member/get-implemented-member.d.ts +7 -0
- package/helpers/typescript/member/get-implemented-member.js +47 -0
- package/helpers/typescript/member/get-implemented-member.js.map +1 -0
- package/helpers/typescript/member/get-overridden-member.d.ts +7 -0
- package/helpers/typescript/member/get-overridden-member.js +30 -0
- package/helpers/typescript/member/get-overridden-member.js.map +1 -0
- package/helpers/typescript/member/index.d.ts +4 -0
- package/helpers/typescript/member/index.js +8 -0
- package/helpers/typescript/member/index.js.map +1 -0
- package/helpers/typescript/member/member-type.d.ts +4 -0
- package/helpers/typescript/member/member-type.js +3 -0
- package/helpers/typescript/member/member-type.js.map +1 -0
- package/helpers/typescript/method/get-method-chain.js +1 -0
- package/helpers/typescript/method/get-method-chain.js.map +1 -1
- package/helpers/typescript/method/index.d.ts +0 -2
- package/helpers/typescript/method/index.js +0 -2
- package/helpers/typescript/method/index.js.map +1 -1
- package/helpers/typescript/property/get-property-chain.js +1 -0
- package/helpers/typescript/property/get-property-chain.js.map +1 -1
- package/helpers/typescript/property/index.d.ts +0 -2
- package/helpers/typescript/property/index.js +0 -2
- package/helpers/typescript/property/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/api/class.html.nunj +19 -2
- package/templates/api/interface.html.nunj +9 -0
- package/templates/helpers/accessor.html.nunj +68 -0
- package/templates/helpers/accessors.html.nunj +7 -0
- package/templates/helpers/method.html.nunj +6 -6
- package/templates/helpers/properties.html.nunj +6 -8
- package/engine/.cache/libs/builder/helpers/typescript/method/get-implemented-method.js +0 -44
- package/engine/.cache/libs/builder/helpers/typescript/method/get-overridden-method.js +0 -26
- package/engine/.cache/libs/builder/helpers/typescript/property/get-implemented-property.js +0 -44
- package/engine/.cache/libs/builder/helpers/typescript/property/get-overridden-property.js +0 -26
- package/helpers/typescript/method/get-implemented-method.d.ts +0 -7
- package/helpers/typescript/method/get-implemented-method.js +0 -46
- package/helpers/typescript/method/get-implemented-method.js.map +0 -1
- package/helpers/typescript/method/get-overridden-method.d.ts +0 -7
- package/helpers/typescript/method/get-overridden-method.js +0 -28
- package/helpers/typescript/method/get-overridden-method.js.map +0 -1
- package/helpers/typescript/property/get-implemented-property.d.ts +0 -7
- package/helpers/typescript/property/get-implemented-property.js +0 -46
- package/helpers/typescript/property/get-implemented-property.js.map +0 -1
- package/helpers/typescript/property/get-overridden-property.d.ts +0 -7
- package/helpers/typescript/property/get-overridden-property.js +0 -28
- package/helpers/typescript/property/get-overridden-property.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
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/decorators.html.nunj" as decoratorsMacro %}
|
|
6
|
+
{% import "helpers/no-content.html.nunj" as noContentMacro %}
|
|
7
|
+
{% import "helpers/modifier.html.nunj" as modifierMacro %}
|
|
8
|
+
|
|
9
|
+
{% macro render(accessor, originalParent) %}
|
|
10
|
+
{% macro renderAccessor(accessor, type, originalParent) %}
|
|
11
|
+
{% set parameters = accessor.getParameters() %}
|
|
12
|
+
{% set accessorChain = accessor | getAccessorChain %}
|
|
13
|
+
{% set inheritedFrom = accessor.getParent() if accessor.getParent() !== originalParent %}
|
|
14
|
+
{% set overriddenMember = accessor | getOverriddenMember %}
|
|
15
|
+
{% set implementedMember = accessor | getImplementedMember %}
|
|
16
|
+
{% set docNode = accessorChain | firstNodeWithComment %}
|
|
17
|
+
|
|
18
|
+
<div class="ng-doc-table-wrapper">
|
|
19
|
+
<table class="ng-doc-accessor-table">
|
|
20
|
+
<thead>
|
|
21
|
+
<tr>
|
|
22
|
+
<th>
|
|
23
|
+
{{ decoratorsMacro.render(accessor.getDecorators()) if accessor.getDecorators }}
|
|
24
|
+
{{ tagsMacro.render(accessor, 'modifier') }}
|
|
25
|
+
<h3>{{ modifierMacro.render(type) }} {{ accessor.getName() }}</h3>
|
|
26
|
+
<div class="ng-doc-node-details">
|
|
27
|
+
{%- if inheritedFrom %}
|
|
28
|
+
inherited from <code>{{ inheritedFrom.getName() }}</code>
|
|
29
|
+
{%- elseif overriddenMember %}
|
|
30
|
+
overrides <code>{{ overriddenMember.getParent().getName() }}</code>
|
|
31
|
+
{%- elseif implementedMember %}
|
|
32
|
+
implements <code>{{ implementedMember.getParent().getName() }}</code>
|
|
33
|
+
{%- endif %}
|
|
34
|
+
</div>
|
|
35
|
+
</th>
|
|
36
|
+
</tr>
|
|
37
|
+
</thead>
|
|
38
|
+
<tbody>
|
|
39
|
+
<tr>
|
|
40
|
+
<td>
|
|
41
|
+
{% set description = docNode | extractDocs %}
|
|
42
|
+
|
|
43
|
+
{{ description if description else noContentMacro.render('No documentation has been provided.') }}
|
|
44
|
+
</td>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td>
|
|
48
|
+
<h5 class="no-anchor">Presentation</h5>
|
|
49
|
+
{{ codeMacro.render(accessor | accessorPresentation, "typescript", false) }}
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>
|
|
54
|
+
<h5 class="no-anchor">Type</h5>
|
|
55
|
+
<p>
|
|
56
|
+
{{ typeMacro.render(accessor.getType()) }}
|
|
57
|
+
</p>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</tbody>
|
|
61
|
+
</table>
|
|
62
|
+
</div>
|
|
63
|
+
{% endmacro %}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
{{ renderAccessor(accessor.get, "get", originalParent) if accessor.get }}
|
|
67
|
+
{{ renderAccessor(accessor.set, "set", originalParent) if accessor.set }}
|
|
68
|
+
{% endmacro %}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
{% set parameters = method.getParameters() %}
|
|
10
10
|
{% set methodChain = method | getMethodChain %}
|
|
11
11
|
{% set inheritedFrom = method.getParent() if method.getParent() !== originalParent %}
|
|
12
|
-
{% set
|
|
13
|
-
{% set
|
|
12
|
+
{% set overriddenMember = method | getOverriddenMember %}
|
|
13
|
+
{% set implementedMember = method | getImplementedMember %}
|
|
14
14
|
{% set docNode = methodChain | firstNodeWithComment %}
|
|
15
15
|
|
|
16
16
|
<div class="ng-doc-table-wrapper">
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
<div class="ng-doc-node-details">
|
|
25
25
|
{%- if inheritedFrom %}
|
|
26
26
|
inherited from <code>{{ inheritedFrom.getName() }}</code>
|
|
27
|
-
{%- elseif
|
|
28
|
-
overrides <code>{{
|
|
29
|
-
{%- elseif
|
|
30
|
-
implements <code>{{
|
|
27
|
+
{%- elseif overriddenMember %}
|
|
28
|
+
overrides <code>{{ overriddenMember.getParent().getName() }}</code>
|
|
29
|
+
{%- elseif implementedMember %}
|
|
30
|
+
implements <code>{{ implementedMember.getParent().getName() }}</code>
|
|
31
31
|
{%- endif %}
|
|
32
32
|
</div>
|
|
33
33
|
</th>
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
{%- for property in properties %}
|
|
17
17
|
{% set propertyChain = property | getPropertyChain %}
|
|
18
18
|
{% set inheritedFrom = property.getParent() if property.getParent() !== originalParent %}
|
|
19
|
-
{% set
|
|
20
|
-
{% set
|
|
19
|
+
{% set overriddenMember = property | getOverriddenMember %}
|
|
20
|
+
{% set implementedMember = property | getImplementedMember %}
|
|
21
21
|
{% set docNode = propertyChain | firstNodeWithComment %}
|
|
22
22
|
|
|
23
23
|
<tr>
|
|
@@ -27,12 +27,10 @@
|
|
|
27
27
|
<div class="ng-doc-node-details">
|
|
28
28
|
{%- if inheritedFrom %}
|
|
29
29
|
inherited from <code>{{ inheritedFrom.getName() }}</code>
|
|
30
|
-
{%- elseif
|
|
31
|
-
overrides
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
implements
|
|
35
|
-
<code>{{ implementedProperty.getParent().getName() }}</code>
|
|
30
|
+
{%- elseif overriddenMember %}
|
|
31
|
+
overrides <code>{{ overriddenMember.getParent().getName() }}</code>
|
|
32
|
+
{%- elseif implementedMember %}
|
|
33
|
+
implements <code>{{ implementedMember.getParent().getName() }}</code>
|
|
36
34
|
{%- endif %}
|
|
37
35
|
</div>
|
|
38
36
|
</td>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImplementedMethod = void 0;
|
|
4
|
-
const core_1 = require("@ng-doc/core");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const class_1 = require("../class");
|
|
7
|
-
const find_interface_1 = require("../interface/find-interface");
|
|
8
|
-
/**
|
|
9
|
-
* Returns method that was implemented by the provided one
|
|
10
|
-
*
|
|
11
|
-
* @param method - Target method
|
|
12
|
-
*/
|
|
13
|
-
function getImplementedMethod(method) {
|
|
14
|
-
const parent = method.getParent();
|
|
15
|
-
const name = method.getName();
|
|
16
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
-
const mtd = (0, class_1.findBaseClass)(parent, (cls) => !!cls.getMethod(name))?.getMethod(name);
|
|
18
|
-
if (mtd?.isAbstract) {
|
|
19
|
-
return mtd;
|
|
20
|
-
}
|
|
21
|
-
const nodes = parent
|
|
22
|
-
.getImplements()
|
|
23
|
-
.map((expr) => expr.getType().getSymbol()?.getDeclarations()[0])
|
|
24
|
-
.filter(core_1.isPresent)
|
|
25
|
-
// Reverse implements because the latest one overrides previous one
|
|
26
|
-
.reverse();
|
|
27
|
-
for (const node of nodes) {
|
|
28
|
-
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
29
|
-
const mtd = (0, class_1.findClass)(node, (cls) => !!cls.getMethod(name))?.getMethod(name);
|
|
30
|
-
if (mtd?.isAbstract) {
|
|
31
|
-
return mtd;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
35
|
-
const mtd = (0, find_interface_1.findInterface)(node, (int) => !!int.getMethod(name))?.getMethod(name);
|
|
36
|
-
if (mtd) {
|
|
37
|
-
return mtd;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
exports.getImplementedMethod = getImplementedMethod;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverriddenMethod = void 0;
|
|
4
|
-
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const class_1 = require("../class");
|
|
6
|
-
const interface_1 = require("../interface");
|
|
7
|
-
/**
|
|
8
|
-
* Returns method that was overridden by the provided one
|
|
9
|
-
*
|
|
10
|
-
* @param method - Target method
|
|
11
|
-
*/
|
|
12
|
-
function getOverriddenMethod(method) {
|
|
13
|
-
const parent = method.getParent();
|
|
14
|
-
const name = method.getName();
|
|
15
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
16
|
-
return (0, class_1.findBaseClass)(parent, (cls) => {
|
|
17
|
-
const mtd = cls.getMethod(name);
|
|
18
|
-
return !!mtd && !mtd.isAbstract();
|
|
19
|
-
})?.getMethod(name);
|
|
20
|
-
}
|
|
21
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
22
|
-
return (0, interface_1.findInterface)(parent, (int) => int !== parent && !!int.getMethod(name))?.getMethod(name);
|
|
23
|
-
}
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
exports.getOverriddenMethod = getOverriddenMethod;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImplementedProperty = void 0;
|
|
4
|
-
const core_1 = require("@ng-doc/core");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const class_1 = require("../class");
|
|
7
|
-
const find_interface_1 = require("../interface/find-interface");
|
|
8
|
-
/**
|
|
9
|
-
* Returns property that was implemented by the provided one
|
|
10
|
-
*
|
|
11
|
-
* @param property - Target property
|
|
12
|
-
*/
|
|
13
|
-
function getImplementedProperty(property) {
|
|
14
|
-
const parent = property.getParent();
|
|
15
|
-
const name = property.getName();
|
|
16
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
-
const prop = (0, class_1.findBaseClass)(parent, (cls) => !!cls.getProperty(name))?.getProperty(name);
|
|
18
|
-
if (prop?.isAbstract) {
|
|
19
|
-
return prop;
|
|
20
|
-
}
|
|
21
|
-
const nodes = parent
|
|
22
|
-
.getImplements()
|
|
23
|
-
.map((expr) => expr.getType().getSymbol()?.getDeclarations()[0])
|
|
24
|
-
.filter(core_1.isPresent)
|
|
25
|
-
// Reverse implements because the latest one overrides previous one
|
|
26
|
-
.reverse();
|
|
27
|
-
for (const node of nodes) {
|
|
28
|
-
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
29
|
-
const prop = (0, class_1.findClass)(node, (cls) => !!cls.getProperty(name))?.getProperty(name);
|
|
30
|
-
if (prop?.isAbstract) {
|
|
31
|
-
return prop;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
35
|
-
const prop = (0, find_interface_1.findInterface)(node, (int) => !!int.getProperty(name))?.getProperty(name);
|
|
36
|
-
if (prop) {
|
|
37
|
-
return prop;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
exports.getImplementedProperty = getImplementedProperty;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverriddenProperty = void 0;
|
|
4
|
-
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const class_1 = require("../class");
|
|
6
|
-
const interface_1 = require("../interface");
|
|
7
|
-
/**
|
|
8
|
-
* Returns property that was overridden by the provided one
|
|
9
|
-
*
|
|
10
|
-
* @param property - Target method
|
|
11
|
-
*/
|
|
12
|
-
function getOverriddenProperty(property) {
|
|
13
|
-
const parent = property.getParent();
|
|
14
|
-
const name = property.getName();
|
|
15
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
16
|
-
return (0, class_1.findBaseClass)(parent, (cls) => {
|
|
17
|
-
const prop = cls.getProperty(name);
|
|
18
|
-
return !!prop && !prop.isAbstract();
|
|
19
|
-
})?.getProperty(name);
|
|
20
|
-
}
|
|
21
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
22
|
-
return (0, interface_1.findInterface)(parent, (int) => int !== parent && !!int.getProperty(name))?.getProperty(name);
|
|
23
|
-
}
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
exports.getOverriddenProperty = getOverriddenProperty;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MethodDeclaration, MethodSignature } from 'ts-morph';
|
|
2
|
-
/**
|
|
3
|
-
* Returns method that was implemented by the provided one
|
|
4
|
-
*
|
|
5
|
-
* @param method - Target method
|
|
6
|
-
*/
|
|
7
|
-
export declare function getImplementedMethod(method: MethodDeclaration | MethodSignature): MethodDeclaration | MethodSignature | undefined;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImplementedMethod = void 0;
|
|
4
|
-
const core_1 = require("@ng-doc/core");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const class_1 = require("../class");
|
|
7
|
-
const find_interface_1 = require("../interface/find-interface");
|
|
8
|
-
/**
|
|
9
|
-
* Returns method that was implemented by the provided one
|
|
10
|
-
*
|
|
11
|
-
* @param method - Target method
|
|
12
|
-
*/
|
|
13
|
-
function getImplementedMethod(method) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
-
const parent = method.getParent();
|
|
16
|
-
const name = method.getName();
|
|
17
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
18
|
-
const mtd = (_a = (0, class_1.findBaseClass)(parent, (cls) => !!cls.getMethod(name))) === null || _a === void 0 ? void 0 : _a.getMethod(name);
|
|
19
|
-
if (mtd === null || mtd === void 0 ? void 0 : mtd.isAbstract) {
|
|
20
|
-
return mtd;
|
|
21
|
-
}
|
|
22
|
-
const nodes = parent
|
|
23
|
-
.getImplements()
|
|
24
|
-
.map((expr) => { var _a; return (_a = expr.getType().getSymbol()) === null || _a === void 0 ? void 0 : _a.getDeclarations()[0]; })
|
|
25
|
-
.filter(core_1.isPresent)
|
|
26
|
-
// Reverse implements because the latest one overrides previous one
|
|
27
|
-
.reverse();
|
|
28
|
-
for (const node of nodes) {
|
|
29
|
-
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
30
|
-
const mtd = (_b = (0, class_1.findClass)(node, (cls) => !!cls.getMethod(name))) === null || _b === void 0 ? void 0 : _b.getMethod(name);
|
|
31
|
-
if (mtd === null || mtd === void 0 ? void 0 : mtd.isAbstract) {
|
|
32
|
-
return mtd;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
36
|
-
const mtd = (_c = (0, find_interface_1.findInterface)(node, (int) => !!int.getMethod(name))) === null || _c === void 0 ? void 0 : _c.getMethod(name);
|
|
37
|
-
if (mtd) {
|
|
38
|
-
return mtd;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
exports.getImplementedMethod = getImplementedMethod;
|
|
46
|
-
//# sourceMappingURL=get-implemented-method.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-implemented-method.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/method/get-implemented-method.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,uCAOkB;AAElB,oCAAkD;AAClD,gEAA0D;AAE1D;;;;GAIG;AACH,SAAgB,oBAAoB,CACnC,MAA2C;;IAE3C,MAAM,MAAM,GAAqB,MAAM,CAAC,SAAS,EAAE,CAAC;IACpD,MAAM,IAAI,GAAW,MAAM,CAAC,OAAO,EAAE,CAAC;IAEtC,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACpC,MAAM,GAAG,GAAkC,MAAA,IAAA,qBAAa,EACvD,MAAM,EACN,CAAC,GAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAChD,0CAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,EAAE;YACpB,OAAO,GAAG,CAAC;SACX;QAED,MAAM,KAAK,GAAW,MAAM;aAC1B,aAAa,EAAE;aACf,GAAG,CAAC,CAAC,IAAiC,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,0CAAE,eAAe,GAAG,CAAC,CAAC,CAAA,EAAA,CAAC;aAC5F,MAAM,CAAC,gBAAS,CAAC;YAClB,mEAAmE;aAClE,OAAO,EAAE,CAAC;QAEZ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,eAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;gBAClC,MAAM,GAAG,GAAkC,MAAA,IAAA,iBAAS,EACnD,IAAI,EACJ,CAAC,GAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAChD,0CAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAEnB,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,EAAE;oBACpB,OAAO,GAAG,CAAC;iBACX;aACD;YAED,IAAI,eAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;gBACtC,MAAM,GAAG,GAAgC,MAAA,IAAA,8BAAa,EACrD,IAAI,EACJ,CAAC,GAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CACpD,0CAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAEnB,IAAI,GAAG,EAAE;oBACR,OAAO,GAAG,CAAC;iBACX;aACD;SACD;KACD;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAjDD,oDAiDC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MethodDeclaration, MethodSignature } from 'ts-morph';
|
|
2
|
-
/**
|
|
3
|
-
* Returns method that was overridden by the provided one
|
|
4
|
-
*
|
|
5
|
-
* @param method - Target method
|
|
6
|
-
*/
|
|
7
|
-
export declare function getOverriddenMethod(method: MethodDeclaration | MethodSignature): MethodDeclaration | MethodSignature | undefined;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverriddenMethod = void 0;
|
|
4
|
-
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const class_1 = require("../class");
|
|
6
|
-
const interface_1 = require("../interface");
|
|
7
|
-
/**
|
|
8
|
-
* Returns method that was overridden by the provided one
|
|
9
|
-
*
|
|
10
|
-
* @param method - Target method
|
|
11
|
-
*/
|
|
12
|
-
function getOverriddenMethod(method) {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const parent = method.getParent();
|
|
15
|
-
const name = method.getName();
|
|
16
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
-
return (_a = (0, class_1.findBaseClass)(parent, (cls) => {
|
|
18
|
-
const mtd = cls.getMethod(name);
|
|
19
|
-
return !!mtd && !mtd.isAbstract();
|
|
20
|
-
})) === null || _a === void 0 ? void 0 : _a.getMethod(name);
|
|
21
|
-
}
|
|
22
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
23
|
-
return (_b = (0, interface_1.findInterface)(parent, (int) => int !== parent && !!int.getMethod(name))) === null || _b === void 0 ? void 0 : _b.getMethod(name);
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
exports.getOverriddenMethod = getOverriddenMethod;
|
|
28
|
-
//# sourceMappingURL=get-overridden-method.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-overridden-method.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/method/get-overridden-method.ts"],"names":[],"mappings":";;;AAAA,uCAA0G;AAE1G,oCAAuC;AACvC,4CAA2C;AAE3C;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,MAA2C;;IAE3C,MAAM,MAAM,GAAqB,MAAM,CAAC,SAAS,EAAE,CAAC;IACpD,MAAM,IAAI,GAAW,MAAM,CAAC,OAAO,EAAE,CAAC;IAEtC,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACpC,OAAO,MAAA,IAAA,qBAAa,EAAC,MAAM,EAAE,CAAC,GAAqB,EAAE,EAAE;YACtD,MAAM,GAAG,GAAkC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAE/D,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;QACnC,CAAC,CAAC,0CAAE,SAAS,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,IAAI,eAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE;QACxC,OAAO,MAAA,IAAA,yBAAa,EAAC,MAAM,EAAE,CAAC,GAAyB,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,0CAAE,SAAS,CAC9G,IAAI,CACJ,CAAC;KACF;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AArBD,kDAqBC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropertyDeclaration, PropertySignature } from 'ts-morph';
|
|
2
|
-
/**
|
|
3
|
-
* Returns property that was implemented by the provided one
|
|
4
|
-
*
|
|
5
|
-
* @param property - Target property
|
|
6
|
-
*/
|
|
7
|
-
export declare function getImplementedProperty(property: PropertyDeclaration | PropertySignature): PropertyDeclaration | PropertySignature | undefined;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImplementedProperty = void 0;
|
|
4
|
-
const core_1 = require("@ng-doc/core");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
6
|
-
const class_1 = require("../class");
|
|
7
|
-
const find_interface_1 = require("../interface/find-interface");
|
|
8
|
-
/**
|
|
9
|
-
* Returns property that was implemented by the provided one
|
|
10
|
-
*
|
|
11
|
-
* @param property - Target property
|
|
12
|
-
*/
|
|
13
|
-
function getImplementedProperty(property) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
-
const parent = property.getParent();
|
|
16
|
-
const name = property.getName();
|
|
17
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
18
|
-
const prop = (_a = (0, class_1.findBaseClass)(parent, (cls) => !!cls.getProperty(name))) === null || _a === void 0 ? void 0 : _a.getProperty(name);
|
|
19
|
-
if (prop === null || prop === void 0 ? void 0 : prop.isAbstract) {
|
|
20
|
-
return prop;
|
|
21
|
-
}
|
|
22
|
-
const nodes = parent
|
|
23
|
-
.getImplements()
|
|
24
|
-
.map((expr) => { var _a; return (_a = expr.getType().getSymbol()) === null || _a === void 0 ? void 0 : _a.getDeclarations()[0]; })
|
|
25
|
-
.filter(core_1.isPresent)
|
|
26
|
-
// Reverse implements because the latest one overrides previous one
|
|
27
|
-
.reverse();
|
|
28
|
-
for (const node of nodes) {
|
|
29
|
-
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
30
|
-
const prop = (_b = (0, class_1.findClass)(node, (cls) => !!cls.getProperty(name))) === null || _b === void 0 ? void 0 : _b.getProperty(name);
|
|
31
|
-
if (prop === null || prop === void 0 ? void 0 : prop.isAbstract) {
|
|
32
|
-
return prop;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
36
|
-
const prop = (_c = (0, find_interface_1.findInterface)(node, (int) => !!int.getProperty(name))) === null || _c === void 0 ? void 0 : _c.getProperty(name);
|
|
37
|
-
if (prop) {
|
|
38
|
-
return prop;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
exports.getImplementedProperty = getImplementedProperty;
|
|
46
|
-
//# sourceMappingURL=get-implemented-property.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-implemented-property.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-implemented-property.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,uCAOkB;AAElB,oCAAkD;AAClD,gEAA0D;AAE1D;;;;GAIG;AACH,SAAgB,sBAAsB,CACrC,QAAiD;;IAEjD,MAAM,MAAM,GAAqB,QAAQ,CAAC,SAAS,EAAE,CAAC;IACtD,MAAM,IAAI,GAAW,QAAQ,CAAC,OAAO,EAAE,CAAC;IAExC,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACpC,MAAM,IAAI,GAAoC,MAAA,IAAA,qBAAa,EAC1D,MAAM,EACN,CAAC,GAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAClD,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE;YACrB,OAAO,IAAI,CAAC;SACZ;QAED,MAAM,KAAK,GAAW,MAAM;aAC1B,aAAa,EAAE;aACf,GAAG,CAAC,CAAC,IAAiC,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,0CAAE,eAAe,GAAG,CAAC,CAAC,CAAA,EAAA,CAAC;aAC5F,MAAM,CAAC,gBAAS,CAAC;YAClB,mEAAmE;aAClE,OAAO,EAAE,CAAC;QAEZ,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACzB,IAAI,eAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;gBAClC,MAAM,IAAI,GAAoC,MAAA,IAAA,iBAAS,EACtD,IAAI,EACJ,CAAC,GAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAClD,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;gBAErB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE;oBACrB,OAAO,IAAI,CAAC;iBACZ;aACD;YAED,IAAI,eAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;gBACtC,MAAM,IAAI,GAAkC,MAAA,IAAA,8BAAa,EACxD,IAAI,EACJ,CAAC,GAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CACtD,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;gBAErB,IAAI,IAAI,EAAE;oBACT,OAAO,IAAI,CAAC;iBACZ;aACD;SACD;KACD;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAjDD,wDAiDC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropertyDeclaration, PropertySignature } from 'ts-morph';
|
|
2
|
-
/**
|
|
3
|
-
* Returns property that was overridden by the provided one
|
|
4
|
-
*
|
|
5
|
-
* @param property - Target method
|
|
6
|
-
*/
|
|
7
|
-
export declare function getOverriddenProperty(property: PropertyDeclaration | PropertySignature): PropertyDeclaration | PropertySignature | undefined;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOverriddenProperty = void 0;
|
|
4
|
-
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const class_1 = require("../class");
|
|
6
|
-
const interface_1 = require("../interface");
|
|
7
|
-
/**
|
|
8
|
-
* Returns property that was overridden by the provided one
|
|
9
|
-
*
|
|
10
|
-
* @param property - Target method
|
|
11
|
-
*/
|
|
12
|
-
function getOverriddenProperty(property) {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const parent = property.getParent();
|
|
15
|
-
const name = property.getName();
|
|
16
|
-
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
-
return (_a = (0, class_1.findBaseClass)(parent, (cls) => {
|
|
18
|
-
const prop = cls.getProperty(name);
|
|
19
|
-
return !!prop && !prop.isAbstract();
|
|
20
|
-
})) === null || _a === void 0 ? void 0 : _a.getProperty(name);
|
|
21
|
-
}
|
|
22
|
-
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
23
|
-
return (_b = (0, interface_1.findInterface)(parent, (int) => int !== parent && !!int.getProperty(name))) === null || _b === void 0 ? void 0 : _b.getProperty(name);
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
exports.getOverriddenProperty = getOverriddenProperty;
|
|
28
|
-
//# sourceMappingURL=get-overridden-property.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-overridden-property.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/property/get-overridden-property.ts"],"names":[],"mappings":";;;AAAA,uCAOkB;AAElB,oCAAuC;AACvC,4CAA2C;AAE3C;;;;GAIG;AACH,SAAgB,qBAAqB,CACpC,QAAiD;;IAEjD,MAAM,MAAM,GAAqB,QAAQ,CAAC,SAAS,EAAE,CAAC;IACtD,MAAM,IAAI,GAAW,QAAQ,CAAC,OAAO,EAAE,CAAC;IAExC,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACpC,OAAO,MAAA,IAAA,qBAAa,EAAC,MAAM,EAAE,CAAC,GAAqB,EAAE,EAAE;YACtD,MAAM,IAAI,GAAoC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAEpE,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACrC,CAAC,CAAC,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,eAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE;QACxC,OAAO,MAAA,IAAA,yBAAa,EACnB,MAAM,EACN,CAAC,GAAyB,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CACxE,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KACrB;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAtBD,sDAsBC"}
|