Add support for this param in function type definitions

This commit is contained in:
Lukáš Krotovič 2021-02-19 08:45:49 +01:00
parent bcec700776
commit fdbffffd3e
3 changed files with 15 additions and 1 deletions

View file

@ -333,6 +333,12 @@ class Parser {
}
setParams(doclet, obj) {
let parameters = [];
if (doclet.this) {
let typeName = this.prepareTypeName(doclet.this);
let type = dom.create.namedTypeReference(this.processTypeName(typeName));
let param = dom.create.parameter(dom.type.this, type);
parameters.push(param);
}
if (doclet.params) {
let optional = false;
obj.jsDocComment = '';

File diff suppressed because one or more lines are too long

View file

@ -449,6 +449,14 @@ export class Parser {
private setParams(doclet: any, obj: dom.FunctionDeclaration | dom.ConstructorDeclaration): void {
let parameters: dom.Parameter[] = [];
if (doclet.this) {
let typeName = this.prepareTypeName(doclet.this);
let type = dom.create.namedTypeReference(this.processTypeName(typeName));
let param = dom.create.parameter(dom.type.this, type);
parameters.push(param);
}
if (doclet.params) {
let optional = false;