refactor(ivy): include generic type for ModuleWithProviders in .d.ts files (#34235)

The `ModuleWithProviders` type has an optional type parameter that
should be specified to indicate what NgModule class will be provided.
This enables the Ivy compiler to statically determine the NgModule type
from the declaration files. This type parameter will become required in
the future, however to aid in the migration the compiler will detect
code patterns where using `ModuleWithProviders` as return type is
appropriate, in which case it transforms the emitted .d.ts files to
include the generic type argument.

This should reduce the number of occurrences where `ModuleWithProviders`
is referenced without its generic type argument.

Resolves FW-389

PR Close #34235
This commit is contained in:
JoostK
2019-12-03 21:25:27 +01:00
committed by Andrew Kushnir
parent a8fced8846
commit b72c7a89a9
12 changed files with 592 additions and 12 deletions

View File

@ -260,6 +260,11 @@ export class Identifiers {
moduleName: CORE,
};
static ModuleWithProviders: o.ExternalReference = {
name: 'ModuleWithProviders',
moduleName: CORE,
};
static defineNgModule: o.ExternalReference = {name: 'ɵɵdefineNgModule', moduleName: CORE};
static setNgModuleScope: o.ExternalReference = {name: 'ɵɵsetNgModuleScope', moduleName: CORE};