fix(ivy): emit generic types when needed in defs in .d.ts file (#25406)

Ivy definitions in .d.ts files often reference the type of a class.
Sometimes, those classes have generic type parameters. When this is
the case, ngtsc needs to emit generic type parameters in the .d.ts
files (usually by passing 'any').

PR Close #25406
This commit is contained in:
Alex Rickabaugh
2018-08-09 14:23:15 +01:00
committed by Matias Niemelä
parent b97d770e60
commit d33e0091df
4 changed files with 18 additions and 3 deletions

View File

@ -156,7 +156,7 @@ export function extractDirectiveMetadata(
inputs: {...inputsFromMeta, ...inputsFromFields},
outputs: {...outputsFromMeta, ...outputsFromFields}, queries, selector,
type: new WrappedNodeExpr(clazz.name !),
typeArgumentCount: (clazz.typeParameters || []).length,
typeArgumentCount: reflector.getGenericArityOfClass(clazz) || 0,
typeSourceSpan: null !, usesInheritance, exportAs,
};
return {decoratedElements, decorator: directive, metadata};