fix(ivy): types in .d.ts files should account for generics (#24862)
Ivy definition types have a generic type which specifies the return type of the factory function. For example: static ngDirectiveDef<NgForOf, '[ngFor][ngForOf]'> However, in this case NgForOf itself has a type parameter <T>. Thus, writing the above is incorrect. This commit modifies ngtsc to understand the genericness of NgForOf and to write the following: static ngDirectiveDef<NgForOf<any>, '[ngFor][ngForOf]'> PR Close #24862
This commit is contained in:

committed by
Victor Berchet

parent
2b8b647006
commit
41ef75869c
@ -143,6 +143,7 @@ export function extractDirectiveMetadata(
|
||||
inputs: {...inputsFromMeta, ...inputsFromFields},
|
||||
outputs: {...outputsFromMeta, ...outputsFromFields}, queries, selector,
|
||||
type: new WrappedNodeExpr(clazz.name !),
|
||||
typeArgumentCount: (clazz.typeParameters || []).length,
|
||||
typeSourceSpan: null !, usesInheritance,
|
||||
};
|
||||
return {decoratedElements, decorator: directive, metadata};
|
||||
|
Reference in New Issue
Block a user