2020-02-08 23:26:57 +01:00
|
|
|
import 'reflect-metadata';
|
2020-08-08 18:23:29 +02:00
|
|
|
import { Container, interfaces } from 'inversify';
|
2020-02-08 23:26:57 +01:00
|
|
|
import { MainAppWindow } from '../modules/app-window/main-app-window';
|
2021-01-04 22:11:14 +01:00
|
|
|
import { Dialog } from '../modules/dialog/dialog';
|
2020-11-09 18:15:30 +01:00
|
|
|
import { I18nTranslator } from '../modules/i18n/i18n-translator';
|
2020-08-05 22:48:00 +02:00
|
|
|
import { Logger } from '../modules/logger/logger';
|
2020-02-08 23:26:57 +01:00
|
|
|
import { NhentaiApi } from '../modules/nhentai/nhentai-api';
|
2020-07-25 02:02:37 +02:00
|
|
|
import '../modules/nhentai/nhentai-ipc-controller';
|
2020-11-09 18:15:30 +01:00
|
|
|
import { NhentaiAppWindow } from '../modules/nhentai/nhentai-app-window';
|
2021-01-07 04:51:07 +01:00
|
|
|
import { NhentaiSourceGetter } from '../modules/nhentai/nhentai-source-getter';
|
2020-07-25 02:02:37 +02:00
|
|
|
import { Store } from '../modules/store/store';
|
2021-01-24 19:11:45 +01:00
|
|
|
import '../modules/entity-api/entity-api-ipc-controller';
|
2020-08-08 18:23:29 +02:00
|
|
|
import BindingToSyntax = interfaces.BindingToSyntax;
|
2020-02-08 23:26:57 +01:00
|
|
|
|
2020-08-08 18:23:29 +02:00
|
|
|
export const container = {
|
2020-11-09 18:15:30 +01:00
|
|
|
original: new Container({ defaultScope: 'Singleton', skipBaseClassChecks: true }),
|
2020-08-08 18:23:29 +02:00
|
|
|
bind<T>(key: string): BindingToSyntax<T> {
|
|
|
|
return this.original.bind<T>(Symbol.for(key));
|
|
|
|
},
|
|
|
|
unbind(key: string): void {
|
|
|
|
return this.original.unbind(Symbol.for(key));
|
|
|
|
},
|
|
|
|
get<T>(key: string): T {
|
|
|
|
return this.original.get<T>(Symbol.for(key));
|
|
|
|
},
|
|
|
|
};
|
2020-02-08 23:26:57 +01:00
|
|
|
|
2020-10-31 15:24:50 +01:00
|
|
|
container.bind('logger').to(Logger);
|
|
|
|
|
2020-11-09 18:15:30 +01:00
|
|
|
container.bind('i18n-translator').to(I18nTranslator);
|
|
|
|
|
2021-01-04 22:11:14 +01:00
|
|
|
container.bind('dialog').to(Dialog);
|
|
|
|
|
2020-08-08 18:23:29 +02:00
|
|
|
container.bind('store').to(Store);
|
2020-07-25 02:02:37 +02:00
|
|
|
|
2020-11-09 18:15:30 +01:00
|
|
|
container.bind('nhentai-app-window').to(NhentaiAppWindow);
|
2021-01-07 04:51:07 +01:00
|
|
|
container.bind('nhentai-api').to(NhentaiApi);
|
|
|
|
container.bind('nhentai-source-getter').to(NhentaiSourceGetter);
|
2020-02-08 23:26:57 +01:00
|
|
|
|
2020-08-08 18:23:29 +02:00
|
|
|
container.bind('app-window-main').to(MainAppWindow);
|