diff --git a/packages/@cdklabs/typewriter/src/documented.ts b/packages/@cdklabs/typewriter/src/documented.ts index 853ef9ad2..83f1f2b02 100644 --- a/packages/@cdklabs/typewriter/src/documented.ts +++ b/packages/@cdklabs/typewriter/src/documented.ts @@ -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; /** * Description of the default * diff --git a/packages/@cdklabs/typewriter/src/renderer/typescript.ts b/packages/@cdklabs/typewriter/src/renderer/typescript.ts index 44be2826f..c316c9f6c 100644 --- a/packages/@cdklabs/typewriter/src/renderer/typescript.ts +++ b/packages/@cdklabs/typewriter/src/renderer/typescript.ts @@ -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);