Skip to content

DI Bag API / index / OverrideFactoryContext

Type Alias: OverrideFactoryContext<R extends Registrations, K extends readonly unknown[], O> ​

ts
type OverrideFactoryContext<R extends Registrations, K extends readonly unknown[], O> = {
    [P in Extract<SelectionKey<K[number]>, keyof SelectionRegistrations<R, K>>]: ((this: void, dependencies: ServicesOf<AppliedSelection<R, K, O>>) => OverrideOutput<SelectionRegistrations<R, K>, K, P>) | ProviderContext<(this: void, dependencies: ServicesOf<AppliedSelection<R, K, O>>) => OverrideOutput<SelectionRegistrations<R, K>, K, P>, P extends keyof O ? ProviderGraphContract<Extract<O[P], ProviderOrFactory>> : TokenDependencyContract>;
};

Defined in: types.ts:393

Contextual replacement shape used to infer a selected independent- or child-container graph.

Type Parameters ​

Type ParameterDescription
R-
K-
O-

See ​

https://dany-fedorov.github.io/di-bag/guides/tutorial.html#create-an-independent-container

Ordinary services. Checked composition. Explicit ownership.