import * as React from 'react'; import { WithChildrenProps } from '../types'; import { IWindowContext } from '../window/WindowContextProvider'; declare type HeaderEnricher = () => Promise; declare type PathEnricher = (path: string) => Promise; export declare type RequestEnricher = { header?: HeaderEnricher; path?: PathEnricher; }; export declare const Actions: { readonly get: "GET"; readonly post: "POST"; readonly put: "PUT"; readonly delete: "DELETE"; readonly patch: "PATCH"; }; declare type WithBodyAction = (path: P, body?: B) => Promise; export declare function createRequestViaWindow(windowContext: IWindowContext): Request; declare type FetchType = typeof fetch; declare type FetchProvider = () => FetchType; export declare function createRequest(fetchProvider: FetchProvider, enricher?: RequestEnricher): Request; export interface Request { post: WithBodyAction; put: WithBodyAction; delete: WithBodyAction; patch: WithBodyAction; get(path: P): Promise; } export declare const RequestContext: React.Context; export declare function useRequestContext(): Request; export declare function RequestContextProvider(props: WithChildrenProps): React.ReactElement; export {};