import { ContainerModule, interfaces } from 'inversify'; import { ServiceIdentifiers } from '../../ServiceIdentifiers'; import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode'; import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup'; import { IStorage } from '../../../interfaces/storages/IStorage'; 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['IStorage']) .to(CustomNodeGroupStorage) .inSingletonScope(); bind>(ServiceIdentifiers['IStorage']) .to(ControlFlowStorage); bind>(ServiceIdentifiers['IStorage']) .to(StringArrayStorage) .inSingletonScope(); // controlFlowStorage factory bind>(ServiceIdentifiers['Factory>']) .toFactory>((context: interfaces.Context) => { return () => { return context.container.get>(ServiceIdentifiers['IStorage']); }; }); });