import { AnyEndpoint, ExtractEndpointParams, ExtractEndpointResponse, ExtractEndpointVariables } from './endpoint'; import { PublicRequestState } from './reducer'; import { ClientResponse } from './client'; export interface LazyRequestConfig { readonly variables?: V; readonly params?: P; readonly headers?: Record; readonly onComplete?: (data: R) => unknown; readonly onFailure?: (res: ClientResponse) => unknown; } export declare type LazyRequestConfigFromEndpoint = LazyRequestConfig, ExtractEndpointVariables, ExtractEndpointParams>; export interface LazyRequestHandlerConfig extends LazyRequestConfigFromEndpoint { readonly force?: boolean; } export declare type RequestHandler = (config?: LazyRequestHandlerConfig) => Promise | null>; export interface PublicRequestStateWithActions extends PublicRequestState> { readonly refetch: () => void; readonly cancel: () => void; readonly clearStore: () => void; } export declare function useLazyRequest(endpoint: E, config?: LazyRequestConfigFromEndpoint): [RequestHandler, PublicRequestStateWithActions];