import { Bloc } from "../libs/@felangel/bloc/bloc"; import { Store } from './store'; import { CommonActionMap, MethodMap, Action } from './action'; import { Entity } from './entity'; export declare abstract class Reducer extends Bloc { _reducerId: string; abstract _name: string; defaultMapper: { actionMap: typeof CommonActionMap; methodMap: MethodMap; }; private _store; private _servicesMap; addService(service: any): void; private _actionTypeList; private _defaultInitialState; private _initialState; /** * * @param initialState * Like usual Reducer * @param actionTypeList * Make a actionTypeList that all action you need to handle. * It'll addTopic in Broker and subscribe it, when store is set. */ constructor(initialState: any, actionMap: object); initialHandler: (mode?: 'test' | 'prod') => void; get store(): Store; get actionTypeList(): string[]; setStore(store: Store): void; defaultActionState(action: Action): state; private _entityClass; setEntity(entityClass: any): void; createEntity: (data: object) => Entity; createEntities: (dataList: any[]) => Entity[]; turnStateToEntities(): state; initial: () => string; addOne: (entity: any) => string; addMany: (entities: any[]) => string; setOne: (entity: any) => string; setMany: (entities: any[]) => string; setAll: (entities: any[]) => string; removeOne: (id: string) => string; removeMany: (ids: string[]) => string; removeAll: () => string; updateOne: (entity: any) => string; updateMany: (entities: any[]) => string; upsertOne: (entity: any) => string; upsertMany: (entities: any[]) => string; private handleEntityMethods; /** * * @param parameter * @returns * * For example: * select Group.id in Department.groupId * DepartmentReducer.selectRelevanceEntity( {key: "groupId", value: "group-1"} ) */ selectRelevanceEntity: (parameter: { key: string; value: string; }) => any[]; getPureData(): state; subscribeTopic: (actionTypeList: string[]) => void; dispatch(action: action): void; }