ms/packages/plugin/src/interfaces.ts

56 lines
1.3 KiB
TypeScript
Raw Normal View History

import { injectable } from "@ms/container";
export namespace interfaces {
@injectable()
export abstract class Plugin {
public description: PluginMetadata;
public logger: Console;
public load() { }
public enable() { }
public disable() { }
}
interface BaseMetadata {
name?: string;
servers?: string[];
}
export interface PluginMetadata extends BaseMetadata {
/**
*
*/
name: string;
/**
*
*/
prefix?: string;
/**
*
*/
version: string;
/**
*
*/
author: string | string[];
/**
* __filename
*/
source: string;
/**
*
*/
target?: any;
}
interface ExecMetadata extends BaseMetadata {
executor?: string;
}
export interface CommandMetadata extends ExecMetadata {
paramtypes?: string[];
}
export interface TabCompleterMetadata extends ExecMetadata {
paramtypes?: string[];
}
export interface ListenerMetadata extends ExecMetadata {
}
export type PluginLike = Plugin | string;
}