@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/src/api/property.hbs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<tr>
|
|
2
|
-
<td class="table-cell-name">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
#### {{name}}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</td>
|
|
9
|
-
<td type class="table-cell-type">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{{> code_block type }}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</td>
|
|
16
|
-
<td class="table-cell-default">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{{#if defaultValue}}
|
|
20
|
-
<code>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{{defaultValue}}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</code>
|
|
27
|
-
{{/if}}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</td>
|
|
31
|
-
<td class="table-cell-comment">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{{comment}}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</td>
|
|
38
|
-
</tr>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{{> member_meta}}
|
|
2
|
-
|
|
3
|
-
# {{name}}
|
|
4
|
-
{{comment}}
|
|
5
|
-
|
|
6
|
-
{{#if properties}}
|
|
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 properties}}
|
|
19
|
-
{{> property this }}
|
|
20
|
-
{{/each}}
|
|
21
|
-
</tbody>
|
|
22
|
-
</table>
|
|
23
|
-
|
|
24
|
-
{{/if}}
|
|
25
|
-
|
|
26
|
-
{{> methods}}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./../template-utils.js');
|
|
4
|
-
const comment = require('./../comment.js');
|
|
5
|
-
const mapProps = require('./../map-props.js');
|
|
6
|
-
const mapMethods = require('./../map-methods.js');
|
|
7
|
-
const isField = require('./../is-field.js');
|
|
8
|
-
|
|
9
|
-
const componentTemplate = template.compileFrom('./react/component-page.hbs');
|
|
10
|
-
template.partialFrom('member_meta', 'member-meta.hbs');
|
|
11
|
-
template.partialFrom('methods', 'methods.hbs');
|
|
12
|
-
|
|
13
|
-
const componentPage = (component, meta) => {
|
|
14
|
-
let properties;
|
|
15
|
-
let methods;
|
|
16
|
-
if (component.children) {
|
|
17
|
-
properties = mapProps(component.children.filter(isField), component.name);
|
|
18
|
-
methods = mapMethods(component.children, component.name);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return componentTemplate(Object.assign({}, meta, {
|
|
22
|
-
name: component.name,
|
|
23
|
-
comment: comment(component),
|
|
24
|
-
properties: properties,
|
|
25
|
-
methods: methods,
|
|
26
|
-
slug: component.slug
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = componentPage;
|
package/src/api/return-type.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const types = require('./type-utils.js');
|
|
4
|
-
const utils = require('./utils.js');
|
|
5
|
-
|
|
6
|
-
const returnType = (definition, parentName) => {
|
|
7
|
-
if (definition.type.name === 'void') {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let comment;
|
|
12
|
-
if (definition.comment) {
|
|
13
|
-
comment = definition.comment.returns;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (!comment && definition.type.name !== 'void') {
|
|
17
|
-
let source = `${definition.name}`;
|
|
18
|
-
if (parentName) {
|
|
19
|
-
source = `${parentName } - ${source}`;
|
|
20
|
-
}
|
|
21
|
-
utils.warn('Undocumented return type', source);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
type: types.typeString(definition),
|
|
26
|
-
comment: comment
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = returnType;
|
package/src/api/slug.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const hbs = require('handlebars');
|
|
6
|
-
|
|
7
|
-
hbs.registerHelper('capitalize',
|
|
8
|
-
s => s.slice(0,1).toUpperCase() + s.slice(1));
|
|
9
|
-
|
|
10
|
-
hbs.registerHelper('lowercase',
|
|
11
|
-
s => s.toLowerCase());
|
|
12
|
-
|
|
13
|
-
hbs.registerHelper('contains',
|
|
14
|
-
(s, chars, options) => (s.includes(chars) ? options.fn(s) : options.inverse(s)));
|
|
15
|
-
|
|
16
|
-
hbs.registerHelper('equals',
|
|
17
|
-
(s, comparer, options) => (s === comparer ? options.fn(s) : options.inverse(s)));
|
|
18
|
-
|
|
19
|
-
const readLocal = (src) =>
|
|
20
|
-
fs.readFileSync(path.join(__dirname, src), { encoding: 'utf-8' });
|
|
21
|
-
|
|
22
|
-
const compile = (src) =>
|
|
23
|
-
hbs.compile(readLocal(src), { noEscape: true });
|
|
24
|
-
|
|
25
|
-
const partial = (name, source) =>
|
|
26
|
-
hbs.registerPartial(name, readLocal(source));
|
|
27
|
-
|
|
28
|
-
const safeString = (str) =>
|
|
29
|
-
new hbs.SafeString(str);
|
|
30
|
-
|
|
31
|
-
partial('code_block', 'code-block.hbs');
|
|
32
|
-
partial('property', 'property.hbs');
|
|
33
|
-
|
|
34
|
-
module.exports = {
|
|
35
|
-
compile: hbs.compile,
|
|
36
|
-
compileFrom: compile,
|
|
37
|
-
partialFrom: partial,
|
|
38
|
-
safeString: safeString
|
|
39
|
-
};
|
|
40
|
-
|
package/src/api/type-links.json
DELETED
package/src/api/type-utils.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const comment = require('./comment');
|
|
4
|
-
|
|
5
|
-
const unionTypes = (member) =>
|
|
6
|
-
member.type.types.map(type => {
|
|
7
|
-
switch (type.type) {
|
|
8
|
-
case 'literal':
|
|
9
|
-
return `"${type.value}"`;
|
|
10
|
-
default:
|
|
11
|
-
return typeString({ type });
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const paramName = (param) => {
|
|
16
|
-
let name = param.name;
|
|
17
|
-
if (name === '__namedParameters') {
|
|
18
|
-
name = '_';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return name + ((param.flags || {}).isOptional ? "?" : "");
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const anonParams = (definition) => {
|
|
25
|
-
let params = [];
|
|
26
|
-
if (definition.parameters) {
|
|
27
|
-
params = definition.parameters.map((param) => ({
|
|
28
|
-
_ref: param,
|
|
29
|
-
name: paramName(param),
|
|
30
|
-
type: typeString(param)
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return params;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const params = (definition, parentName) => {
|
|
38
|
-
const paramComment = (param) =>
|
|
39
|
-
comment(param, parentName, 'parameter').trim();
|
|
40
|
-
|
|
41
|
-
const params = anonParams(definition);
|
|
42
|
-
params.forEach((param) => {
|
|
43
|
-
param.comment = paramComment(param._ref);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return params;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const signature = (definition) => {
|
|
50
|
-
const args = anonParams(definition).map((param) =>
|
|
51
|
-
`${param.name}: ${param.type}`
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const returnType = typeString(definition);
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
params: args,
|
|
58
|
-
returnType: returnType
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const sigParams = sig => `${sig.params.join(', ')}`;
|
|
63
|
-
|
|
64
|
-
const indexType = (definition) => {
|
|
65
|
-
const sig = signature(definition);
|
|
66
|
-
return `{[${sigParams(sig)}]: ${sig.returnType}}`;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const callSignature = (definition) => {
|
|
70
|
-
const sig = signature(definition);
|
|
71
|
-
return `(${sigParams(sig)})`;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const callType = (definition) => {
|
|
75
|
-
const sig = signature(definition);
|
|
76
|
-
return `(${sigParams(sig)}) => ${sig.returnType}`;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const typeName = (type) => {
|
|
80
|
-
const name = type.name;
|
|
81
|
-
if (type.typeSlug) {
|
|
82
|
-
return `[${ name }]({% slug ${ type.typeSlug } %})`;
|
|
83
|
-
} else if (type.typeLink) {
|
|
84
|
-
return `[${ name }](${ type.typeLink })`;
|
|
85
|
-
} else if (type.type === 'array') {
|
|
86
|
-
return typeName(type.elementType);
|
|
87
|
-
}
|
|
88
|
-
return name;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const INTERSECTION = ' [intersected](https://www.typescriptlang.org/docs/handbook/advanced-types.html#intersection-types) with ';
|
|
92
|
-
const singleTypeString = (type) => {
|
|
93
|
-
let suffix = '';
|
|
94
|
-
|
|
95
|
-
if (type.type === 'literal') {
|
|
96
|
-
return type.value;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (type.type === 'intersection') {
|
|
100
|
-
return unionTypes({ type }).join(INTERSECTION);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (type.type === 'reflection') {
|
|
104
|
-
const decl = type.declaration;
|
|
105
|
-
if (decl.signatures) {
|
|
106
|
-
const sig = decl.signatures[0];
|
|
107
|
-
if (decl.name === '__type' && sig.kindString === 'Call signature') {
|
|
108
|
-
return callType(sig);
|
|
109
|
-
}
|
|
110
|
-
} else if (decl.indexSignature) {
|
|
111
|
-
return indexType(decl.indexSignature[0] || decl.indexSignature);
|
|
112
|
-
} else if (decl.children) {
|
|
113
|
-
// Anonymous interface like
|
|
114
|
-
// export type Foo = boolean | { bar: boolean };
|
|
115
|
-
const children = decl.children.map(child =>
|
|
116
|
-
`${paramName(child)}: ${typeString(child)};`);
|
|
117
|
-
|
|
118
|
-
return `{ ${children.join(' ')} }`;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (type.type === 'array') {
|
|
123
|
-
return `${singleTypeString(type.elementType)}[]`;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (type.type === 'tuple') {
|
|
127
|
-
return `[${type.elements.map(singleTypeString).join(', ')}]`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (type.typeArguments) {
|
|
131
|
-
suffix = `<${singleTypeString(type.typeArguments[0])}>`;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const name = typeName(type);
|
|
135
|
-
|
|
136
|
-
return name + suffix;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const typeString = (prop) => {
|
|
140
|
-
const type = prop.type;
|
|
141
|
-
|
|
142
|
-
if (!type && prop.kindString === 'Method') {
|
|
143
|
-
return singleTypeString(prop.signatures[0]);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (type.type === 'union') {
|
|
147
|
-
return unionTypes(prop).join(' | ');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (type.type === 'literal') {
|
|
151
|
-
return `"${type.value}"`;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return singleTypeString(prop.type);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const fullName = (member) => {
|
|
158
|
-
let suffix = '';
|
|
159
|
-
|
|
160
|
-
const typeParam = member.typeParameter;
|
|
161
|
-
if (typeParam) {
|
|
162
|
-
suffix = '<' +
|
|
163
|
-
typeParam.map(t => t.name).join(', ') +
|
|
164
|
-
'>';
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return member.name + suffix;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
module.exports = {
|
|
171
|
-
callSignature: callSignature,
|
|
172
|
-
callType: callType,
|
|
173
|
-
fullName: fullName,
|
|
174
|
-
params: params,
|
|
175
|
-
unionTypes: unionTypes,
|
|
176
|
-
typeString: typeString,
|
|
177
|
-
singleTypeString: singleTypeString
|
|
178
|
-
};
|
|
179
|
-
|
package/src/api/union-page.hbs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{{> member_meta}}
|
|
2
|
-
|
|
3
|
-
# {{name}}
|
|
4
|
-
{{comment}}
|
|
5
|
-
|
|
6
|
-
`type` {{name}} =
|
|
7
|
-
{{~#each types~}}
|
|
8
|
-
{{~#contains this 'slug'}} {{this}}
|
|
9
|
-
{{~else equals this '"null"'}} `null`
|
|
10
|
-
{{~else contains this '"'}} {{this}}
|
|
11
|
-
{{~else}} `{{this}}`
|
|
12
|
-
{{~/contains~}}
|
|
13
|
-
{{~#unless @last}} |{{/unless~}}
|
|
14
|
-
{{~/each}};
|
package/src/api/union-page.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const template = require('./template-utils.js');
|
|
4
|
-
const comment = require('./comment.js');
|
|
5
|
-
const typeUtils = require('./type-utils.js');
|
|
6
|
-
|
|
7
|
-
const unionTemplate = template.compileFrom('union-page.hbs');
|
|
8
|
-
const unionPage = (member, meta) =>
|
|
9
|
-
unionTemplate(Object.assign({}, meta, {
|
|
10
|
-
comment: comment(member),
|
|
11
|
-
name: member.name,
|
|
12
|
-
types: typeUtils.unionTypes(member),
|
|
13
|
-
slug: member.slug
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
module.exports = unionPage;
|
|
17
|
-
|
package/src/api/utils.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*eslint no-console: 0 */
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
const flatten = (arr) => arr.reduce((flat, next) => flat.concat(next), []);
|
|
5
|
-
|
|
6
|
-
const nameComparer = (a, b) => a.name.localeCompare(b.name);
|
|
7
|
-
|
|
8
|
-
const not = predicate => member => !predicate(member);
|
|
9
|
-
|
|
10
|
-
const ignore = predicate => props => (props || []).filter(predicate);
|
|
11
|
-
|
|
12
|
-
const hasProp = prop => obj => Boolean(obj[prop]);
|
|
13
|
-
|
|
14
|
-
const groupBy = (predicate, list) =>
|
|
15
|
-
list.reduce((acc, item) => {
|
|
16
|
-
const field = predicate(item);
|
|
17
|
-
acc[field] = acc[field] || [];
|
|
18
|
-
acc[field].push(item);
|
|
19
|
-
return acc;
|
|
20
|
-
}, {});
|
|
21
|
-
|
|
22
|
-
const WARNINGS = [];
|
|
23
|
-
const warn = (type, text) => {
|
|
24
|
-
const msg = `WARN ${type} ${text}`;
|
|
25
|
-
WARNINGS.push(msg);
|
|
26
|
-
|
|
27
|
-
console.warn(msg);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
groupBy: groupBy,
|
|
32
|
-
flatten: flatten,
|
|
33
|
-
nameComparer: nameComparer,
|
|
34
|
-
warn: warn,
|
|
35
|
-
warnings: () => WARNINGS,
|
|
36
|
-
not: not,
|
|
37
|
-
ignore: ignore,
|
|
38
|
-
hasProp: hasProp
|
|
39
|
-
};
|
|
40
|
-
|
package/src/api/warn.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils.js');
|
|
4
|
-
const rules = require('./warning-rules.js');
|
|
5
|
-
|
|
6
|
-
const runner = rules => member =>
|
|
7
|
-
rules.reduce((result, rule) => result && rule(member), true);
|
|
8
|
-
|
|
9
|
-
const warn = (member, parentName, kind = 'member') => {
|
|
10
|
-
const shouldWarn = runner(rules);
|
|
11
|
-
let source = member.name;
|
|
12
|
-
|
|
13
|
-
if (parentName) {
|
|
14
|
-
source = `${parentName}.${source}`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (shouldWarn(member)) {
|
|
18
|
-
utils.warn(`Undocumented ${kind}`, source);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
module.exports = warn;
|
package/src/api/warning-rules.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils.js');
|
|
4
|
-
const isField = require('./is-field.js');
|
|
5
|
-
|
|
6
|
-
const namedParams = member => member.name !== '__namedParameters';
|
|
7
|
-
|
|
8
|
-
const rules = [
|
|
9
|
-
namedParams,
|
|
10
|
-
utils.not(isField)
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
module.exports = rules;
|
|
14
|
-
|