umberto 6.1.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +1 -1
  3. package/scripts/filter/before-post-render/has-own-favicons.js +12 -0
  4. package/scripts/utils/has-own-favicons.js +48 -0
  5. package/src/api-builder/utils/findtargetdoclet.js +2 -2
  6. package/src/data-converter/converters/typedoc/abstractparser.js +54 -50
  7. package/src/data-converter/converters/typedoc/accessorparser.js +7 -5
  8. package/src/data-converter/converters/typedoc/classparser.js +5 -3
  9. package/src/data-converter/converters/typedoc/computedpropertyparser.js +4 -3
  10. package/src/data-converter/converters/typedoc/constantparser.js +5 -3
  11. package/src/data-converter/converters/typedoc/constructorparser.js +4 -3
  12. package/src/data-converter/converters/typedoc/errorparser.js +4 -10
  13. package/src/data-converter/converters/typedoc/eventparser.js +4 -10
  14. package/src/data-converter/converters/typedoc/functionparser.js +5 -3
  15. package/src/data-converter/converters/typedoc/interfaceparser.js +5 -3
  16. package/src/data-converter/converters/typedoc/methodparser.js +6 -4
  17. package/src/data-converter/converters/typedoc/moduleparser.js +9 -3
  18. package/src/data-converter/converters/typedoc/propertyparser.js +7 -28
  19. package/src/data-converter/converters/typedoc/referenceparser.js +41 -0
  20. package/src/data-converter/converters/typedoc/reflectionkind.js +34 -0
  21. package/src/data-converter/converters/typedoc/typedoc.ts +215 -214
  22. package/src/data-converter/converters/typedoc/typedocconverter.js +130 -99
  23. package/src/data-converter/converters/typedoc/typeparser.js +10 -6
  24. package/src/data-converter/converters/typedoc2umberto.js +9 -3
  25. package/themes/umberto/layout/gloria/_api-docs/_mixin/_type.pug +9 -0
  26. package/themes/umberto/layout/gloria/_partial/head.pug +7 -4
  27. package/themes/umberto/layout/umberto/_api-docs/_mixin/_type.pug +9 -0
  28. package/themes/umberto/layout/umberto/_partial/head.pug +7 -4
  29. package/themes/umberto/src/gloria/js/_codeswitcherbuttons.js +2 -2
  30. package/themes/umberto/src/umberto/js/_codeswitcherbuttons.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [7.0.0](https://github.com/cksource/umberto/compare/v6.1.2...v7.0.0) (2025-05-05)
5
+
6
+ ### BREAKING CHANGES
7
+
8
+ * Rendering TypeScript-based API pages requires an input file generated by Typedoc in version `0.28.0` or later.
9
+
10
+ ### Features
11
+
12
+ * Support for rendering TypeScript API pages based on output from `typedoc@0.28`. Closes [#1188](https://github.com/cksource/umberto/issues/1188). ([commit](https://github.com/cksource/umberto/commit/561f94c6b025a0f1dbcc01c0c0e70ee5eeae387e))
13
+
14
+
15
+ ## [6.1.2](https://github.com/cksource/umberto/compare/v6.1.1...v6.1.2) (2025-04-23)
16
+
17
+ ### Bug fixes
18
+
19
+ * Umberto attempts to load the theme's favicons in case a project does not define its own, rather than generating links to non-existent resources. Closes [#1256](https://github.com/cksource/umberto/issues/1256). ([commit](https://github.com/cksource/umberto/commit/a6de17b195a67e78010773f420e54fa16b154378))
20
+
21
+
4
22
  ## [6.1.1](https://github.com/cksource/umberto/compare/v6.1.0...v6.1.1) (2025-04-17)
5
23
 
6
24
  ### Bug fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "6.1.1",
3
+ "version": "7.0.0",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ const hasOwnFavicons = require( '../../utils/has-own-favicons' );
9
+
10
+ hexo.extend.filter.register( 'before_post_render', data => {
11
+ return hasOwnFavicons( data, hexo );
12
+ } );
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ const upath = require( 'upath' );
9
+ const fs = require( 'fs' );
10
+
11
+ /**
12
+ * Checks if the project has its own favicons. If so, they will be used when rendering meta tags (`<link rel="icon">`).
13
+ *
14
+ * Otherwise, the default favicons will be used.
15
+ *
16
+ * @param {object} page
17
+ * @param {string} page.projectName
18
+ * @param {boolean} page.hasOwnAssets
19
+ * @param {object} hexo
20
+ * @param {Object.<string, ProjectGlobalConfig>} hexo.projectGlobals
21
+ * @returns {*}
22
+ */
23
+ module.exports = function hasOwnFavicons( page, hexo ) {
24
+ const projectConfig = hexo.projectGlobals[ page.projectName ];
25
+
26
+ let hasOwnAssets = false;
27
+
28
+ if ( projectConfig ) {
29
+ const { config } = hexo.projectGlobals[ page.projectName ];
30
+
31
+ if ( config ) {
32
+ hasOwnAssets = fs.existsSync(
33
+ upath.join( config.projectRootPath, 'docs', 'assets', 'img', 'favicons', '96x96.png' )
34
+ );
35
+ }
36
+ }
37
+
38
+ page.hasOwnAssets = hasOwnAssets;
39
+
40
+ return page;
41
+ };
42
+
43
+ /**
44
+ * @typedef {object} ProjectGlobalConfig
45
+ * @property {string} projectRootPath
46
+ * @property {object} config
47
+ * @property {string} config.projectRootPath
48
+ */
@@ -79,9 +79,9 @@ module.exports = function findTargetDoclet( docletCollection, options ) {
79
79
  return null;
80
80
  }
81
81
 
82
- const { properties = [] } = typedefItem;
82
+ const { properties } = typedefItem;
83
83
 
84
- return properties.find( item => item.name === member ) ? typedefItem : null;
84
+ return ( properties || [] ).find( item => item.name === member ) ? typedefItem : null;
85
85
  }
86
86
 
87
87
  let targetDoclet;
@@ -6,6 +6,7 @@
6
6
  'use strict';
7
7
 
8
8
  const TypedocConverter = require( './typedocconverter' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  /**
11
12
  * An abstract parser class providing basic utils for converting Typedoc reflection to JSDoc doclet.
@@ -14,14 +15,14 @@ module.exports = class AbstractParser {
14
15
  /**
15
16
  * @abstract
16
17
  * @method canParse
17
- * @param {TypedocReflection<TypedocParsers>} item
18
+ * @param {BaseReflection} item
18
19
  * @returns {Boolean}
19
20
  */
20
21
 
21
22
  /**
22
23
  * @abstract
23
24
  * @method parse
24
- * @param {TypedocReflection<TypedocParsers>} item
25
+ * @param {BaseReflection} item
25
26
  * @param {String|null} [parentName=null]
26
27
  * @returns {Object}
27
28
  */
@@ -29,7 +30,7 @@ module.exports = class AbstractParser {
29
30
  /**
30
31
  * Coverts the item's comment from Markdown to HTML.
31
32
  *
32
- * @param {TypedocReflectionMeta} item
33
+ * @param {BaseReflection} item
33
34
  * @returns {String}
34
35
  */
35
36
  getComment( item ) {
@@ -41,33 +42,35 @@ module.exports = class AbstractParser {
41
42
  }
42
43
 
43
44
  /**
44
- * @param {TypedocReflectionMeta} item
45
+ * @param {BaseReflection} item
45
46
  * @param {String|null} [parentName=null]
46
47
  * @returns {String}
47
48
  */
48
49
  getLongName( item, parentName = null ) {
49
50
  let separator;
50
51
 
51
- switch ( item.kindString ) {
52
- case 'Module':
52
+ if ( item.isCKEditor5Event ) {
53
+ separator = '#event:';
54
+ }
55
+
56
+ switch ( item.kind ) {
57
+ case ReflectionKind.Module:
53
58
  separator = ':';
54
59
  parentName = 'module';
55
60
  break;
56
61
 
57
- case 'Class':
58
- case 'Function':
59
- case 'Interface':
60
- case 'Type alias':
62
+ case ReflectionKind.Variable:
63
+ case ReflectionKind.Function:
64
+ case ReflectionKind.Class:
65
+ case ReflectionKind.Interface:
66
+ case ReflectionKind.TypeAlias:
61
67
  separator = '~';
62
68
  break;
63
69
 
64
- case 'Event':
65
- separator = '#event:';
66
- break;
67
-
68
70
  default:
69
- separator = this.getScope( item ) === 'static' ? '.' : '#';
70
- break;
71
+ if ( !separator ) {
72
+ separator = this.getScope( item ) === 'static' ? '.' : '#';
73
+ }
71
74
  }
72
75
 
73
76
  return `${ parentName }${ separator }${ item.name }`;
@@ -76,7 +79,7 @@ module.exports = class AbstractParser {
76
79
  /**
77
80
  * Prepares the name for the computed property.
78
81
  *
79
- * @param {TypedocReflection<'Index signature'>} item
82
+ * @param {ComputedPropertyReflection} item
80
83
  * @returns {String}
81
84
  */
82
85
  getComputedName( item ) {
@@ -86,7 +89,7 @@ module.exports = class AbstractParser {
86
89
  /**
87
90
  * Returns the access type for the item.
88
91
  *
89
- * @param {TypedocReflectionMeta} item
92
+ * @param {BaseReflection} item
90
93
  * @returns {'public'|'internal'|'protected'|'private'}
91
94
  */
92
95
  getVisibility( item ) {
@@ -110,48 +113,49 @@ module.exports = class AbstractParser {
110
113
  /**
111
114
  * Returns the item's kind.
112
115
  *
113
- * @param {TypedocReflectionMeta} item
116
+ * @param {BaseReflection} item
114
117
  * @returns {String}
115
118
  */
116
119
  getKind( item ) {
117
- switch ( item.kindString ) {
118
- case 'Module':
120
+ if ( item.isCKEditor5Event ) {
121
+ return 'event';
122
+ }
123
+ if ( item.isCKEditor5Error ) {
124
+ return 'error';
125
+ }
126
+
127
+ switch ( item.kind ) {
128
+ case ReflectionKind.Module:
119
129
  return 'module';
120
130
 
121
- case 'Class':
131
+ case ReflectionKind.Class:
122
132
  return 'class';
123
133
 
124
- case 'Function':
125
- case 'Method':
126
- case 'Constructor':
134
+ case ReflectionKind.Function:
135
+ case ReflectionKind.Method:
136
+ case ReflectionKind.Constructor:
127
137
  return 'function';
128
138
 
129
- case 'Interface':
139
+ case ReflectionKind.Interface:
130
140
  return 'interface';
131
141
 
132
- case 'Accessor':
133
- case 'Property':
134
- case 'Index signature':
142
+ case ReflectionKind.Accessor:
143
+ case ReflectionKind.Property:
144
+ case ReflectionKind.IndexSignature:
135
145
  return 'member';
136
146
 
137
- case 'Variable':
147
+ case ReflectionKind.Variable:
138
148
  return 'constant';
139
149
 
140
- case 'Type alias':
150
+ case ReflectionKind.TypeAlias:
141
151
  return 'typedef';
142
-
143
- case 'Event':
144
- return 'event';
145
-
146
- case 'Error':
147
- return 'error';
148
152
  }
149
153
  }
150
154
 
151
155
  /**
152
156
  * Returns the item's scope.
153
157
  *
154
- * @param {TypedocReflectionMeta} item
158
+ * @param {BaseReflection} item
155
159
  * @returns {'instance'|'static'}
156
160
  */
157
161
  getScope( item ) {
@@ -167,7 +171,7 @@ module.exports = class AbstractParser {
167
171
  /**
168
172
  * Returns the `extraId` combined from the item's scope, kind, name and optional variation.
169
173
  *
170
- * @param {TypedocReflectionMeta} item
174
+ * @param {BaseReflection} item
171
175
  * @returns {String}
172
176
  */
173
177
  getExtraId( item ) {
@@ -179,7 +183,7 @@ module.exports = class AbstractParser {
179
183
  /**
180
184
  * Returns the long names of the events that are fired from the signature.
181
185
  *
182
- * @param {TypedocReflectionMeta} signature
186
+ * @param {BaseReflection} signature
183
187
  * @param {String} parentName
184
188
  * @returns {Array.<String>|null}
185
189
  */
@@ -202,7 +206,7 @@ module.exports = class AbstractParser {
202
206
  }
203
207
 
204
208
  /**
205
- * @param {TypedocReflectionMeta} signature
209
+ * @param {BaseReflection} signature
206
210
  * @param {String} parentName
207
211
  * @returns {Array.<Object>|null}
208
212
  */
@@ -243,7 +247,7 @@ module.exports = class AbstractParser {
243
247
  * Returns the URL to GitHub with selected line, where the given doclet is defined.
244
248
  * The URL includes a commit hash which was used to build the API docs.
245
249
  *
246
- * @param {TypedocReflection<TypedocParsers>} item
250
+ * @param {BaseReflection} item
247
251
  * @param {Number} sourceIndex
248
252
  * @returns {Object|null}
249
253
  */
@@ -264,7 +268,7 @@ module.exports = class AbstractParser {
264
268
  /**
265
269
  * Returns links from the "@see" tags.
266
270
  *
267
- * @param {TypedocReflectionMeta} item
271
+ * @param {BaseReflection} item
268
272
  * @param {String|null} [parentName=null]
269
273
  * @returns {Array.<String>}
270
274
  */
@@ -308,7 +312,7 @@ module.exports = class AbstractParser {
308
312
  *
309
313
  * The readonly state can be marked either by a TypeScript `readonly` keyword, or by the `@readonly` JSDoc keyword.
310
314
  *
311
- * @param {TypedocReflection} item
315
+ * @param {BaseReflection} item
312
316
  * @returns {Boolean}
313
317
  */
314
318
  isReadonly( item ) {
@@ -324,7 +328,7 @@ module.exports = class AbstractParser {
324
328
  *
325
329
  * The observable state can be marked by the `@observable` JSDoc keyword.
326
330
  *
327
- * @param {TypedocReflectionMeta} item
331
+ * @param {BaseReflection} item
328
332
  * @returns {Boolean}
329
333
  */
330
334
  isObservable( item ) {
@@ -338,7 +342,7 @@ module.exports = class AbstractParser {
338
342
  /**
339
343
  * Checks if the item is marked as an optional.
340
344
  *
341
- * @param {TypedocReflectionMeta} item
345
+ * @param {BaseReflection} item
342
346
  * @returns {Boolean}
343
347
  */
344
348
  isOptional( item ) {
@@ -355,7 +359,7 @@ module.exports = class AbstractParser {
355
359
  * The `internal` state means the same as `protected`, but with one exception: the `internal` member can be used from outside the class
356
360
  * in which it is defined (or its derivatives), as opposed to the `protected` state.
357
361
  *
358
- * @param {TypedocReflectionMeta} item
362
+ * @param {BaseReflection} item
359
363
  * @returns {Boolean}
360
364
  */
361
365
  isInternal( item ) {
@@ -369,7 +373,7 @@ module.exports = class AbstractParser {
369
373
  /**
370
374
  * Checks if the member is marked by the `@deprecated` JSDoc tag.
371
375
  *
372
- * @param {TypedocReflectionMeta>} item
376
+ * @param {BaseReflection} item
373
377
  * @returns {Boolean}
374
378
  */
375
379
  isDeprecated( item ) {
@@ -387,7 +391,7 @@ module.exports = class AbstractParser {
387
391
  * It happens when the member has not specified `file` property. In such a case, Umberto does not know
388
392
  * where to point to a source and decides to skip generating the "See source" button.
389
393
  *
390
- * @param {TypedocReflectionMeta} item
394
+ * @param {BaseReflection} item
391
395
  * @returns {Boolean}
392
396
  */
393
397
  shouldSkipSource( item ) {
@@ -402,7 +406,7 @@ module.exports = class AbstractParser {
402
406
  * Returns a name specified in the `@label` annotation.
403
407
  *
404
408
  * @protected
405
- * @param {TypedocReflectionMeta} item
409
+ * @param {BaseReflection} item
406
410
  * @returns {String}
407
411
  */
408
412
  _getLabelName( item ) {
@@ -6,21 +6,22 @@
6
6
  'use strict';
7
7
 
8
8
  const AbstractParser = require( './abstractparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class AccessorParser extends AbstractParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Accessor';
17
+ return item.kind === ReflectionKind.Accessor;
17
18
  }
18
19
 
19
20
  /**
20
21
  * Checks if the accessor is readonly.
21
22
  *
22
23
  * @override
23
- * @param {TypedocReflection} item
24
+ * @param {AccessorReflection} item
24
25
  * @returns {Boolean}
25
26
  */
26
27
  isReadonly( item ) {
@@ -28,7 +29,7 @@ module.exports = class AccessorParser extends AbstractParser {
28
29
  }
29
30
 
30
31
  /**
31
- * @param {TypedocReflection<'Accessor'>} item
32
+ * @param {AccessorReflection} item
32
33
  * @param {String} parentName
33
34
  * @returns {Object}
34
35
  */
@@ -41,6 +42,7 @@ module.exports = class AccessorParser extends AbstractParser {
41
42
  // Needed for post-processing once all project reflections are converted.
42
43
  _signature: [ getSignature || {}, setSignature || {} ],
43
44
 
45
+ id: item.id,
44
46
  name: item.name,
45
47
  memberof: parentName,
46
48
  longname: this.getLongName( item, parentName ),
@@ -65,7 +67,7 @@ module.exports = class AccessorParser extends AbstractParser {
65
67
  /**
66
68
  * Returns the access type for the item based on its signatures.
67
69
  *
68
- * @param {TypedocReflection<Accessor>} item
70
+ * @param {AccessorReflection} item
69
71
  * @returns {'public'|'internal'|'protected'|'private'}
70
72
  */
71
73
  getVisibilityIncludingSignature( item ) {
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const AbstractParser = require( './abstractparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class ClassParser extends AbstractParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Class';
17
+ return item.kind === ReflectionKind.Class;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Class'>} item
21
+ * @param {ClassReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Object}
23
24
  */
@@ -26,6 +27,7 @@ module.exports = class ClassParser extends AbstractParser {
26
27
  // Needed for post-processing once all project reflections are converted.
27
28
  _signature: item,
28
29
 
30
+ id: item.id,
29
31
  name: item.name,
30
32
  memberof: parentName,
31
33
  longname: this.getLongName( item, parentName ),
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const PropertyParser = require( './propertyparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class ComputedPropertyParser extends PropertyParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Index signature';
17
+ return item.kind === ReflectionKind.IndexSignature;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Index signature'>} item
21
+ * @param {ComputedPropertyReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Object}
23
24
  */
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const AbstractParser = require( './abstractparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class ConstantParser extends AbstractParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Variable';
17
+ return item.kind === ReflectionKind.Variable;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Variable'>} item
21
+ * @param {VariableReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Object}
23
24
  */
@@ -26,6 +27,7 @@ module.exports = class ConstantParser extends AbstractParser {
26
27
  // Needed for post-processing once all project reflections are converted.
27
28
  _signature: item,
28
29
 
30
+ id: item.id,
29
31
  name: item.name,
30
32
  memberof: parentName,
31
33
  longname: this.getLongName( item, parentName ),
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const MethodParser = require( './methodparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class ConstructorParser extends MethodParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Constructor';
17
+ return item.kind === ReflectionKind.Constructor;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Constructor'>} item
21
+ * @param {ConstructorReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Array.<Object>}
23
24
  */
@@ -9,26 +9,20 @@ const AbstractParser = require( './abstractparser' );
9
9
 
10
10
  module.exports = class ErrorParser extends AbstractParser {
11
11
  /**
12
- * @param {TypedocReflectionMeta} item
12
+ * @param {BaseReflection} item
13
13
  * @returns {Boolean}
14
14
  */
15
15
  canParse( item ) {
16
- return item.kindString === 'Error';
16
+ return item.isCKEditor5Error === true;
17
17
  }
18
18
 
19
19
  /**
20
- * @param {TypedocReflection<'Error'>} item
20
+ * @param {CKEditor5ErrorReflection} item
21
21
  * @returns {Object}
22
22
  */
23
23
  parse( item ) {
24
24
  return {
25
- _signature: [
26
- {},
27
- // As errors are our custom implementation, TypeDoc does not allow creating `parameters` property for them. Error parameters
28
- // are passed in `typeParameters` property. To process the error parameters properly, we manually map `typeParameters` into
29
- // `parameters` property.
30
- { parameters: item.typeParameters }
31
- ],
25
+ _signature: [ {}, item ],
32
26
 
33
27
  kind: this.getKind( item ),
34
28
  scope: 'inner',
@@ -9,15 +9,15 @@ const AbstractParser = require( './abstractparser' );
9
9
 
10
10
  module.exports = class EventParser extends AbstractParser {
11
11
  /**
12
- * @param {TypedocReflectionMeta} item
12
+ * @param {BaseReflection} item
13
13
  * @returns {Boolean}
14
14
  */
15
15
  canParse( item ) {
16
- return item.kindString === 'Event';
16
+ return item.isCKEditor5Event === true;
17
17
  }
18
18
 
19
19
  /**
20
- * @param {TypedocReflection<'Event'>} item
20
+ * @param {CKEditor5EventReflection} item
21
21
  * @param {String} parentName
22
22
  * @returns {Object}
23
23
  */
@@ -28,13 +28,7 @@ module.exports = class EventParser extends AbstractParser {
28
28
 
29
29
  return {
30
30
  // Needed for post-processing once all project reflections are converted.
31
- _signature: [
32
- {},
33
- // As events are our custom implementation, TypeDoc does not allow creating `parameters` property for them. Event parameters
34
- // are passed in `typeParameters` property. To process the event parameters properly, we manually map `typeParameters` into
35
- // `parameters` property.
36
- { parameters: item.typeParameters }
37
- ],
31
+ _signature: [ {}, item ],
38
32
 
39
33
  name: item.name,
40
34
  memberof: parentName,
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const AbstractParser = require( './abstractparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class FunctionParser extends AbstractParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Function';
17
+ return item.kind === ReflectionKind.Function;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Function'>} item
21
+ * @param {FunctionReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Array.<Object>}
23
24
  */
@@ -27,6 +28,7 @@ module.exports = class FunctionParser extends AbstractParser {
27
28
  // Needed for post-processing once all project reflections are converted.
28
29
  _signature: signature,
29
30
 
31
+ id: item.id,
30
32
  name: item.name,
31
33
  memberof: parentName,
32
34
  longname: this.getLongName( item, parentName ),
@@ -6,18 +6,19 @@
6
6
  'use strict';
7
7
 
8
8
  const AbstractParser = require( './abstractparser' );
9
+ const ReflectionKind = require( './reflectionkind' );
9
10
 
10
11
  module.exports = class InterfaceParser extends AbstractParser {
11
12
  /**
12
- * @param {TypedocReflectionMeta} item
13
+ * @param {BaseReflection} item
13
14
  * @returns {Boolean}
14
15
  */
15
16
  canParse( item ) {
16
- return item.kindString === 'Interface';
17
+ return item.kind === ReflectionKind.Interface;
17
18
  }
18
19
 
19
20
  /**
20
- * @param {TypedocReflection<'Interface'>} item
21
+ * @param {InterfaceReflection} item
21
22
  * @param {String} parentName
22
23
  * @returns {Object}
23
24
  */
@@ -26,6 +27,7 @@ module.exports = class InterfaceParser extends AbstractParser {
26
27
  // Needed for post-processing once all project reflections are converted.
27
28
  _signature: item,
28
29
 
30
+ id: item.id,
29
31
  name: item.name,
30
32
  memberof: parentName,
31
33
  longname: this.getLongName( item, parentName ),