import { ContainerModule, interfaces } from 'inversify'; import { ServiceIdentifiers } from '../../ServiceIdentifiers'; import { TControlFlowStorage } from '../../../types/storages/TControlFlowStorage'; import { TCustomNodeGroupStorage } from '../../../types/storages/TCustomNodeGroupStorage'; import { TStringArrayStorage } from '../../../types/storages/TStringArrayStorage'; import { ControlFlowStorage } from '../../../storages/control-flow/ControlFlowStorage'; import { CustomNodeGroupStorage } from '../../../storages/custom-node-group/CustomNodeGroupStorage'; import { StringArrayStorage } from '../../../storages/string-array/StringArrayStorage'; export const storagesModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => { // storages bind(ServiceIdentifiers.TCustomNodeGroupStorage) .to(CustomNodeGroupStorage) .inSingletonScope(); bind(ServiceIdentifiers.TStringArrayStorage) .to(StringArrayStorage) .inSingletonScope(); bind>(ServiceIdentifiers.Newable__TControlFlowStorage) .toConstructor(ControlFlowStorage); // controlFlowStorage factory bind(ServiceIdentifiers.Factory__TControlFlowStorage) .toFactory((context: interfaces.Context) => { return () => { const constructor: interfaces.Newable = context.container .get>(ServiceIdentifiers.Newable__TControlFlowStorage); return new constructor(); }; }); });