UNPKG

1.83 kBTypeScriptView Raw
1import type { Dispatch, AnyAction } from 'redux';
2import type { ThunkDispatch } from 'redux-thunk';
3import type { ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, TypedAddListener, TypedCreateListenerEntry, ListenerEntry, TypedRemoveListener } from './types';
4export { TaskAbortError } from './exceptions';
5export type { ListenerEffect, ListenerMiddleware, ListenerEffectAPI, ListenerMiddlewareInstance, CreateListenerMiddlewareOptions, ListenerErrorHandler, TypedStartListening, TypedAddListener, TypedStopListening, TypedRemoveListener, UnsubscribeListener, UnsubscribeListenerOptions, ForkedTaskExecutor, ForkedTask, ForkedTaskAPI, AsyncTaskExecutor, SyncTaskExecutor, TaskCancelled, TaskRejected, TaskResolved, TaskResult, } from './types';
6/** Accepts the possible options for creating a listener, and returns a formatted listener entry */
7export declare const createListenerEntry: TypedCreateListenerEntry<unknown>;
8/**
9 * @public
10 */
11export declare const addListener: TypedAddListener<unknown, ThunkDispatch<unknown, unknown, AnyAction>, unknown, ListenerEntry<unknown, ThunkDispatch<unknown, unknown, AnyAction>>, "listenerMiddleware/add">;
12/**
13 * @public
14 */
15export declare const clearAllListeners: import("../createAction").ActionCreatorWithoutPayload<string>;
16/**
17 * @public
18 */
19export declare const removeListener: TypedRemoveListener<unknown, ThunkDispatch<unknown, unknown, AnyAction>, ListenerEntry<unknown, ThunkDispatch<unknown, unknown, AnyAction>>, "listenerMiddleware/remove">;
20/**
21 * @public
22 */
23export declare function createListenerMiddleware<S = unknown, D extends Dispatch<AnyAction> = ThunkDispatch<S, unknown, AnyAction>, ExtraArgument = unknown>(middlewareOptions?: CreateListenerMiddlewareOptions<ExtraArgument>): ListenerMiddlewareInstance<S, D, ExtraArgument>;