Skip to content

Commit

Permalink
feat(typewriter): Add docTags map to DocsSpec interface. (#538)
Browse files Browse the repository at this point in the history
Add `docTags` field to the DocSpec interface.

This is a dependency of aws/aws-cdk#26839.

---------

Co-authored-by: Mike Wrighton <[email protected]>
  • Loading branch information
mikewrighton and Mike Wrighton authored Sep 20, 2023
1 parent 5ea9934 commit 54cd5c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/@cdklabs/typewriter/src/documented.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export interface DocsSpec {
* @default none
*/
see?: string;
/**
* A map of document tags where the key represents the tag name.
*
* @default none
*/
docTags?: Record<string, string>;
/**
* Description of the default
*
Expand Down
6 changes: 6 additions & 0 deletions packages/@cdklabs/typewriter/src/renderer/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,13 @@ export class TypeScriptRenderer extends Renderer {
if (options?.forceStruct) {
line('@struct');
}

tagged('deprecated', el.docs?.deprecated);

for (const key in el.docs?.docTags) {
tagged(key, el.docs?.docTags[key]);
}

tagged('stability', el.docs?.stability);
tagged('default -', el.docs?.default);
tagged('returns', el.docs?.returns);
Expand Down

0 comments on commit 54cd5c3

Please sign in to comment.