fix(ivy): generate a type parameter for InjectorDef (#24738)
InjectorDef is parameterized on the type of the injector configuration class (e.g. the @NgModule decorated type). Previously this parameter was not included when generating .d.ts files that contained InjectorDefs. PR Close #24738
This commit is contained in:
parent
d05d28629d
commit
a1b630ee8f
|
@ -107,7 +107,8 @@ export function compileInjector(meta: R3InjectorMetadata): R3InjectorDef {
|
||||||
providers: meta.providers,
|
providers: meta.providers,
|
||||||
imports: meta.imports,
|
imports: meta.imports,
|
||||||
})]);
|
})]);
|
||||||
const type = new o.ExpressionType(o.importExpr(R3.InjectorDef));
|
const type =
|
||||||
|
new o.ExpressionType(o.importExpr(R3.InjectorDef, [new o.ExpressionType(meta.type)]));
|
||||||
return {expression, type};
|
return {expression, type};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -408,6 +408,12 @@ export declare abstract class Injector {
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare const INJECTOR: InjectionToken<Injector>;
|
export declare const INJECTOR: InjectionToken<Injector>;
|
||||||
|
|
||||||
|
export interface InjectorDef<T> {
|
||||||
|
factory: () => T;
|
||||||
|
imports: (InjectorType<any> | InjectorTypeWithProviders<any>)[];
|
||||||
|
providers: (Type<any> | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[];
|
||||||
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export interface InjectorType<T> extends Type<T> {
|
export interface InjectorType<T> extends Type<T> {
|
||||||
ngInjectorDef: never;
|
ngInjectorDef: never;
|
||||||
|
|
Loading…
Reference in New Issue