2019-11-04 12:28:52 +00:00
|
|
|
import { injectable } from "@ms/container";
|
2019-09-07 04:23:15 +00:00
|
|
|
|
|
|
|
export namespace interfaces {
|
|
|
|
@injectable()
|
|
|
|
export abstract class Plugin {
|
|
|
|
public description: PluginMetadata;
|
2019-09-10 09:22:00 +00:00
|
|
|
public logger: Console;
|
2019-09-07 04:23:15 +00:00
|
|
|
|
|
|
|
public load() { }
|
|
|
|
public enable() { }
|
|
|
|
public disable() { }
|
|
|
|
}
|
|
|
|
export interface PluginMetadata {
|
2019-09-22 10:02:28 +00:00
|
|
|
/**
|
|
|
|
* 插件名称
|
|
|
|
*/
|
2019-09-07 04:23:15 +00:00
|
|
|
name: string;
|
2019-09-22 10:02:28 +00:00
|
|
|
/**
|
|
|
|
* 前缀
|
|
|
|
*/
|
|
|
|
prefix?: string;
|
|
|
|
/**
|
|
|
|
* 插件版本
|
|
|
|
*/
|
2019-09-07 04:23:15 +00:00
|
|
|
version: string;
|
2019-09-22 10:02:28 +00:00
|
|
|
/**
|
|
|
|
* 插件版本
|
|
|
|
*/
|
2019-09-07 04:23:15 +00:00
|
|
|
author: string | string[];
|
2019-09-22 10:02:28 +00:00
|
|
|
/**
|
|
|
|
* 插件源文件 必须指定为 __filename
|
|
|
|
*/
|
2019-09-19 10:59:32 +00:00
|
|
|
source: string;
|
2019-09-22 10:02:28 +00:00
|
|
|
/**
|
|
|
|
* 插件本体
|
|
|
|
*/
|
2019-09-07 04:23:15 +00:00
|
|
|
target?: any;
|
|
|
|
}
|
2019-09-19 10:59:32 +00:00
|
|
|
export interface CommandMetadata {
|
|
|
|
name?: string;
|
|
|
|
executor?: string;
|
|
|
|
paramtypes?: string[];
|
|
|
|
}
|
|
|
|
export interface TabCompleterMetadata {
|
|
|
|
name?: string;
|
|
|
|
executor?: string;
|
|
|
|
paramtypes?: string[];
|
|
|
|
}
|
|
|
|
export interface ListenerMetadata {
|
|
|
|
name?: string;
|
|
|
|
executor?: string;
|
2019-09-21 07:05:37 +00:00
|
|
|
servertype?: string;
|
2019-09-19 10:59:32 +00:00
|
|
|
}
|
|
|
|
export type PluginLike = Plugin | string;
|
2019-09-07 04:23:15 +00:00
|
|
|
}
|