@@ -57,6 +57,7 @@ import {
57
57
isVariableDeclaration ,
58
58
isVariableDeclarationInitializedToBareOrAccessedRequire ,
59
59
isVariableStatement ,
60
+ JSDocImportTypeTag ,
60
61
ModifierFlags ,
61
62
ModuleBlock ,
62
63
ModuleDeclaration ,
@@ -138,7 +139,7 @@ interface AmbientModuleDeclaration extends ModuleDeclaration {
138
139
}
139
140
type SourceFileLike = SourceFile | AmbientModuleDeclaration ;
140
141
// Identifier for the case of `const x = require("y")`.
141
- type Importer = AnyImportOrReExport | ValidImportTypeNode | Identifier ;
142
+ type Importer = AnyImportOrReExport | ValidImportTypeNode | Identifier | JSDocImportTypeTag ;
142
143
type ImporterOrCallExpression = Importer | CallExpression ;
143
144
144
145
/** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */
@@ -215,6 +216,7 @@ function getImportersForExport(
215
216
break ;
216
217
217
218
case SyntaxKind . ImportDeclaration :
219
+ case SyntaxKind . JSDocImportTypeTag :
218
220
directImports . push ( direct ) ;
219
221
const namedBindings = direct . importClause && direct . importClause . namedBindings ;
220
222
if ( namedBindings && namedBindings . kind === SyntaxKind . NamespaceImport ) {
@@ -267,7 +269,7 @@ function getImportersForExport(
267
269
} ) ;
268
270
}
269
271
270
- function handleNamespaceImport ( importDeclaration : ImportEqualsDeclaration | ImportDeclaration , name : Identifier , isReExport : boolean , alreadyAddedDirect : boolean ) : void {
272
+ function handleNamespaceImport ( importDeclaration : ImportEqualsDeclaration | ImportDeclaration | JSDocImportTypeTag , name : Identifier , isReExport : boolean , alreadyAddedDirect : boolean ) : void {
271
273
if ( exportKind === ExportKind . ExportEquals ) {
272
274
// This is a direct import, not import-as-namespace.
273
275
if ( ! alreadyAddedDirect ) directImports . push ( importDeclaration ) ;
0 commit comments