mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Expose method for retrieving inferred generic type arguments for a signature on the TypeChecker (#59637) (#60201)
This commit is contained in:
@@ -1931,8 +1931,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
isTypeParameterPossiblyReferenced,
|
||||
typeHasCallOrConstructSignatures,
|
||||
getSymbolFlags,
|
||||
getTypeArgumentsForResolvedSignature,
|
||||
};
|
||||
|
||||
function getTypeArgumentsForResolvedSignature(signature: Signature) {
|
||||
if (signature.mapper === undefined) return undefined;
|
||||
return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
|
||||
}
|
||||
|
||||
function getCandidateSignaturesForStringLiteralCompletions(call: CallLikeExpression, editingArgument: Node) {
|
||||
const candidatesSet = new Set<Signature>();
|
||||
const candidates: Signature[] = [];
|
||||
|
||||
@@ -5439,6 +5439,8 @@ export interface TypeChecker {
|
||||
/** @internal */ typeHasCallOrConstructSignatures(type: Type): boolean;
|
||||
/** @internal */ getSymbolFlags(symbol: Symbol): SymbolFlags;
|
||||
/** @internal */ fillMissingTypeArguments(typeArguments: readonly Type[], typeParameters: readonly TypeParameter[] | undefined, minTypeArgumentCount: number, isJavaScriptImplicitAny: boolean): Type[];
|
||||
|
||||
getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -6348,6 +6348,7 @@ declare namespace ts {
|
||||
* and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
|
||||
*/
|
||||
runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
|
||||
getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
|
||||
}
|
||||
enum NodeBuilderFlags {
|
||||
None = 0,
|
||||
|
||||
Reference in New Issue
Block a user