@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
|
@@ -44,6 +44,7 @@ let NgDocPageMapComponent = class NgDocPageMapComponent {
|
|
|
44
44
|
if (element) {
|
|
45
45
|
this.renderer.setStyle(this.selection.nativeElement, 'top', `${element.offsetTop}px`);
|
|
46
46
|
this.renderer.setStyle(this.selection.nativeElement, 'height', `${element.offsetHeight}px`);
|
|
47
|
+
element.scrollIntoView({ block: 'nearest' });
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
this.activeItem = item;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Just export filters from this file, they will be included to the template renderer automatically */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.
|
|
4
|
+
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getPropertyChain = exports.getOverriddenMember = exports.getMethodChain = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getImplementedMember = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.constructorPresentation = exports.accessorPresentation = void 0;
|
|
5
5
|
var helpers_1 = require("../helpers");
|
|
6
|
+
Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
|
|
6
7
|
Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
|
|
7
8
|
Object.defineProperty(exports, "displayType", { enumerable: true, get: function () { return helpers_1.displayType; } });
|
|
8
9
|
Object.defineProperty(exports, "extractDocs", { enumerable: true, get: function () { return helpers_1.extractDocs; } });
|
|
@@ -13,16 +14,18 @@ Object.defineProperty(exports, "filterByScope", { enumerable: true, get: functio
|
|
|
13
14
|
Object.defineProperty(exports, "filterByStatic", { enumerable: true, get: function () { return helpers_1.filterByStatic; } });
|
|
14
15
|
Object.defineProperty(exports, "firstNodeWithComment", { enumerable: true, get: function () { return helpers_1.firstNodeWithComment; } });
|
|
15
16
|
Object.defineProperty(exports, "functionPresentation", { enumerable: true, get: function () { return helpers_1.functionPresentation; } });
|
|
17
|
+
Object.defineProperty(exports, "getAccessorChain", { enumerable: true, get: function () { return helpers_1.getAccessorChain; } });
|
|
18
|
+
Object.defineProperty(exports, "getClassAccessors", { enumerable: true, get: function () { return helpers_1.getClassAccessors; } });
|
|
16
19
|
Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
|
|
17
20
|
Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "getImplementedMember", { enumerable: true, get: function () { return helpers_1.getImplementedMember; } });
|
|
22
|
+
Object.defineProperty(exports, "getInterfaceAccessors", { enumerable: true, get: function () { return helpers_1.getInterfaceAccessors; } });
|
|
20
23
|
Object.defineProperty(exports, "getInterfaceMethods", { enumerable: true, get: function () { return helpers_1.getInterfaceMethods; } });
|
|
21
24
|
Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get: function () { return helpers_1.getInterfaceProperties; } });
|
|
22
25
|
Object.defineProperty(exports, "getMethodChain", { enumerable: true, get: function () { return helpers_1.getMethodChain; } });
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "getOverriddenProperty", { enumerable: true, get: function () { return helpers_1.getOverriddenProperty; } });
|
|
26
|
+
Object.defineProperty(exports, "getOverriddenMember", { enumerable: true, get: function () { return helpers_1.getOverriddenMember; } });
|
|
25
27
|
Object.defineProperty(exports, "getPropertyChain", { enumerable: true, get: function () { return helpers_1.getPropertyChain; } });
|
|
28
|
+
Object.defineProperty(exports, "groupAccessors", { enumerable: true, get: function () { return helpers_1.groupAccessors; } });
|
|
26
29
|
Object.defineProperty(exports, "marked", { enumerable: true, get: function () { return helpers_1.marked; } });
|
|
27
30
|
Object.defineProperty(exports, "methodPresentation", { enumerable: true, get: function () { return helpers_1.methodPresentation; } });
|
|
28
31
|
Object.defineProperty(exports, "noEmpty", { enumerable: true, get: function () { return helpers_1.noEmpty; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.variablePresentation = exports.typeAliasPresentation = exports.functionPresentation = exports.methodPresentation = exports.constructorPresentation = void 0;
|
|
3
|
+
exports.variablePresentation = exports.typeAliasPresentation = exports.functionPresentation = exports.methodPresentation = exports.accessorPresentation = exports.constructorPresentation = void 0;
|
|
4
4
|
const core_1 = require("@ng-doc/core");
|
|
5
5
|
const ts_morph_1 = require("ts-morph");
|
|
6
6
|
const format_code_1 = require("./format-code");
|
|
@@ -21,6 +21,20 @@ function constructorPresentation(constructor) {
|
|
|
21
21
|
return (0, format_code_1.formatCode)(presentation, 'TypeScript');
|
|
22
22
|
}
|
|
23
23
|
exports.constructorPresentation = constructorPresentation;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param accessor
|
|
27
|
+
*/
|
|
28
|
+
function accessorPresentation(accessor) {
|
|
29
|
+
const parameters = accessor.getParameters().map(parameterPresentation).join(', ');
|
|
30
|
+
const prefix = ts_morph_1.Node.isGetAccessorDeclaration(accessor) ? 'get' : 'set';
|
|
31
|
+
const header = ts_morph_1.Node.isGetAccessorDeclaration(accessor)
|
|
32
|
+
? `${accessor.getName()}():`
|
|
33
|
+
: `${accessor.getName()}(${parameters})`;
|
|
34
|
+
const returnType = ts_morph_1.Node.isGetAccessorDeclaration(accessor) ? (0, typescript_1.displayType)(accessor.getReturnType()) : '';
|
|
35
|
+
return [prefix, scopePresentation(accessor), header, returnType].filter(core_1.isPresent).join(' ') + ';';
|
|
36
|
+
}
|
|
37
|
+
exports.accessorPresentation = accessorPresentation;
|
|
24
38
|
/**
|
|
25
39
|
*
|
|
26
40
|
* @param method
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccessorChain = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const class_1 = require("../class");
|
|
6
|
+
const for_all_interfaces_1 = require("../interface/for-all-interfaces");
|
|
7
|
+
const get_interface_accessors_1 = require("./get-interface-accessors");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param accessor
|
|
11
|
+
*/
|
|
12
|
+
function getAccessorChain(accessor) {
|
|
13
|
+
const parent = accessor.getParent();
|
|
14
|
+
const accessors = [];
|
|
15
|
+
const name = accessor.getName();
|
|
16
|
+
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
+
(0, class_1.forAllClasses)(parent, (cls) => {
|
|
18
|
+
if (ts_morph_1.Node.isGetAccessorDeclaration(accessor)) {
|
|
19
|
+
const getter = cls.getGetAccessor(name);
|
|
20
|
+
if (getter) {
|
|
21
|
+
accessors.push(getter);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (ts_morph_1.Node.isSetAccessorDeclaration(accessor)) {
|
|
25
|
+
const setter = cls.getSetAccessor(name);
|
|
26
|
+
if (setter) {
|
|
27
|
+
accessors.push(setter);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
// TODO: Add interfaces
|
|
32
|
+
}
|
|
33
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
34
|
+
(0, for_all_interfaces_1.forAllInterfaces)(parent, (int) => {
|
|
35
|
+
(0, get_interface_accessors_1.getInterfaceAccessors)(int)
|
|
36
|
+
.filter((acc) => acc.getName() === name)
|
|
37
|
+
.forEach((acc) => {
|
|
38
|
+
if (ts_morph_1.Node.isGetAccessorDeclaration(accessor) && ts_morph_1.Node.isGetAccessorDeclaration(acc)) {
|
|
39
|
+
accessors.push(acc);
|
|
40
|
+
}
|
|
41
|
+
if (ts_morph_1.Node.isSetAccessorDeclaration(accessor) && ts_morph_1.Node.isSetAccessorDeclaration(acc)) {
|
|
42
|
+
accessors.push(acc);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return accessors;
|
|
48
|
+
}
|
|
49
|
+
exports.getAccessorChain = getAccessorChain;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClassAccessors = void 0;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const class_1 = require("../class");
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param cls
|
|
9
|
+
*/
|
|
10
|
+
function getClassAccessors(cls) {
|
|
11
|
+
const accessors = new Map();
|
|
12
|
+
(0, class_1.forAllClasses)(cls, (baseClass) => {
|
|
13
|
+
baseClass.getGetAccessors().forEach((accessor) => {
|
|
14
|
+
const name = accessor.getName();
|
|
15
|
+
if (!accessors.get(`get${name}`) &&
|
|
16
|
+
(!accessor.isAbstract() || (accessor.isAbstract() && cls === baseClass))) {
|
|
17
|
+
accessors.set(`get${name}`, accessor);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
baseClass.getSetAccessors().forEach((accessor) => {
|
|
21
|
+
const name = accessor.getName();
|
|
22
|
+
if (!accessors.get(`set${name}`) &&
|
|
23
|
+
(!accessor.isAbstract() || (accessor.isAbstract() && cls === baseClass))) {
|
|
24
|
+
accessors.set(`set${name}`, accessor);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return (0, core_1.asArray)(accessors.values());
|
|
29
|
+
}
|
|
30
|
+
exports.getClassAccessors = getClassAccessors;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInterfaceAccessors = void 0;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const interface_1 = require("../interface");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param int
|
|
10
|
+
*/
|
|
11
|
+
function getInterfaceAccessors(int) {
|
|
12
|
+
const accessors = new Map();
|
|
13
|
+
(0, interface_1.forAllInterfaces)(int, (i) => {
|
|
14
|
+
const getters = i
|
|
15
|
+
.getMembers()
|
|
16
|
+
.filter(ts_morph_1.Node.isGetAccessorDeclaration);
|
|
17
|
+
const setters = i
|
|
18
|
+
.getMembers()
|
|
19
|
+
.filter(ts_morph_1.Node.isSetAccessorDeclaration);
|
|
20
|
+
getters.forEach((getter) => {
|
|
21
|
+
const name = getter.getName();
|
|
22
|
+
if (!accessors.get(`get${name}`)) {
|
|
23
|
+
accessors.set(`get${name}`, getter);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
setters.forEach((setter) => {
|
|
27
|
+
const name = setter.getName();
|
|
28
|
+
if (!accessors.get(`set${name}`)) {
|
|
29
|
+
accessors.set(`set${name}`, setter);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return (0, core_1.asArray)(accessors.values());
|
|
34
|
+
}
|
|
35
|
+
exports.getInterfaceAccessors = getInterfaceAccessors;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupAccessors = void 0;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param accessors
|
|
9
|
+
*/
|
|
10
|
+
function groupAccessors(accessors) {
|
|
11
|
+
const map = new Map();
|
|
12
|
+
accessors.forEach((accessor) => {
|
|
13
|
+
if (ts_morph_1.Node.isGetAccessorDeclaration(accessor)) {
|
|
14
|
+
map.set(accessor.getName(), { ...map.get(accessor.getName()), get: accessor });
|
|
15
|
+
}
|
|
16
|
+
if (ts_morph_1.Node.isSetAccessorDeclaration(accessor)) {
|
|
17
|
+
map.set(accessor.getName(), { ...map.get(accessor.getName()), set: accessor });
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return (0, core_1.asArray)(map.values());
|
|
21
|
+
}
|
|
22
|
+
exports.groupAccessors = groupAccessors;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./accessor"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./get-accessor-chain"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./get-class-accessors"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./get-interface-accessors"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./group-accessors"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./accessor"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./class"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./create-project"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./display-type"), exports);
|
|
@@ -9,6 +10,7 @@ tslib_1.__exportStar(require("./filter-by-static"), exports);
|
|
|
9
10
|
tslib_1.__exportStar(require("./find-declaration"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./first-node-with-comment"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./interface"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./member"), exports);
|
|
12
14
|
tslib_1.__exportStar(require("./method"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./node"), exports);
|
|
14
16
|
tslib_1.__exportStar(require("./property"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInterfaceMember = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param int
|
|
8
|
+
* @param name
|
|
9
|
+
*/
|
|
10
|
+
function getInterfaceMember(int, name) {
|
|
11
|
+
return int
|
|
12
|
+
.getMembers()
|
|
13
|
+
.filter((m) => !ts_morph_1.Node.isConstructSignatureDeclaration(m) &&
|
|
14
|
+
!ts_morph_1.Node.isCallSignatureDeclaration(m) &&
|
|
15
|
+
!ts_morph_1.Node.isIndexSignatureDeclaration(m)).find((m) => m.getName() === name);
|
|
16
|
+
}
|
|
17
|
+
exports.getInterfaceMember = getInterfaceMember;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findMember = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const class_1 = require("../class");
|
|
6
|
+
const interface_1 = require("../interface");
|
|
7
|
+
const get_interface_member_1 = require("../interface/get-interface-member");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param node
|
|
11
|
+
* @param name
|
|
12
|
+
*/
|
|
13
|
+
function findMember(node, name) {
|
|
14
|
+
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
15
|
+
const member = (0, class_1.findClass)(node, (cls) => !!cls.getMember(name))?.getMember(name);
|
|
16
|
+
return member;
|
|
17
|
+
}
|
|
18
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
19
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
20
|
+
const baseInterface = (0, interface_1.findInterface)(node, (int) => !!(0, get_interface_member_1.getInterfaceMember)(int, name));
|
|
21
|
+
return baseInterface && (0, get_interface_member_1.getInterfaceMember)(baseInterface, name);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
exports.findMember = findMember;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getImplementedMember = void 0;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const find_member_1 = require("./find-member");
|
|
7
|
+
/**
|
|
8
|
+
* Returns member that was implemented by the provided one
|
|
9
|
+
*
|
|
10
|
+
* @param member - Target member
|
|
11
|
+
*/
|
|
12
|
+
function getImplementedMember(member) {
|
|
13
|
+
const parent = member.getParent();
|
|
14
|
+
const name = member.getName();
|
|
15
|
+
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
16
|
+
const baseClass = parent.getBaseClass();
|
|
17
|
+
if (baseClass) {
|
|
18
|
+
const member = (0, find_member_1.findMember)(baseClass, name);
|
|
19
|
+
if (member?.isAbstract()) {
|
|
20
|
+
return member;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const nodes = parent
|
|
24
|
+
.getImplements()
|
|
25
|
+
.map((expr) => expr.getType().getSymbol()?.getDeclarations()[0])
|
|
26
|
+
.filter(core_1.isPresent)
|
|
27
|
+
// Reverse implements because the latest one overrides previous one
|
|
28
|
+
.reverse();
|
|
29
|
+
for (const node of nodes) {
|
|
30
|
+
if (ts_morph_1.Node.isClassDeclaration(node)) {
|
|
31
|
+
const member = (0, find_member_1.findMember)(node, name);
|
|
32
|
+
if (member?.isAbstract()) {
|
|
33
|
+
return member;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(node)) {
|
|
37
|
+
const member = (0, find_member_1.findMember)(node, name);
|
|
38
|
+
if (member) {
|
|
39
|
+
return member;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
exports.getImplementedMember = getImplementedMember;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOverriddenMember = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const class_1 = require("../class");
|
|
6
|
+
const interface_1 = require("../interface");
|
|
7
|
+
const find_member_1 = require("./find-member");
|
|
8
|
+
/**
|
|
9
|
+
* Returns member that was overridden by the provided one
|
|
10
|
+
*
|
|
11
|
+
* @param member - Target member
|
|
12
|
+
*/
|
|
13
|
+
function getOverriddenMember(member) {
|
|
14
|
+
const parent = member.getParent();
|
|
15
|
+
const name = member.getName();
|
|
16
|
+
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
+
const baseClass = (0, class_1.findBaseClass)(parent, (cls) => {
|
|
18
|
+
const member = (0, find_member_1.findMember)(cls, name);
|
|
19
|
+
return !!member && !member.isAbstract();
|
|
20
|
+
});
|
|
21
|
+
return baseClass && (0, find_member_1.findMember)(baseClass, name);
|
|
22
|
+
}
|
|
23
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
24
|
+
const baseInterface = (0, interface_1.findInterface)(parent, (int) => int !== parent && !!(0, find_member_1.findMember)(int, name));
|
|
25
|
+
return baseInterface && (0, find_member_1.findMember)(baseInterface, name);
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
exports.getOverriddenMember = getOverriddenMember;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./find-member"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./get-implemented-member"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./get-overridden-member"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./member-type"), exports);
|
|
@@ -2,7 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./get-class-methods"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./get-implemented-method"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./get-interface-methods"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./get-method-chain"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./get-overridden-method"), exports);
|
|
@@ -2,7 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./get-class-properties"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./get-implemented-property"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./get-interface-properties"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./get-overridden-property"), exports);
|
|
8
6
|
tslib_1.__exportStar(require("./get-property-chain"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { constructorPresentation, displayType, extractDocs, extractParameterDocs, extractSeeDocs, extractSelectors, filterByScope, filterByStatic, firstNodeWithComment, functionPresentation, getClassMethods, getClassProperties,
|
|
1
|
+
export { accessorPresentation, constructorPresentation, displayType, extractDocs, extractParameterDocs, extractSeeDocs, extractSelectors, filterByScope, filterByStatic, firstNodeWithComment, functionPresentation, getAccessorChain, getClassAccessors, getClassMethods, getClassProperties, getImplementedMember, getInterfaceAccessors, getInterfaceMethods, getInterfaceProperties, getMethodChain, getOverriddenMember, getPropertyChain, groupAccessors, marked, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, typeAliasPresentation, variablePresentation, } from '../helpers';
|
|
2
2
|
export { humanizeDeclarationName } from '@ng-doc/core';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Just export filters from this file, they will be included to the template renderer automatically */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.
|
|
4
|
+
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getPropertyChain = exports.getOverriddenMember = exports.getMethodChain = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getImplementedMember = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.constructorPresentation = exports.accessorPresentation = void 0;
|
|
5
5
|
var helpers_1 = require("../helpers");
|
|
6
|
+
Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
|
|
6
7
|
Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
|
|
7
8
|
Object.defineProperty(exports, "displayType", { enumerable: true, get: function () { return helpers_1.displayType; } });
|
|
8
9
|
Object.defineProperty(exports, "extractDocs", { enumerable: true, get: function () { return helpers_1.extractDocs; } });
|
|
@@ -13,16 +14,18 @@ Object.defineProperty(exports, "filterByScope", { enumerable: true, get: functio
|
|
|
13
14
|
Object.defineProperty(exports, "filterByStatic", { enumerable: true, get: function () { return helpers_1.filterByStatic; } });
|
|
14
15
|
Object.defineProperty(exports, "firstNodeWithComment", { enumerable: true, get: function () { return helpers_1.firstNodeWithComment; } });
|
|
15
16
|
Object.defineProperty(exports, "functionPresentation", { enumerable: true, get: function () { return helpers_1.functionPresentation; } });
|
|
17
|
+
Object.defineProperty(exports, "getAccessorChain", { enumerable: true, get: function () { return helpers_1.getAccessorChain; } });
|
|
18
|
+
Object.defineProperty(exports, "getClassAccessors", { enumerable: true, get: function () { return helpers_1.getClassAccessors; } });
|
|
16
19
|
Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
|
|
17
20
|
Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "getImplementedMember", { enumerable: true, get: function () { return helpers_1.getImplementedMember; } });
|
|
22
|
+
Object.defineProperty(exports, "getInterfaceAccessors", { enumerable: true, get: function () { return helpers_1.getInterfaceAccessors; } });
|
|
20
23
|
Object.defineProperty(exports, "getInterfaceMethods", { enumerable: true, get: function () { return helpers_1.getInterfaceMethods; } });
|
|
21
24
|
Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get: function () { return helpers_1.getInterfaceProperties; } });
|
|
22
25
|
Object.defineProperty(exports, "getMethodChain", { enumerable: true, get: function () { return helpers_1.getMethodChain; } });
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "getOverriddenProperty", { enumerable: true, get: function () { return helpers_1.getOverriddenProperty; } });
|
|
26
|
+
Object.defineProperty(exports, "getOverriddenMember", { enumerable: true, get: function () { return helpers_1.getOverriddenMember; } });
|
|
25
27
|
Object.defineProperty(exports, "getPropertyChain", { enumerable: true, get: function () { return helpers_1.getPropertyChain; } });
|
|
28
|
+
Object.defineProperty(exports, "groupAccessors", { enumerable: true, get: function () { return helpers_1.groupAccessors; } });
|
|
26
29
|
Object.defineProperty(exports, "marked", { enumerable: true, get: function () { return helpers_1.marked; } });
|
|
27
30
|
Object.defineProperty(exports, "methodPresentation", { enumerable: true, get: function () { return helpers_1.methodPresentation; } });
|
|
28
31
|
Object.defineProperty(exports, "noEmpty", { enumerable: true, get: function () { return helpers_1.noEmpty; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-filters.js","sourceRoot":"","sources":["../../../../libs/builder/engine/template-filters.ts"],"names":[],"mappings":";AAAA,sGAAsG;;;AAEtG,
|
|
1
|
+
{"version":3,"file":"template-filters.js","sourceRoot":"","sources":["../../../../libs/builder/engine/template-filters.ts"],"names":[],"mappings":";AAAA,sGAAsG;;;AAEtG,sCAgCoB;AA/BnB,+GAAA,oBAAoB,OAAA;AACpB,kHAAA,uBAAuB,OAAA;AACvB,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AACpB,gHAAA,qBAAqB,OAAA;AACrB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,iGAAA,MAAM,OAAA;AACN,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AAErB,qCAAqD;AAA7C,+GAAA,uBAAuB,OAAA"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { ConstructorDeclaration, FunctionDeclaration, MethodDeclaration, TypeAliasDeclaration, VariableDeclaration } from 'ts-morph';
|
|
1
|
+
import { AccessorDeclaration, ConstructorDeclaration, FunctionDeclaration, MethodDeclaration, TypeAliasDeclaration, VariableDeclaration } from 'ts-morph';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param constructor
|
|
5
5
|
*/
|
|
6
6
|
export declare function constructorPresentation(constructor: ConstructorDeclaration): string;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param accessor
|
|
10
|
+
*/
|
|
11
|
+
export declare function accessorPresentation(accessor: AccessorDeclaration): string;
|
|
7
12
|
/**
|
|
8
13
|
*
|
|
9
14
|
* @param method
|
package/helpers/presentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.variablePresentation = exports.typeAliasPresentation = exports.functionPresentation = exports.methodPresentation = exports.constructorPresentation = void 0;
|
|
3
|
+
exports.variablePresentation = exports.typeAliasPresentation = exports.functionPresentation = exports.methodPresentation = exports.accessorPresentation = exports.constructorPresentation = void 0;
|
|
4
4
|
const core_1 = require("@ng-doc/core");
|
|
5
5
|
const ts_morph_1 = require("ts-morph");
|
|
6
6
|
const format_code_1 = require("./format-code");
|
|
@@ -21,6 +21,20 @@ function constructorPresentation(constructor) {
|
|
|
21
21
|
return (0, format_code_1.formatCode)(presentation, 'TypeScript');
|
|
22
22
|
}
|
|
23
23
|
exports.constructorPresentation = constructorPresentation;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param accessor
|
|
27
|
+
*/
|
|
28
|
+
function accessorPresentation(accessor) {
|
|
29
|
+
const parameters = accessor.getParameters().map(parameterPresentation).join(', ');
|
|
30
|
+
const prefix = ts_morph_1.Node.isGetAccessorDeclaration(accessor) ? 'get' : 'set';
|
|
31
|
+
const header = ts_morph_1.Node.isGetAccessorDeclaration(accessor)
|
|
32
|
+
? `${accessor.getName()}():`
|
|
33
|
+
: `${accessor.getName()}(${parameters})`;
|
|
34
|
+
const returnType = ts_morph_1.Node.isGetAccessorDeclaration(accessor) ? (0, typescript_1.displayType)(accessor.getReturnType()) : '';
|
|
35
|
+
return [prefix, scopePresentation(accessor), header, returnType].filter(core_1.isPresent).join(' ') + ';';
|
|
36
|
+
}
|
|
37
|
+
exports.accessorPresentation = accessorPresentation;
|
|
24
38
|
/**
|
|
25
39
|
*
|
|
26
40
|
* @param method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/presentation.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/presentation.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,uCAckB;AAElB,+CAAyC;AACzC,6CAAyC;AAEzC;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,WAAmC;IAC1E,MAAM,UAAU,GAAW,WAAW,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEhG,MAAM,YAAY,GAAW;QAC5B,iBAAiB,CAAC,WAAW,CAAC;QAC9B,kBAAkB,UAAU,MAAM;QAClC,IAAA,wBAAW,EAAC,WAAW,CAAC,aAAa,EAAE,CAAC;KACxC;SACC,MAAM,CAAC,gBAAS,CAAC;SACjB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,OAAO,IAAA,wBAAU,EAAC,YAAY,EA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AAS,CAAC;QAC1B,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG;QACrE,IAAA,wBAAW,EAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QAChC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;KACnE;SACC,MAAM,CAAC,gBAAS,CAAC;SACjB,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,IAAmB;;IAC7C,OAAO,MAAA,CAAC,IAAI,CAAC,QAAQ,KAAI,MAAA,IAAI,CAAC,QAAQ,EAAE,0CAAE,OAAO,CAAC,gBAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA,CAAC,mCAAI,EAAE,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,SAAS,eAAe,CAAC,IAAsB;IAC9C,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,IAAqB;IACpD,OAAO,IAAI;SACT,aAAa,EAAE;SACf,GAAG,CAAC,CAAC,CAAY,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;SAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessor.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/accessor/accessor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GetAccessorDeclaration, SetAccessorDeclaration } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param accessor
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAccessorChain(accessor: GetAccessorDeclaration): GetAccessorDeclaration[];
|
|
7
|
+
export declare function getAccessorChain(accessor: SetAccessorDeclaration): SetAccessorDeclaration[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccessorChain = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const class_1 = require("../class");
|
|
6
|
+
const for_all_interfaces_1 = require("../interface/for-all-interfaces");
|
|
7
|
+
const get_interface_accessors_1 = require("./get-interface-accessors");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param accessor
|
|
11
|
+
*/
|
|
12
|
+
function getAccessorChain(accessor) {
|
|
13
|
+
const parent = accessor.getParent();
|
|
14
|
+
const accessors = [];
|
|
15
|
+
const name = accessor.getName();
|
|
16
|
+
if (ts_morph_1.Node.isClassDeclaration(parent)) {
|
|
17
|
+
(0, class_1.forAllClasses)(parent, (cls) => {
|
|
18
|
+
if (ts_morph_1.Node.isGetAccessorDeclaration(accessor)) {
|
|
19
|
+
const getter = cls.getGetAccessor(name);
|
|
20
|
+
if (getter) {
|
|
21
|
+
accessors.push(getter);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (ts_morph_1.Node.isSetAccessorDeclaration(accessor)) {
|
|
25
|
+
const setter = cls.getSetAccessor(name);
|
|
26
|
+
if (setter) {
|
|
27
|
+
accessors.push(setter);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
// TODO: Add interfaces
|
|
32
|
+
}
|
|
33
|
+
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
|
|
34
|
+
(0, for_all_interfaces_1.forAllInterfaces)(parent, (int) => {
|
|
35
|
+
(0, get_interface_accessors_1.getInterfaceAccessors)(int)
|
|
36
|
+
.filter((acc) => acc.getName() === name)
|
|
37
|
+
.forEach((acc) => {
|
|
38
|
+
if (ts_morph_1.Node.isGetAccessorDeclaration(accessor) && ts_morph_1.Node.isGetAccessorDeclaration(acc)) {
|
|
39
|
+
accessors.push(acc);
|
|
40
|
+
}
|
|
41
|
+
if (ts_morph_1.Node.isSetAccessorDeclaration(accessor) && ts_morph_1.Node.isSetAccessorDeclaration(acc)) {
|
|
42
|
+
accessors.push(acc);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return accessors;
|
|
48
|
+
}
|
|
49
|
+
exports.getAccessorChain = getAccessorChain;
|
|
50
|
+
//# sourceMappingURL=get-accessor-chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-accessor-chain.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/accessor/get-accessor-chain.ts"],"names":[],"mappings":";;;AAAA,uCAOkB;AAElB,oCAAuC;AACvC,wEAAiE;AAEjE,uEAAgE;AAQhE;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,QAA6B;IAC7D,MAAM,MAAM,GAAqB,QAAQ,CAAC,SAAS,EAAE,CAAC;IACtD,MAAM,SAAS,GAA0B,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAW,QAAQ,CAAC,OAAO,EAAE,CAAC;IAExC,IAAI,eAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACpC,IAAA,qBAAa,EAAC,MAAM,EAAE,CAAC,GAAqB,EAAE,EAAE;YAC/C,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE;gBAC5C,MAAM,MAAM,GAAuC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;gBAE5E,IAAI,MAAM,EAAE;oBACX,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBACvB;aACD;YAED,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAA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