import { BeanDefinition } from './BeanDefinition' ; export interface export interface IBeanFactory { createBean < T > ( beanDefinition ) : T ; destroyBean < T > ( beanDefinition , bean ) : void ; } /**
 * the default `BeanFactory` by the class `new` constructor.
 */ export class DefaultBeanFactory implements IBeanFactory { createBean < T > ( beanDefinition ) { if ( beanDefinition . isFactoryBean ) { const factory = beanDefinition . getFactory ( ) ; return factory ! ( beanDefinition . props ) ; } else { return new beanDefinition . beanType ( beanDefinition . props ) ; } } destroyBean ( ) { } }