import type { AnyAction } from 'redux'; import type { ActionPattern } from 'redux-saga/effects'; export type RequestHandler = (requestAction: RequestAction, signal: AbortSignal) => any; export interface CancellableHandler { handlerArg: RequestAction; CANCEL: CancelActionType; handler: RequestHandler; onComplete?(...args: any[]): void; } export type RequestId = symbol | string | number; export interface TakeLatestRequest { REQUEST: ActionPattern; cancelTask(requestId: RequestId, action: AnyAction): CancelAction; requestIdSelector?(action: AnyAction): RequestId; } export interface TakeRequest { REQUEST: ActionPattern; CANCEL: ActionPattern; }