Skip to content

Commit

Permalink
feat(ngdoc): add @type custom type
Browse files Browse the repository at this point in the history
  • Loading branch information
why520crazy committed Aug 5, 2022
1 parent dc8fd5d commit b1ba6fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ngdoc/src/ng-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class NgDocParser {
name: symbolDescription.name,
aliasName: this.getNgPropertyAliasName(decorator),
type: {
name: symbolDescription.type,
name: getTextByJSDocTagInfo(tags.type, symbolDescription.type),
options: options,
kindName: ts.SyntaxKind[propertyDeclaration.type?.kind]
},
Expand Down
1 change: 1 addition & 0 deletions packages/ngdoc/src/parser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export interface DocTagResult {
default?: ts.JSDocTagInfo;
deprecated?: ts.JSDocTagInfo;
name?: ts.JSDocTagInfo;
type?: ts.JSDocTagInfo;
[key: string]: ts.JSDocTagInfo;
}
export interface MethodDocTagResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class ButtonComponent implements OnInit {

/**
* Template
* @type TemplateRef
*/
@ContentChild('template') templateRef: TemplateRef<unknown>;

Expand Down
2 changes: 1 addition & 1 deletion packages/ngdoc/test/fixtures/full/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"name": "templateRef",
"aliasName": "template",
"type": {
"name": "TemplateRef<unknown>",
"name": "TemplateRef",
"options": null,
"kindName": "TypeReference"
},
Expand Down

0 comments on commit b1ba6fd

Please sign in to comment.