Skip to main content
Version: 2.x

DI variable

@microsoft/fast-element/di.js > DI

DI variable

The gateway to dependency injection APIs.

Signature:

DI: Readonly<&#123;
installAsContextRequestStrategy(fallback?: () => DOMContainer): void;
createContainer(config?: Partial<ContainerConfiguration>): Container;
findResponsibleContainer(target: EventTarget, fallback?: () => DOMContainer): DOMContainer;
findParentContainer(target: EventTarget, fallback?: () => DOMContainer): DOMContainer;
getOrCreateDOMContainer(target?: EventTarget, config?: Partial<Omit<ContainerConfiguration, "parentLocator">>): DOMContainer;
getDependencies(Type: Constructable | Injectable): Key[];
defineProperty(target: &#123;&#125;, propertyName: string, key: Key, respectConnection?: boolean): void;
createContext: typeof createContext;
inject(...dependencies: Key[]): (target: any, key?: string | number, descriptor?: PropertyDescriptor | number) => void;
transient<T extends Constructable<&#123;&#125;>>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
singleton<T_1 extends Constructable<&#123;&#125;>>(target: T_1 & Partial<RegisterSelf<T_1>>, options?: SingletonOptions): T_1 & RegisterSelf<T_1>;
&#125;>