feat: move type bind and export impl function

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-02-01 02:46:06 +08:00
parent 606bbb3991
commit b793ec192f
4 changed files with 45 additions and 49 deletions

View File

@ -1,7 +1,7 @@
/// <reference types="@ms/types/dist/typings/bungee" />
import { server, plugin, command, event, task } from '@ms/api'
import { DefaultContainer as container } from '@ms/container'
import { server, command, event, task } from '@ms/api'
import { Container } from '@ms/container'
import { BungeeConsole } from './console';
import { BungeeEvent } from './event';
@ -9,12 +9,10 @@ import { BungeeServer } from './server';
import { BungeeCommand } from './command';
import { BungeeTaskManager } from './task';
let BungeeServerType = 'bungee';
container.bind(server.Console).toConstantValue(BungeeConsole);
container.bind(server.ServerType).toConstantValue(BungeeServerType);
container.bind(event.Event).to(BungeeEvent).inSingletonScope();
container.bind(server.Server).to(BungeeServer).inSingletonScope();
container.bind(command.Command).to(BungeeCommand).inSingletonScope();
container.bind(task.TaskManager).to(BungeeTaskManager).inSingletonScope();
export default function BungeeImpl(container: Container) {
container.bind(server.Console).toConstantValue(BungeeConsole);
container.bind(event.Event).to(BungeeEvent).inSingletonScope();
container.bind(server.Server).to(BungeeServer).inSingletonScope();
container.bind(command.Command).to(BungeeCommand).inSingletonScope();
container.bind(task.TaskManager).to(BungeeTaskManager).inSingletonScope();
}