///
import { ClientResponse } from './client';
export declare type PublicRequestState = Readonly<{
data: R | null;
loading: boolean;
isCalled: boolean;
}>;
export declare type RequestState = PublicRequestState & Readonly<{
prevHeaders?: Record;
prevVariables?: Record;
prevParams?: Record;
}>;
export declare type RequestAction = {
type: 'call';
headers: Record;
variables: Record;
params?: Record;
} | {
type: 'success';
response: ClientResponse;
} | {
type: 'failure';
response: ClientResponse;
};
export declare type RequestReducer = React.Reducer, RequestAction>;
export declare function requestReducer(state: RequestState, action: RequestAction): {
loading: boolean;
isCalled: boolean;
prevHeaders: Record;
prevVariables: Record;
prevParams: Record | undefined;
data: R | null;
} | {
loading: boolean;
data: R;
isCalled: boolean;
prevHeaders?: Record | undefined;
prevVariables?: Record | undefined;
prevParams?: Record | undefined;
} | {
loading: boolean;
data: null;
isCalled: boolean;
prevHeaders?: Record | undefined;
prevVariables?: Record | undefined;
prevParams?: Record | undefined;
};