fix: change deprecated FunctionLike type to SignatureDeclaration (#40795)

This commit is contained in:
Alex T
2020-10-06 17:51:01 +03:00
committed by GitHub
parent 1e49ad8370
commit 0c7d45a9ed
7 changed files with 12 additions and 12 deletions

View File

@@ -222,7 +222,7 @@ namespace ts.codefix {
importAdder: ImportAdder,
sourceFile: SourceFile,
parameterDeclaration: ParameterDeclaration,
containingFunction: FunctionLike,
containingFunction: SignatureDeclaration,
program: Program,
host: LanguageServiceHost,
cancellationToken: CancellationToken,
@@ -268,7 +268,7 @@ namespace ts.codefix {
}
}
function annotateJSDocThis(changes: textChanges.ChangeTracker, sourceFile: SourceFile, containingFunction: FunctionLike, typeNode: TypeNode) {
function annotateJSDocThis(changes: textChanges.ChangeTracker, sourceFile: SourceFile, containingFunction: SignatureDeclaration, typeNode: TypeNode) {
addJSDocTags(changes, sourceFile, containingFunction, [
factory.createJSDocThisTag(/*tagName*/ undefined, factory.createJSDocTypeExpression(typeNode)),
]);
@@ -409,7 +409,7 @@ namespace ts.codefix {
}));
}
function getFunctionReferences(containingFunction: FunctionLike, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): readonly Identifier[] | undefined {
function getFunctionReferences(containingFunction: SignatureDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): readonly Identifier[] | undefined {
let searchToken;
switch (containingFunction.kind) {
case SyntaxKind.Constructor:
@@ -534,7 +534,7 @@ namespace ts.codefix {
return combineTypes(inferTypesFromReferencesSingle(references));
}
function parameters(declaration: FunctionLike): ParameterInference[] | undefined {
function parameters(declaration: SignatureDeclaration): ParameterInference[] | undefined {
if (references.length === 0 || !declaration.parameters) {
return undefined;
}