import IMediator from "./IMediator";
/**
 * @author Raykid
 * @email initial_r@qq.com
 * @create date 2018-01-30
 * @modify date 2018-01-30
 *
 * 该接口规定了中介者具有的模块部分功能
*/
export declare enum ModuleOpenStatus {
    Stop = 0,
    BeforeOpen = 1,
    AfterOpen = 2
}
export default interface IMediatorModulePart<S = any> {
    /**
     * 获取模块名
     *
     * @type {string}
     * @memberof IMediatorModulePart
     */
    readonly moduleName: string;
    /**
     * 模块打开结果回调函数，由moduleManager调用，不要手动调用
     *
     * @memberof IMediatorModulePart<S>
     */
    moduleOpenHandler: (status: ModuleOpenStatus, err?: Error) => void;
    /**
     * 其他模块被关闭回到当前模块时调用
     *
     * @param {(IMediator<S>|undefined)} from 从哪个模块回到当前模块
     * @param {*} [data] 可能的参数传递
     * @memberof IMediatorModulePart<S>
     */
    wakeUp(from: IMediator<S> | undefined, data?: any): void;
    /**
     * 模块切换到前台时调用（与wakeUp的区别是open时activate会触发，但wakeUp不会）
     *
     * @param {(IMediator<S>|undefined)} from 从哪个模块来到当前模块
     * @param {*} [data] 可能的参数传递
     * @memberof IMediatorModulePart<S>
     */
    activate(from: IMediator<S> | undefined, data?: any): void;
    /**
     * 模块切换到后台时调用（close之后或者其他模块打开时）
     *
     * @param {(IMediator<S>|undefined)} to 将要去往哪个模块
     * @param {*} [data] 可能的参数传递
     * @memberof IMediatorModulePart<S>
     */
    deactivate(to: IMediator<S> | undefined, data?: any): void;
}
