feat: add command bean and event bean

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-09-10 17:21:00 +08:00
parent 05bf312076
commit eb6a2a32db
5 changed files with 137 additions and 136 deletions

View File

@ -1,7 +1,9 @@
import { PluginInfo } from './typings/plugin';
import { injectable } from "@ms/container";
export namespace command {
@injectable()
export abstract class Command {
on(plugin: PluginInfo, name: string, exec: { cmd: Function, tab?: Function }) {
on(plugin: any, name: string, exec: { cmd: Function, tab?: Function }) {
var cmd = this.create(plugin, { name: name });
console.debug(`插件 ${plugin.description.name} 创建命令 ${name}(${cmd})...`)
if (exec.cmd && typeof exec.cmd === "function") {