import type { Reducer, Middleware } from 'redux'; import type { Saga, Task } from 'redux-saga'; import type { QueryState } from './slice'; import { ForkEffectDescriptor } from 'redux-saga/effects'; import { CombinatorEffect, SimpleEffect } from '@redux-saga/types'; /** * A fault tolerant saga. */ export declare function sagaCreator(sagas: { [key: string]: (...args: any[]) => any; }, onError?: (err: Error) => any): (...options: any[]) => Generator>>, void, unknown>; export interface PrepareStore { reducer: Reducer; middleware: Middleware[]; run: (...args: any[]) => Task; } interface Props { reducers: { [key in keyof S]: Reducer; }; sagas: { [key: string]: Saga; }; onError?: (err: Error) => void; } /** * This will setup `redux-batched-actions` to work with `redux-saga`. * It will also add some reducers to your `redux` store for decoupled loaders * and a simple data cache. * * @example * ```ts * import { prepareStore } from 'saga-query'; * import { configureStore } from '@reduxjs/toolkit'; * * const { middleware, reducer, run } = prepareStore({ * reducers: { users: (state, action) => state }, * sagas: { api: api.saga() }, * onError: (err) => console.error(err), * }); * * const store = configureStore({ * reducer, * middleware, * }); * * // you must call `.run(...args: any[])` in order for the sagas to bootup. * run(); * ``` */ export declare function prepareStore({ reducers, sagas, onError, }: Props): PrepareStore; export {};