/** * AbstractPlugin * @author idler.zhu * @description Abstract plugin classes for write plugins to extends */ import { IDefinitionClassesRecord, IDefinitionObjectWithModule, IDefinitionsRecord } from '..'; import { Reducer } from 'redux'; declare class AbstractPlugin, DC extends IDefinitionClassesRecord> { creators: DC; /** * class constructor * @param creators {IDefinitionClassesRecord} * @description Auto add creators to plugins context */ constructor(creators: DC); /** * getReducer * @description Return a plugin reducer to combine to the store * Notes: If you need to use this reducer state from store * You can mark you state to the function return type */ getReducer(): Reducer; /** * beforeEffect * @param record {IDefinitionObjectWithModule} * @description Before effect running hooks, * You can receive the running definition record from the params */ beforeEffect(record: IDefinitionObjectWithModule): Generator; /** * afterEffect * @param record {IDefinitionObjectWithModule} * @param effectValue {any} * @description After effect running hooks, * You can receive the running definition record from the params */ afterEffect(record: IDefinitionObjectWithModule, effectValue?: any): Generator; /** * errorHandle * @param error {Error} * @param record {IDefinitionObjectWithModule} * @return {Generator} * @description Catch the effects thrown errors * If you are implemented the errorCatcher hooks, * You should return true to told we should not continue throw error */ errorHandle(error: Error, record: IDefinitionObjectWithModule): Generator; } export default AbstractPlugin;