Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typewriter): Add docTags map to DocsSpec interface. #538

Merged
merged 6 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?: Map<string, string>;
mikewrighton marked this conversation as resolved.
Show resolved Hide resolved
/**
* 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, value] of el.docs?.docTags || new Map()) {
tagged(key, value);
}

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