@@ -2700,11 +2700,11 @@ namespace ts {
27002700 * Gets the effective type annotation of a variable, parameter, or property. If the node was
27012701 * parsed in a JavaScript file, gets the type annotation from JSDoc.
27022702 */
2703- export function getEffectiveTypeAnnotationNode ( node : VariableLikeDeclaration ) : TypeNode | undefined {
2703+ export function getEffectiveTypeAnnotationNode ( node : VariableLikeDeclaration , checkJSDoc ?: boolean ) : TypeNode | undefined {
27042704 if ( node . type ) {
27052705 return node . type ;
27062706 }
2707- if ( isInJavaScriptFile ( node ) ) {
2707+ if ( checkJSDoc || isInJavaScriptFile ( node ) ) {
27082708 return getJSDocType ( node ) ;
27092709 }
27102710 }
@@ -2713,11 +2713,11 @@ namespace ts {
27132713 * Gets the effective return type annotation of a signature. If the node was parsed in a
27142714 * JavaScript file, gets the return type annotation from JSDoc.
27152715 */
2716- export function getEffectiveReturnTypeNode ( node : SignatureDeclaration ) : TypeNode | undefined {
2716+ export function getEffectiveReturnTypeNode ( node : SignatureDeclaration , checkJSDoc ?: boolean ) : TypeNode | undefined {
27172717 if ( node . type ) {
27182718 return node . type ;
27192719 }
2720- if ( isInJavaScriptFile ( node ) ) {
2720+ if ( checkJSDoc || isInJavaScriptFile ( node ) ) {
27212721 return getJSDocReturnType ( node ) ;
27222722 }
27232723 }
@@ -2726,11 +2726,11 @@ namespace ts {
27262726 * Gets the effective type parameters. If the node was parsed in a
27272727 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
27282728 */
2729- export function getEffectiveTypeParameterDeclarations ( node : DeclarationWithTypeParameters ) : ReadonlyArray < TypeParameterDeclaration > {
2729+ export function getEffectiveTypeParameterDeclarations ( node : DeclarationWithTypeParameters , checkJSDoc ?: boolean ) : ReadonlyArray < TypeParameterDeclaration > {
27302730 if ( node . typeParameters ) {
27312731 return node . typeParameters ;
27322732 }
2733- if ( isInJavaScriptFile ( node ) ) {
2733+ if ( checkJSDoc || isInJavaScriptFile ( node ) ) {
27342734 const templateTag = getJSDocTemplateTag ( node ) ;
27352735 return templateTag && templateTag . typeParameters ;
27362736 }
@@ -2740,9 +2740,9 @@ namespace ts {
27402740 * Gets the effective type annotation of the value parameter of a set accessor. If the node
27412741 * was parsed in a JavaScript file, gets the type annotation from JSDoc.
27422742 */
2743- export function getEffectiveSetAccessorTypeAnnotationNode ( node : SetAccessorDeclaration ) : TypeNode {
2743+ export function getEffectiveSetAccessorTypeAnnotationNode ( node : SetAccessorDeclaration , checkJSDoc ?: boolean ) : TypeNode {
27442744 const parameter = getSetAccessorValueParameter ( node ) ;
2745- return parameter && getEffectiveTypeAnnotationNode ( parameter ) ;
2745+ return parameter && getEffectiveTypeAnnotationNode ( parameter , checkJSDoc ) ;
27462746 }
27472747
27482748 export function emitNewLineBeforeLeadingComments ( lineMap : ReadonlyArray < number > , writer : EmitTextWriter , node : TextRange , leadingComments : ReadonlyArray < CommentRange > ) {
@@ -5130,7 +5130,14 @@ namespace ts {
51305130 || kind === SyntaxKind . UndefinedKeyword
51315131 || kind === SyntaxKind . NullKeyword
51325132 || kind === SyntaxKind . NeverKeyword
5133- || kind === SyntaxKind . ExpressionWithTypeArguments ;
5133+ || kind === SyntaxKind . ExpressionWithTypeArguments
5134+ || kind === SyntaxKind . JSDocAllType
5135+ || kind === SyntaxKind . JSDocUnknownType
5136+ || kind === SyntaxKind . JSDocNullableType
5137+ || kind === SyntaxKind . JSDocNonNullableType
5138+ || kind === SyntaxKind . JSDocOptionalType
5139+ || kind === SyntaxKind . JSDocFunctionType
5140+ || kind === SyntaxKind . JSDocVariadicType ;
51345141 }
51355142
51365143 /**
0 commit comments