|
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'; |
@@ -100,7 +100,7 @@ export type ImportProvidersSource = |
100 | 100 |
|
101 | 101 | type WalkProviderTreeVisitor = ( |
102 | 102 | provider: SingleProvider, |
103 | | - container: Type<unknown> | InjectorType<unknown>, |
| 103 | + container: Type<unknown> | AbstractType<unknown> | InjectorType<unknown>, |
104 | 104 | ) => void; |
105 | 105 |
|
106 | 106 | /** |
@@ -150,10 +150,10 @@ export function importProvidersFrom(...sources: ImportProvidersSource[]): Enviro |
150 | 150 |
|
151 | 151 | export function internalImportProvidersFrom( |
152 | 152 | checkForStandaloneCmp: boolean, |
153 | | - ...sources: ImportProvidersSource[] |
| 153 | + ...sources: (ImportProvidersSource | AbstractType<unknown>)[] |
154 | 154 | ): Provider[] { |
155 | 155 | const providersOut: SingleProvider[] = []; |
156 | | - const dedup = new Set<Type<unknown>>(); // already seen types |
| 156 | + const dedup = new Set<Type<unknown> | AbstractType<unknown>>(); // already seen types |
157 | 157 | let injectorTypesWithProviders: InjectorTypeWithProviders<unknown>[] | undefined; |
158 | 158 |
|
159 | 159 | const collectProviders: WalkProviderTreeVisitor = (provider) => { |
@@ -230,10 +230,10 @@ export type SingleProvider = |
230 | 230 | * an injector definition are processed. (following View Engine semantics: see FW-1349) |
231 | 231 | */ |
232 | 232 | export function walkProviderTree( |
233 | | - container: Type<unknown> | InjectorTypeWithProviders<unknown>, |
| 233 | + container: Type<unknown> | AbstractType<unknown> | InjectorTypeWithProviders<unknown>, |
234 | 234 | visitor: WalkProviderTreeVisitor, |
235 | | - parents: Type<unknown>[], |
236 | | - dedup: Set<Type<unknown>>, |
| 235 | + parents: (Type<unknown> | AbstractType<unknown>)[], |
| 236 | + dedup: Set<Type<unknown> | AbstractType<unknown>>, |
237 | 237 | ): container is InjectorTypeWithProviders<unknown> { |
238 | 238 | container = resolveForwardRef(container); |
239 | 239 | if (!container) return false; |
|
0 commit comments