Skip to content

Commit 62c65ae

Browse files
committed
feat(component-meta): support JSDoc tags for events
1 parent 1462f5e commit 62c65ae

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/component-meta/lib/base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,10 @@ function createSchemaResolvers(
567567
return {
568568
name: (typeChecker.getTypeOfSymbolAtLocation(call.parameters[0], symbolNode) as ts.StringLiteralType).value,
569569
description: ts.displayPartsToString(call.getDocumentationComment(typeChecker)),
570+
tags: call.getJsDocTags().map(tag => ({
571+
name: tag.name,
572+
text: tag.text !== undefined ? ts.displayPartsToString(tag.text) : undefined,
573+
})),
570574
type: typeChecker.typeToString(subtype),
571575
rawType: rawType ? subtype : undefined,
572576
signature: typeChecker.signatureToString(call),

packages/component-meta/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface EventMeta {
4040
type: string;
4141
rawType?: ts.Type;
4242
signature: string;
43+
tags: { name: string, text?: string; }[];
4344
declarations: Declaration[];
4445
schema: PropertyMetaSchema[];
4546
}

0 commit comments

Comments
 (0)