ms/packages/sponge/src/index.ts
2020-02-24 18:36:08 +08:00

21 lines
912 B
TypeScript

/// <reference types="@ms/types/dist/typings/sponge" />
import { server, command, event, channel, task } from '@ms/api'
import { Container } from '@ms/container'
import { SpongeConsole } from './console';
import { SpongeEvent } from './event';
import { SpongeServer } from './server';
import { SpongeCommand } from './command';
import { SpongeChannel } from './channel';
import { SpongeTaskManager } from './task';
export default function SpongeImpl(container: Container) {
container.bind(server.Console).toConstantValue(SpongeConsole);
container.bind(event.Event).to(SpongeEvent).inSingletonScope();
container.bind(server.Server).to(SpongeServer).inSingletonScope();
container.bind(command.Command).to(SpongeCommand).inSingletonScope();
container.bind(channel.Channel).to(SpongeChannel).inSingletonScope();
container.bind(task.TaskManager).to(SpongeTaskManager).inSingletonScope();
}