From 058d355caeab3b4058e1166974ecd8444383fce4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 5 Sep 2017 15:22:17 -0700 Subject: [PATCH] Add getJSDocTypeTag to get `@type` tag --- src/compiler/utilities.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index fe242190262..78eacee7d22 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3975,14 +3975,19 @@ namespace ts { return getFirstJSDocTag(node, SyntaxKind.JSDocClassTag) as JSDocClassTag; } + /** Gets the JSDoc return tag for the node if present */ + export function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined { + return getFirstJSDocTag(node, SyntaxKind.JSDocReturnTag) as JSDocReturnTag; + } + /** Gets the JSDoc template tag for the node if present */ export function getJSDocTemplateTag(node: Node): JSDocTemplateTag | undefined { return getFirstJSDocTag(node, SyntaxKind.JSDocTemplateTag) as JSDocTemplateTag; } - /** Gets the JSDoc return tag for the node if present */ - export function getJSDocReturnTag(node: Node): JSDocReturnTag | undefined { - return getFirstJSDocTag(node, SyntaxKind.JSDocReturnTag) as JSDocReturnTag; + /** Gets the JSDoc type tag for the node if present */ + export function getJSDocTypeTag(node: Node): JSDocTypeTag | undefined { + return getFirstJSDocTag(node, SyntaxKind.JSDocTypeTag) as JSDocTypeTag; } /**