Skip to content

Commit

Permalink
feat(component-meta): support JSDoc tags for events
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed May 10, 2024
1 parent 1462f5e commit 62c65ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/component-meta/lib/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ function createSchemaResolvers(
return {
name: (typeChecker.getTypeOfSymbolAtLocation(call.parameters[0], symbolNode) as ts.StringLiteralType).value,
description: ts.displayPartsToString(call.getDocumentationComment(typeChecker)),
tags: call.getJsDocTags().map(tag => ({
name: tag.name,
text: tag.text !== undefined ? ts.displayPartsToString(tag.text) : undefined,
})),
type: typeChecker.typeToString(subtype),
rawType: rawType ? subtype : undefined,
signature: typeChecker.signatureToString(call),
Expand Down
1 change: 1 addition & 0 deletions packages/component-meta/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface EventMeta {
type: string;
rawType?: ts.Type;
signature: string;
tags: { name: string, text?: string; }[];
declarations: Declaration[];
schema: PropertyMetaSchema[];
}
Expand Down

0 comments on commit 62c65ae

Please sign in to comment.