sdg
Version:
pomelo ts
44 lines (43 loc) • 1.23 kB
TypeScript
import { ILifeCycle } from './ILifeCycle';
import { IComponent } from './IComponent';
import Application from '../application';
import Session from '../common/service/session/session';
export interface IComponentConstructor {
new (app: Application, opts?: any): IComponent;
}
export interface IApplicationEvent {
bindSession?: (session: Session) => void;
unbindSession?: (session: Session) => void;
closeSession?: (session: Session) => void;
startServer?: (serverId: string) => void;
startAll?: () => void;
}
export interface IApplicationEventConstructor {
new (app: Application, opts?: any): IApplicationEvent;
}
export interface IPlugin extends ILifeCycle {
/**
* 插件的名称
*/
name: string;
/**
* 启动插件时需要自动加载的组件
*/
components?: IComponentConstructor[];
/**
* 启动插件时需要侦听的应用程序事件
*/
events?: IApplicationEventConstructor[];
/**
* 插件暴漏的handler所在的路径
*/
handlerPath?: string;
/**
* 插件暴漏的remoter所在的路径
*/
remoterPath?: string;
/**
* 插件暴漏的crons所在的路径
*/
cronPath?: string;
}