@@ -341,6 +341,7 @@ export function createSignatureDeclarationFromSignature(
341
341
const program = context . program ;
342
342
const checker = program . getTypeChecker ( ) ;
343
343
const scriptTarget = getEmitScriptTarget ( program . getCompilerOptions ( ) ) ;
344
+ const isJs = isInJSFile ( enclosingDeclaration ) ;
344
345
const flags =
345
346
NodeBuilderFlags . NoTruncation
346
347
| NodeBuilderFlags . SuppressAnyReturnType
@@ -351,9 +352,9 @@ export function createSignatureDeclarationFromSignature(
351
352
return undefined ;
352
353
}
353
354
354
- let typeParameters = signatureDeclaration . typeParameters ;
355
+ let typeParameters = isJs ? undefined : signatureDeclaration . typeParameters ;
355
356
let parameters = signatureDeclaration . parameters ;
356
- let type = signatureDeclaration . type ;
357
+ let type = isJs ? undefined : signatureDeclaration . type ;
357
358
if ( importAdder ) {
358
359
if ( typeParameters ) {
359
360
const newTypeParameters = sameMap ( typeParameters , typeParameterDecl => {
@@ -386,11 +387,13 @@ export function createSignatureDeclarationFromSignature(
386
387
}
387
388
}
388
389
const newParameters = sameMap ( parameters , parameterDecl => {
389
- const importableReference = tryGetAutoImportableReferenceFromTypeNode ( parameterDecl . type , scriptTarget ) ;
390
- let type = parameterDecl . type ;
391
- if ( importableReference ) {
392
- type = importableReference . typeNode ;
393
- importSymbols ( importAdder , importableReference . symbols ) ;
390
+ let type = isJs ? undefined : parameterDecl . type ;
391
+ if ( type ) {
392
+ const importableReference = tryGetAutoImportableReferenceFromTypeNode ( type , scriptTarget ) ;
393
+ if ( importableReference ) {
394
+ type = importableReference . typeNode ;
395
+ importSymbols ( importAdder , importableReference . symbols ) ;
396
+ }
394
397
}
395
398
return factory . updateParameterDeclaration (
396
399
parameterDecl ,
0 commit comments