diff --git a/packages/core/src/di/index.ts b/packages/core/src/di/index.ts index 929e8d3072..4281c5dc81 100644 --- a/packages/core/src/di/index.ts +++ b/packages/core/src/di/index.ts @@ -20,7 +20,7 @@ export {Injectable, InjectableDecorator, InjectableProvider} from './injectable' export {Injector} from './injector'; export {ɵɵinject, inject, INJECTOR} from './injector_compatibility'; export {ReflectiveInjector} from './reflective_injector'; -export {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider, ValueSansProvider, ClassSansProvider} from './interface/provider'; +export {ClassProvider, ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, Provider, StaticClassProvider, StaticClassSansProvider, StaticProvider, TypeProvider, ValueProvider, ValueSansProvider} from './interface/provider'; export {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './reflective_provider'; export {ReflectiveKey} from './reflective_key'; export {InjectionToken} from './injection_token'; diff --git a/packages/core/src/di/interface/provider.ts b/packages/core/src/di/interface/provider.ts index ead558ee8a..d518cce9e5 100644 --- a/packages/core/src/di/interface/provider.ts +++ b/packages/core/src/di/interface/provider.ts @@ -164,12 +164,6 @@ export interface ConstructorProvider extends ConstructorSansProvider { * * For more details, see the ["Dependency Injection Guide"](guide/dependency-injection). * - * @usageNotes - * - * ### Example - * - * {@example core/di/ts/provider_spec.ts region='ExistingSansProvider'} - * * @publicApi */ export interface ExistingSansProvider { @@ -214,11 +208,6 @@ export interface ExistingProvider extends ExistingSansProvider { * * For more details, see the ["Dependency Injection Guide"](guide/dependency-injection). * - * @usageNotes - * ### Example - * - * {@example core/di/ts/provider_spec.ts region='FactorySansProvider'} - * * @publicApi */ export interface FactorySansProvider { @@ -369,4 +358,4 @@ export type Provider = TypeProvider | ValueProvider | ClassProvider | Constructo * Describes a function that is used to process provider list (for example in case of provider * overrides). */ -export type ProcessProvidersFunction = (providers: Provider[]) => Provider[]; \ No newline at end of file +export type ProcessProvidersFunction = (providers: Provider[]) => Provider[]; diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 4c94613a7a..12062bbcb0 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -165,6 +165,11 @@ export declare abstract class ComponentRef { abstract onDestroy(callback: Function): void; } +export interface ConstructorProvider extends ConstructorSansProvider { + multi?: boolean; + provide: Type; +} + export interface ConstructorSansProvider { deps?: any[]; } @@ -332,11 +337,20 @@ export interface ExistingProvider extends ExistingSansProvider { provide: any; } +export interface ExistingSansProvider { + useExisting: any; +} + export interface FactoryProvider extends FactorySansProvider { multi?: boolean; provide: any; } +export interface FactorySansProvider { + deps?: any[]; + useFactory: Function; +} + export declare function forwardRef(forwardRefFn: ForwardRefFn): Type; export interface ForwardRefFn { @@ -1345,6 +1359,16 @@ export interface SkipSelfDecorator { new (): SkipSelf; } +export interface StaticClassProvider extends StaticClassSansProvider { + multi?: boolean; + provide: any; +} + +export interface StaticClassSansProvider { + deps: any[]; + useClass: Type; +} + export declare type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[]; /** @deprecated */