mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 03:09:39 -06:00
Expose method for retrieving inferred generic type arguments for a signature on the TypeChecker (#59637) (#60201)
This commit is contained in:
parent
0e371c4bf5
commit
f28c5180df
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user