|
7 | 7 | */ |
8 | 8 |
|
9 | 9 | import {RuntimeError, RuntimeErrorCode} from '../errors'; |
10 | | -import {Type} from '../interface/type'; |
| 10 | +import {AbstractType, Type} from '../interface/type'; |
11 | 11 | import {getComponentDef} from '../render3/def_getters'; |
12 | 12 | import {getFactoryDef} from '../render3/definition_factory'; |
13 | 13 | import {cyclicDependencyErrorWithDetails, throwInvalidProviderError} from '../render3/errors_di'; |
@@ -95,12 +95,13 @@ export function provideEnvironmentInitializer(initializerFn: () => void): Enviro |
95 | 95 | */ |
96 | 96 | export type ImportProvidersSource = |
97 | 97 | | Type<unknown> |
| 98 | + | AbstractType<unknown> |
98 | 99 | | ModuleWithProviders<unknown> |
99 | 100 | | Array<ImportProvidersSource>; |
100 | 101 |
|
101 | 102 | type WalkProviderTreeVisitor = ( |
102 | 103 | provider: SingleProvider, |
103 | | - container: Type<unknown> | InjectorType<unknown>, |
| 104 | + container: Type<unknown> | AbstractType<unknown> | InjectorType<unknown>, |
104 | 105 | ) => void; |
105 | 106 |
|
106 | 107 | /** |
@@ -153,7 +154,7 @@ export function internalImportProvidersFrom( |
153 | 154 | ...sources: ImportProvidersSource[] |
154 | 155 | ): Provider[] { |
155 | 156 | const providersOut: SingleProvider[] = []; |
156 | | - const dedup = new Set<Type<unknown>>(); // already seen types |
| 157 | + const dedup = new Set<Type<unknown> | AbstractType<unknown>>(); // already seen types |
157 | 158 | let injectorTypesWithProviders: InjectorTypeWithProviders<unknown>[] | undefined; |
158 | 159 |
|
159 | 160 | const collectProviders: WalkProviderTreeVisitor = (provider) => { |
@@ -230,10 +231,10 @@ export type SingleProvider = |
230 | 231 | * an injector definition are processed. (following View Engine semantics: see FW-1349) |
231 | 232 | */ |
232 | 233 | export function walkProviderTree( |
233 | | - container: Type<unknown> | InjectorTypeWithProviders<unknown>, |
| 234 | + container: Type<unknown> | AbstractType<unknown> | InjectorTypeWithProviders<unknown>, |
234 | 235 | visitor: WalkProviderTreeVisitor, |
235 | | - parents: Type<unknown>[], |
236 | | - dedup: Set<Type<unknown>>, |
| 236 | + parents: (Type<unknown> | AbstractType<unknown>)[], |
| 237 | + dedup: Set<Type<unknown> | AbstractType<unknown>>, |
237 | 238 | ): container is InjectorTypeWithProviders<unknown> { |
238 | 239 | container = resolveForwardRef(container); |
239 | 240 | if (!container) return false; |
|
0 commit comments