@progress/kendo-typescript-tasks 11.2.7-dev.0 → 11.2.7-dev.12
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/api.js +2 -57
- package/package.json +4 -3
- package/api.config.js +0 -13
- package/src/api/class-page.hbs +0 -27
- package/src/api/class-page.js +0 -35
- package/src/api/code-block.hbs +0 -7
- package/src/api/comment-tags.hbs +0 -7
- package/src/api/comment.js +0 -56
- package/src/api/component-page.hbs +0 -101
- package/src/api/component-page.js +0 -67
- package/src/api/constant-page.hbs +0 -4
- package/src/api/constant-page.js +0 -15
- package/src/api/constructor.hbs +0 -21
- package/src/api/enum-page.hbs +0 -11
- package/src/api/enum-page.js +0 -25
- package/src/api/fn-page.hbs +0 -18
- package/src/api/fn-page.js +0 -24
- package/src/api/generator.js +0 -270
- package/src/api/index-page.hbs +0 -54
- package/src/api/index-page.js +0 -15
- package/src/api/is-constructor.js +0 -9
- package/src/api/is-event.js +0 -7
- package/src/api/is-field.js +0 -7
- package/src/api/is-input.js +0 -7
- package/src/api/is-method.js +0 -10
- package/src/api/is-public.js +0 -8
- package/src/api/map-constructors.js +0 -30
- package/src/api/map-methods.js +0 -23
- package/src/api/map-props.js +0 -63
- package/src/api/member-meta.hbs +0 -7
- package/src/api/member-page.js +0 -41
- package/src/api/methods.hbs +0 -109
- package/src/api/property.hbs +0 -38
- package/src/api/react/component-page.hbs +0 -26
- package/src/api/react/component-page.js +0 -30
- package/src/api/return-type.js +0 -30
- package/src/api/slug.js +0 -9
- package/src/api/template-utils.js +0 -40
- package/src/api/type-links.json +0 -3
- package/src/api/type-utils.js +0 -179
- package/src/api/union-page.hbs +0 -14
- package/src/api/union-page.js +0 -17
- package/src/api/utils.js +0 -40
- package/src/api/warn.js +0 -22
- package/src/api/warning-rules.js +0 -14
- package/test/api.js +0 -339
- package/test/class.json +0 -73
- package/test/components-def.json +0 -98
- package/test/events-def.json +0 -163
- package/test/fields-def.json +0 -203
- package/test/fn-def.json +0 -80
- package/test/fn.json +0 -89
- package/test/inputs-def.json +0 -98
- package/test/interface-comments.json +0 -412
- package/test/intersection.json +0 -67
- package/test/package.json +0 -175
- package/test/type-union-operators.json +0 -42
- package/test/type-union.json +0 -70
- package/test/warning.js +0 -91
package/api.js
CHANGED
|
@@ -1,57 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const execSync = require('child_process').execSync;
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { merge } = require('lodash');
|
|
6
|
-
const typedoc = require('typedoc');
|
|
7
|
-
const glob = require('glob');
|
|
8
|
-
|
|
9
|
-
const api = require('./src/api/generator.js');
|
|
10
|
-
const apiConfig = require('./api.config.js');
|
|
11
|
-
|
|
12
|
-
module.exports = (gulp, userConfig) => {
|
|
13
|
-
const series = gulp.series;
|
|
14
|
-
|
|
15
|
-
const config = merge({}, apiConfig, userConfig);
|
|
16
|
-
|
|
17
|
-
gulp.task('api-json', async(done) => {
|
|
18
|
-
const entryPoints = [
|
|
19
|
-
...glob.sync("src/**/*.{ts,tsx}"),
|
|
20
|
-
...(config.externalApi || [])
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
const app = new typedoc.Application();
|
|
24
|
-
app.options.addReader(new typedoc.TSConfigReader());
|
|
25
|
-
app.bootstrap({ ...config.typedoc, entryPoints });
|
|
26
|
-
|
|
27
|
-
const project = app.convert();
|
|
28
|
-
if (!project) {
|
|
29
|
-
done(new Error('Unable to initialize TypeDoc.'));
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
await app.generateJson(project, apiConfig.jsonPath);
|
|
34
|
-
if (app.logger.hasErrors()) {
|
|
35
|
-
done(new Error('Unable to generate API reference, see messages above.'));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
done();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
gulp.task('api-clean', (done) => {
|
|
43
|
-
execSync(`rm -rf docs/api`, { stdio: [ 0,1,2 ] });
|
|
44
|
-
done();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
gulp.task('api', series('api-json', 'api-clean', (done) => {
|
|
48
|
-
const packageJson = path.join(process.cwd(), 'package.json');
|
|
49
|
-
const packageInfo = require(packageJson);
|
|
50
|
-
api.generate(done, config, packageInfo);
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
gulp.task('api-check', series('api', (done) => {
|
|
54
|
-
execSync(`git diff --exit-code --color -- ${config.outPath}`,{ stdio: [ 0,1,2 ] });
|
|
55
|
-
done();
|
|
56
|
-
}));
|
|
57
|
-
};
|
|
1
|
+
const addAPITasks = require('@progress/typescript-api-tasks');
|
|
2
|
+
module.exports = addAPITasks;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@progress/kendo-typescript-tasks",
|
|
3
3
|
"description": "Kendo UI TypeScript package gulp tasks",
|
|
4
4
|
"main": "gulp-tasks.js",
|
|
5
|
-
"version": "11.2.7-dev.
|
|
5
|
+
"version": "11.2.7-dev.12+3aa6192",
|
|
6
6
|
"author": "Telerik",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"scripts": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"typescript": "^4.3.4"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@progress/kendo-common-tasks": "8.0.4-dev.
|
|
21
|
+
"@progress/kendo-common-tasks": "8.0.4-dev.18+3aa6192",
|
|
22
|
+
"@progress/kendo-typescript-api-tasks": "1.0.1-dev.1531+3aa6192",
|
|
22
23
|
"@typescript-eslint/eslint-plugin": "4.28.2",
|
|
23
24
|
"@typescript-eslint/parser": "4.28.2",
|
|
24
25
|
"core-js": "^3.18.0",
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"publishConfig": {
|
|
49
50
|
"access": "public"
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "3aa61928bf8d075d7ccbef6ecc1f22fc581756bc"
|
|
52
53
|
}
|
package/api.config.js
DELETED
package/src/api/class-page.hbs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{{> member_meta}}
|
|
2
|
-
|
|
3
|
-
# {{name}}
|
|
4
|
-
{{comment}}
|
|
5
|
-
|
|
6
|
-
{{#if props}}
|
|
7
|
-
|
|
8
|
-
<table class="api-table api-table-properties">
|
|
9
|
-
<thead>
|
|
10
|
-
<tr>
|
|
11
|
-
<th class="th-name">Name</th>
|
|
12
|
-
<th class="th-type">Type</th>
|
|
13
|
-
<th class="th-default">Default</th>
|
|
14
|
-
<th class="th-desc">Description</th>
|
|
15
|
-
</tr>
|
|
16
|
-
</thead>
|
|
17
|
-
<tbody class="api-table-body">
|
|
18
|
-
{{#each props}}
|
|
19
|
-
{{> property this }}
|
|
20
|
-
{{/each}}
|
|
21
|
-
</tbody>
|
|
22
|
-
</table>
|
|
23
|
-
|
|
24
|
-
{{/if}}
|
|
25
|
-
|
|
26
|
-
{{> constructor}}
|
|
27
|
-
{{> methods}}
|
package/src/api/class-page.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils');
|
|
4
|
-
const comment = require('./comment');
|
|
5
|
-
const mapProps = require('./map-props');
|
|
6
|
-
const mapConstructors = require('./map-constructors');
|
|
7
|
-
const mapMethods = require('./map-methods');
|
|
8
|
-
const fullName = require('./type-utils').fullName;
|
|
9
|
-
|
|
10
|
-
const classTemplate = template.compileFrom('class-page.hbs');
|
|
11
|
-
template.partialFrom('methods', 'methods.hbs');
|
|
12
|
-
template.partialFrom('constructor', 'constructor.hbs');
|
|
13
|
-
|
|
14
|
-
const classPage = (member, meta) => {
|
|
15
|
-
let props = null;
|
|
16
|
-
let methods = null;
|
|
17
|
-
let constructors = null;
|
|
18
|
-
if (member.children) {
|
|
19
|
-
constructors = mapConstructors(member);
|
|
20
|
-
methods = mapMethods(member.children, member.name);
|
|
21
|
-
props = mapProps(member.children, member.name);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return classTemplate(Object.assign({}, meta, {
|
|
25
|
-
comment: comment(member),
|
|
26
|
-
constructors: constructors,
|
|
27
|
-
props: props,
|
|
28
|
-
methods: methods,
|
|
29
|
-
name: fullName(member),
|
|
30
|
-
slug: member.slug
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
module.exports = classPage;
|
|
35
|
-
|
package/src/api/code-block.hbs
DELETED
package/src/api/comment-tags.hbs
DELETED
package/src/api/comment.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils.js');
|
|
4
|
-
const slug = require('./slug.js');
|
|
5
|
-
const warn = require('./warn.js');
|
|
6
|
-
|
|
7
|
-
const commentTemplate = template.compileFrom('comment-tags.hbs');
|
|
8
|
-
|
|
9
|
-
const commentTags = (comment, member) =>
|
|
10
|
-
commentTemplate({
|
|
11
|
-
tags: comment.tags.map(tag => {
|
|
12
|
-
let text = tag.text.trim();
|
|
13
|
-
|
|
14
|
-
if (tag.tag === 'example') {
|
|
15
|
-
text = text.replace(/_@/g, '@');
|
|
16
|
-
} else if (tag.tag === 'see') {
|
|
17
|
-
const linkSlug = slug(member.packageName, text);
|
|
18
|
-
text = `\n\nSee [${text}]({% slug ${linkSlug} %})`;
|
|
19
|
-
} else {
|
|
20
|
-
text = '';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
text: text
|
|
25
|
-
};
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const formatComment = (member, parentName, memberKind) => {
|
|
30
|
-
let signatures;
|
|
31
|
-
if (member.type && member.type.declaration) {
|
|
32
|
-
signatures = member.type.declaration.signatures;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const comment = member.comment || signatures && signatures[0] && signatures[0].comment;
|
|
36
|
-
|
|
37
|
-
if (!comment) {
|
|
38
|
-
warn(member, parentName, memberKind);
|
|
39
|
-
|
|
40
|
-
return '';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let output = comment.shortText || "";
|
|
44
|
-
if (comment.text) {
|
|
45
|
-
output += '\n\n' + comment.text;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (comment.tags) {
|
|
49
|
-
output += commentTags(comment, member);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return output;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
module.exports = formatComment;
|
|
56
|
-
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
{{> member_meta}}
|
|
2
|
-
|
|
3
|
-
# {{name}}
|
|
4
|
-
{{comment}}
|
|
5
|
-
|
|
6
|
-
## Selector
|
|
7
|
-
`{{selector}}`
|
|
8
|
-
{{#if exportAs}}
|
|
9
|
-
|
|
10
|
-
## Export Name
|
|
11
|
-
Accessible in templates as `#{{exportName}}="{{exportAs}}"`
|
|
12
|
-
{{/if}}
|
|
13
|
-
|
|
14
|
-
{{#if inputs}}
|
|
15
|
-
|
|
16
|
-
## Inputs
|
|
17
|
-
|
|
18
|
-
<table class="api-table api-table-inputs">
|
|
19
|
-
<thead>
|
|
20
|
-
<tr>
|
|
21
|
-
<th class="th-name">Name</th>
|
|
22
|
-
<th class="th-type">Type</th>
|
|
23
|
-
<th class="th-default">Default</th>
|
|
24
|
-
<th class="th-desc">Description</th>
|
|
25
|
-
</tr>
|
|
26
|
-
</thead>
|
|
27
|
-
<tbody class="api-table-body">
|
|
28
|
-
{{#each inputs}}
|
|
29
|
-
{{> property this }}
|
|
30
|
-
{{/each}}
|
|
31
|
-
</tbody>
|
|
32
|
-
</table>
|
|
33
|
-
|
|
34
|
-
{{/if}}
|
|
35
|
-
|
|
36
|
-
{{#if fields}}
|
|
37
|
-
|
|
38
|
-
## Fields
|
|
39
|
-
|
|
40
|
-
<table class="api-table api-table-fields">
|
|
41
|
-
<thead>
|
|
42
|
-
<tr>
|
|
43
|
-
<th class="th-name">Name</th>
|
|
44
|
-
<th class="th-type">Type</th>
|
|
45
|
-
<th class="th-default">Default</th>
|
|
46
|
-
<th class="th-desc">Description</th>
|
|
47
|
-
</tr>
|
|
48
|
-
</thead>
|
|
49
|
-
<tbody class="api-table-body">
|
|
50
|
-
{{#each fields}}
|
|
51
|
-
{{> property this }}
|
|
52
|
-
{{/each}}
|
|
53
|
-
</tbody>
|
|
54
|
-
</table>
|
|
55
|
-
|
|
56
|
-
{{/if}}
|
|
57
|
-
|
|
58
|
-
{{#if events}}
|
|
59
|
-
|
|
60
|
-
## Events
|
|
61
|
-
|
|
62
|
-
<table class="api-table api-table-events">
|
|
63
|
-
<thead>
|
|
64
|
-
<tr>
|
|
65
|
-
<th class="th-name">Name</th>
|
|
66
|
-
<th class="th-type">Type</th>
|
|
67
|
-
<th class="th-desc">Description</th>
|
|
68
|
-
</tr>
|
|
69
|
-
</thead>
|
|
70
|
-
<tbody class="api-table-body">
|
|
71
|
-
{{#each events}}
|
|
72
|
-
<tr>
|
|
73
|
-
<td class="table-cell-name">
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
#### {{name}}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</td>
|
|
80
|
-
<td type class="table-cell-type">
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{{> code_block type }}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</td>
|
|
87
|
-
<td class="table-cell-comment">
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{{comment}}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</td>
|
|
94
|
-
</tr>
|
|
95
|
-
{{/each}}
|
|
96
|
-
</tbody>
|
|
97
|
-
</table>
|
|
98
|
-
|
|
99
|
-
{{/if}}
|
|
100
|
-
|
|
101
|
-
{{> methods}}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils.js');
|
|
4
|
-
const isEvent = require('./is-event.js');
|
|
5
|
-
const isInput = require('./is-input.js');
|
|
6
|
-
const template = require('./template-utils.js');
|
|
7
|
-
const comment = require('./comment.js');
|
|
8
|
-
const mapProps = require('./map-props.js');
|
|
9
|
-
const mapMethods = require('./map-methods.js');
|
|
10
|
-
const isField = require('./is-field.js');
|
|
11
|
-
|
|
12
|
-
const ignoreWithoutComment = utils.ignore(utils.hasProp('comment'));
|
|
13
|
-
|
|
14
|
-
const componentTemplate = template.compileFrom('component-page.hbs');
|
|
15
|
-
template.partialFrom('member_meta', 'member-meta.hbs');
|
|
16
|
-
template.partialFrom('methods', 'methods.hbs');
|
|
17
|
-
|
|
18
|
-
const findDecorator = (decorators) => ((decorators || []).find(d =>
|
|
19
|
-
d.name === 'Component' || d.name === 'Directive'
|
|
20
|
-
));
|
|
21
|
-
|
|
22
|
-
const decoratorProp = (prop) => (decorators) => {
|
|
23
|
-
const compDecorator = findDecorator(decorators);
|
|
24
|
-
|
|
25
|
-
if (compDecorator) {
|
|
26
|
-
const regExp = new RegExp(`${prop}:\\s?['"](.+?)['"]`);
|
|
27
|
-
const match = compDecorator.arguments.obj.match(regExp);
|
|
28
|
-
|
|
29
|
-
return match ? match[1] : undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return undefined;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const selector = decoratorProp('selector');
|
|
36
|
-
|
|
37
|
-
const exportAs = decoratorProp('exportAs');
|
|
38
|
-
|
|
39
|
-
const exportName = (name) => `kendo${name.replace(/Component|Directive/, '')}Instance`;
|
|
40
|
-
|
|
41
|
-
const componentPage = (component, meta) => {
|
|
42
|
-
let inputs;
|
|
43
|
-
let fields;
|
|
44
|
-
let events;
|
|
45
|
-
let methods;
|
|
46
|
-
if (component.children) {
|
|
47
|
-
fields = ignoreWithoutComment(mapProps(component.children.filter(isField), component.name));
|
|
48
|
-
inputs = mapProps(component.children.filter(isInput), component.name);
|
|
49
|
-
events = mapProps(component.children.filter(isEvent), component.name);
|
|
50
|
-
methods = mapMethods(component.children, component.name);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return componentTemplate(Object.assign({}, meta, {
|
|
54
|
-
name: component.name,
|
|
55
|
-
selector: selector(component.decorators),
|
|
56
|
-
exportAs: exportAs(component.decorators),
|
|
57
|
-
exportName: exportName(component.name),
|
|
58
|
-
comment: comment(component),
|
|
59
|
-
inputs: inputs,
|
|
60
|
-
fields: fields,
|
|
61
|
-
events: events,
|
|
62
|
-
methods: methods,
|
|
63
|
-
slug: component.slug
|
|
64
|
-
}));
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
module.exports = componentPage;
|
package/src/api/constant-page.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils.js');
|
|
4
|
-
const comment = require('./comment.js');
|
|
5
|
-
|
|
6
|
-
const constantTemplate = template.compileFrom('constant-page.hbs');
|
|
7
|
-
const constantPage = (member, meta) =>
|
|
8
|
-
constantTemplate(Object.assign({}, meta, {
|
|
9
|
-
comment: comment(member),
|
|
10
|
-
name: member.name,
|
|
11
|
-
slug: member.slug
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
module.exports = constantPage;
|
|
15
|
-
|
package/src/api/constructor.hbs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{{#if constructors}}
|
|
2
|
-
|
|
3
|
-
## Constructors
|
|
4
|
-
|
|
5
|
-
{{#each constructors}}
|
|
6
|
-
### {{name}}
|
|
7
|
-
{{> code_block signature }}
|
|
8
|
-
{{comment}}
|
|
9
|
-
|
|
10
|
-
{{#if params}}
|
|
11
|
-
#### Parameters
|
|
12
|
-
{{#each params}}
|
|
13
|
-
##### {{name}}
|
|
14
|
-
{{> code_block type }}
|
|
15
|
-
{{comment}}
|
|
16
|
-
|
|
17
|
-
{{/each}}
|
|
18
|
-
{{/if}}
|
|
19
|
-
|
|
20
|
-
{{/each}}
|
|
21
|
-
{{/if}}
|
package/src/api/enum-page.hbs
DELETED
package/src/api/enum-page.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils.js');
|
|
4
|
-
const comment = require('./comment.js');
|
|
5
|
-
|
|
6
|
-
function enumValues(member) {
|
|
7
|
-
return member.children.sort((a, b) => a.id - b.id).map(function(child) {
|
|
8
|
-
return {
|
|
9
|
-
comment: comment(child),
|
|
10
|
-
name: child.name
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const enumTemplate = template.compileFrom('enum-page.hbs');
|
|
16
|
-
const enumPage = (member, meta) =>
|
|
17
|
-
enumTemplate(Object.assign({}, meta, {
|
|
18
|
-
comment: comment(member),
|
|
19
|
-
name: member.name,
|
|
20
|
-
values: enumValues(member),
|
|
21
|
-
slug: member.slug
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
module.exports = enumPage;
|
|
25
|
-
|
package/src/api/fn-page.hbs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{{> member_meta}}
|
|
2
|
-
|
|
3
|
-
# {{name}}
|
|
4
|
-
{{comment}}
|
|
5
|
-
|
|
6
|
-
{{#if params}}
|
|
7
|
-
#### Parameters
|
|
8
|
-
{{#each params}}
|
|
9
|
-
##### {{name}}
|
|
10
|
-
{{> code_block type }}
|
|
11
|
-
{{comment}}
|
|
12
|
-
|
|
13
|
-
{{/each}}
|
|
14
|
-
{{/if}}
|
|
15
|
-
{{#if returns}}
|
|
16
|
-
#### Returns
|
|
17
|
-
{{> code_block returns.type }}{{#if returns.comment}} {{returns.comment}}{{/if}}
|
|
18
|
-
{{/if}}
|
package/src/api/fn-page.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils.js');
|
|
4
|
-
const comment = require('./comment.js');
|
|
5
|
-
const returnType = require('./return-type');
|
|
6
|
-
const types = require('./type-utils.js');
|
|
7
|
-
|
|
8
|
-
const fnTemplate = template.compileFrom('fn-page.hbs');
|
|
9
|
-
|
|
10
|
-
const fnPage = (member, meta) => {
|
|
11
|
-
const signature = member.signatures[0];
|
|
12
|
-
const commentRoot = member.comment ? member : signature;
|
|
13
|
-
|
|
14
|
-
return fnTemplate(Object.assign({}, meta, {
|
|
15
|
-
comment: comment(commentRoot),
|
|
16
|
-
name: types.fullName(signature),
|
|
17
|
-
params: types.params(signature),
|
|
18
|
-
returns: returnType(signature),
|
|
19
|
-
slug: member.slug
|
|
20
|
-
}));
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
module.exports = fnPage;
|
|
24
|
-
|