2019-09-07 04:23:15 +00:00
|
|
|
import "reflect-metadata";
|
2019-09-27 10:39:40 +00:00
|
|
|
import { initContainer } from './decorators'
|
2019-09-07 04:23:15 +00:00
|
|
|
import { interfaces, Container } from 'inversify';
|
|
|
|
import { fluentProvide } from 'inversify-binding-decorators';
|
|
|
|
|
|
|
|
const provideNamed = (identifier: interfaces.ServiceIdentifier<any>, name: string) => {
|
|
|
|
return fluentProvide(identifier).whenTargetNamed(name).done();
|
|
|
|
};
|
|
|
|
|
|
|
|
const provideSingleton = (identifier: interfaces.ServiceIdentifier<any>) => {
|
|
|
|
return fluentProvide(identifier).inSingletonScope().done();
|
|
|
|
};
|
|
|
|
|
|
|
|
const DefaultContainer = new Container();
|
2019-09-27 10:39:40 +00:00
|
|
|
initContainer(DefaultContainer);
|
2019-09-07 04:23:15 +00:00
|
|
|
|
|
|
|
export * from 'inversify'
|
|
|
|
export * from './decorators'
|
|
|
|
export * from 'inversify-binding-decorators'
|
|
|
|
export {
|
|
|
|
fluentProvide,
|
|
|
|
provideNamed,
|
|
|
|
provideSingleton,
|
|
|
|
DefaultContainer
|
|
|
|
};
|