Skip to content

Commit 66cc9d1

Browse files
committed
fix: Support TSParameterProperty
1 parent b285d00 commit 66cc9d1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/jsdoc/doclet.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ Doclet.prototype.postFunction = function() {
245245
for (var i = 0; i < length; i++) {
246246
var tsParam = tsParams[i] || {};
247247

248+
if (tsParam.nodeType === 'TSParameterProperty') {
249+
tsParam = tsParam.parameter;
250+
}
248251
if (tsParam.nodeType === 'AssignmentPattern') {
249252
tsParam = {
250253
id: tsParam.left.id,

lib/jsdoc/src/TypeScriptParser.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,15 @@ var types = {
880880
template: '$if{async, "async "}${typeParameters}(${params}) => $if{returnType, returnType, "void 0"}'
881881
});
882882
},
883+
TSParameterProperty: function(node) {
884+
return read(node, {
885+
parameter: 'type',
886+
accessibility: 'value',
887+
readonly: 'value'
888+
}, {
889+
template: '${accessibility} ${parameter}'
890+
});
891+
},
883892
TSMappedType: function(node) {
884893
// [K in keyof T]?: (Equals<{-readonly [P in K]: T[K]}>)
885894
return read(node, {

0 commit comments

Comments
 (0)