UNPKG

@ccms/api

Version:

MiaoScript api package

30 lines 1.45 kB
import { plugin } from './plugin'; export declare namespace command { abstract class Command { /** * 注册插件命令 * @param plugin 插件 * @param name 命令 * @param exec 执行器 */ on(plugin: plugin.Plugin, name: string, exec: { cmd: Function; tab?: Function; }): void; tabComplete(sender: any, input: string, index?: number): string[]; /** * 取消命令注册 * @param plugin 插件 * @param name 命令 */ off(plugin: plugin.Plugin, name: string): void; protected abstract create(plugin: plugin.Plugin, command: string): any; protected abstract remove(plugin: plugin.Plugin, command: string): void; protected abstract onCommand(plugin: plugin.Plugin, command: any, executor: Function): any; protected abstract onTabComplete(plugin: plugin.Plugin, command: any, tabCompleter: Function): any; protected setExecutor(plugin: plugin.Plugin, command: any, executor: Function): (sender: any, _: any, command: string, args: string[]) => any; protected setTabCompleter(plugin: plugin.Plugin, command: any, tabCompleter: Function): (sender: any, _: any, command: string, args: string[]) => string[]; protected copyPartialMatches(complete: string[], token: string, array?: string[]): string[]; } } //# sourceMappingURL=command.d.ts.map