import { TWishedBean } from "./annotations"; import { FactoryBean } from "./factoryBean"; export interface IResolver { resolve(path: TWishedBean, bean: T): any[] | null; } export declare type TWishedBeanOrFactory = TWishedBean | FactoryBean; /** * The root interface for accessing a Spring bean container. * @remark https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/BeanFactory.html */ export interface IBeanFactory { /** * Retrieve instantiated bean fron context. * @param wishedBean - bean name or token to search. * @param required - throw exception if bean not found or not instantiated. * @param extraBeanPathMap - extends context search bean mapping. * @param debug - show beans names list to console. * @throws {Exception} - if bean is not exists or could not resolve name or token to bean comply with. */ getCachedBean(wishedBean: TWishedBeanOrFactory | T, required?: boolean, extraBeanPathMap?: Map, debug?: boolean): T | null; /** * Instantiate bean in context or retrieve it if exists. * @param wishedBean - bean name or token to search. * @param required - throw exception if bean not found or not instantiated. * @param extraBeanPathMap - extends context search bean mapping. * @param debug - show beans names list to console. * @throws {Exception} - when could not resolve name or token to bean comply with. */ getBean(wishedBean: TWishedBeanOrFactory | T, required?: boolean, extraBeanPathMap?: Map, debug?: boolean): Promise; /** * Map bean token to bean name or token or factory bean. * @param key - bean token. * @param value - bean name, token or factory bean. */ set(key: Symbol, value: TWishedBeanOrFactory): any; /** * Destroy specified bean without deleting from path map. * @param instance - bean. */ destroyBean(instance: any): void; }