/** * CreatorConnection * @author idler.zhu * @description To connect the defined SagaActionCreators and plugins */ import { ForkEffect } from 'redux-saga/effects'; import { IArgsAction, IDefinitionObjectWithModule, IEffect, ITakeType } from '../typings/creator'; import { IOptions, IPluginsInstance, IReducersRecord, IDefinitionsRecord, IDefinitionClassesRecord, IPluginDefinitions, IPluginsInstanceRecord, IGetSagaWrapperOptions } from '../typings/connection'; declare class CreatorConnection, DC extends IDefinitionClassesRecord, P extends IPluginDefinitions, RR extends IReducersRecord> { protected readonly takeType: ITakeType; protected readonly plugins: IPluginsInstance; protected readonly wrappedEffects: ForkEffect[]; protected readonly combinedPluginReducers: RR; /** * class constructor * @param options {IOptions} */ constructor(options: IOptions); /** * getReducers * @description Return plugins called getReducer */ getReducers(): RR; /** * getEffects * @description Return the combined saga-effects */ getEffects(): ForkEffect[]; /** * makePlugins * @param plugins {IPluginDefinitions} * @param creators {IDefinitionClassesRecord} * @description Auto make plugin instance and inject the creators */ protected makePlugins(plugins: P, creators: DC): { record: IPluginsInstanceRecord; instances: IPluginsInstance; }; /** * combinePluginReducers * @param plugins {IPluginsInstanceRecord} * @description Combine called getReducer from plugins */ protected combinePluginReducers(plugins: IPluginsInstanceRecord): RR; /** * wrapEffects * @param creators {IDefinitionClassesRecord} * @description Create effects from the configuration */ protected wrapEffects(creators: DC): ForkEffect[]; /** * callBefore * @param record {IDefinitionObjectWithModule} * @description Called before hooks from the plugins */ protected callBefore(record: IDefinitionObjectWithModule): Generator, void, unknown>; /** * callAfter * @param record {IDefinitionObjectWithModule} * @param effectValue {any} * @description Called after hooks from the plugins */ protected callAfter(record: IDefinitionObjectWithModule, effectValue: any): Generator, void, unknown>; /** * errorHandling * @param record {IDefinitionObjectWithModule} * @param error {Error} * @description Called error handling from the plugins */ protected errorHandling(record: IDefinitionObjectWithModule, error: Error): Generator, void, unknown>; /** * getSagaWrapper * @param handle {IEffect} * @param record {IDefinitionObjectWithModule} * @param options {IGetSagaWrapperOptions} * @description Return a calling the hooks and effect function */ protected getSagaWrapper(handle: IEffect, record: IDefinitionObjectWithModule, options?: IGetSagaWrapperOptions): (action: IArgsAction) => Generator; /** * makeWrappedEffect * @param wrappedSaga {} */ protected makeWrappedEffect(wrappedSaga: (action: IArgsAction) => Generator): (...args: any[]) => Generator; } export default CreatorConnection;