///
import { ClientResponse } from './client';
export interface PublicRequestState {
readonly data: R | null;
readonly loading: boolean;
readonly isCalled: boolean;
readonly isCanceled?: boolean;
readonly response?: ClientResponse;
readonly fetchError?: Error;
}
export interface RequestState extends PublicRequestState {
readonly prevHeaders?: Record;
readonly prevVariables?: Record;
readonly prevParams?: Record;
}
export declare type RequestAction = {
type: 'call';
headers: Record;
variables: Record;
params?: Record;
} | {
type: 'success';
response: ClientResponse;
} | {
type: 'failure';
response: ClientResponse;
} | {
type: 'cancel';
} | {
type: 'clearStore';
};
export declare type RequestReducer = React.Reducer, RequestAction>;
export declare const INITIAL_REQUEST_STATE: RequestState;
export declare function requestReducer(state: RequestState, action: RequestAction): RequestState;