import 'reflect-metadata'; import { Container, interfaces } from 'inversify'; import { MainAppWindow } from '../modules/app-window/main-app-window'; import { Logger } from '../modules/logger/logger'; import { NhentaiApi } from '../modules/nhentai/nhentai-api'; import '../modules/nhentai/nhentai-ipc-controller'; import { Session } from '../modules/session/session'; import { Store } from '../modules/store/store'; import { WebCrawler } from '../modules/web-crawler/web-crawler'; import BindingToSyntax = interfaces.BindingToSyntax; export const container = { original: new Container({ defaultScope: 'Singleton' }), bind(key: string): BindingToSyntax { return this.original.bind(Symbol.for(key)); }, unbind(key: string): void { return this.original.unbind(Symbol.for(key)); }, get(key: string): T { return this.original.get(Symbol.for(key)); }, }; container.bind('logger').to(Logger); container.bind('store').to(Store); container.bind('web-crawler').to(WebCrawler); container.bind('nhentai-api').to(NhentaiApi); container.bind('app-window-main').to(MainAppWindow); container.bind('session').to(Session);