import { Action, AnyAction, Middleware, Reducer, ReducersMapObject, Store } from "./index"; import { ReactApplicationConfig } from "../react-application-config"; import { IModel } from "../interfaces/model.interface"; import { IApplicationContext } from "@symph/core"; declare global { interface Window { __REDUX_DEVTOOLS_EXTENSION__: any; __REDUX_DEVTOOLS_EXTENSION__OPTIONS: any; } } export declare const ACTION_MERGE_STATE = "__MERGE_STATE"; export declare const ACTION_INIT_MODEL = "__INIT_MODEL"; export interface ModelStateChangeHandler { (changedModels: string[], nextState: Record, previousState: Record): boolean | undefined | void; } export interface ModelStateListener { listener: ModelStateChangeHandler; id: number; } export interface RegisteredModel { listeners?: Array; modelInstance: IModel; } interface ActionSetState extends Action { state: Record; } export declare class ReactReduxService { appConfig: ReactApplicationConfig; app: IApplicationContext; store: Store; models: { [namespace: string]: RegisteredModel; }; asyncReducers: ReducersMapObject; middlewares: Middleware[]; preState: Record; private stateListenerIdCounter; constructor(appConfig: ReactApplicationConfig, initState: Record); createStore({ reducers, initialState, middlewares }: any): Store, never, {}>; createReducer(): Reducer; rmModelStateListener(modelNameSpaces: string[], listener: ModelStateChangeHandler): number; addModelStateListener(modelNameSpaces: string[], listener: ModelStateChangeHandler): number; private storeStateListener; /** * 注册model */ registerModel(model: IModel, initState: unknown): IModel; dispatch(action: any): Promise | null | undefined; dispatchBatch(actions: AnyAction[]): Promise | null | undefined; private setStateHistories; private isStateRecording; startRecordState(): void; stopRecordState(): ActionSetState[]; } export {};