import superagent from 'superagent'; import { MeemAPI } from '../generated/api.generated'; interface IMakeFetcher { method?: MeemAPI.HttpMethod; cleaner?: (res: superagent.Response) => any; headers?: () => any; } interface IBody { [key: string]: any; } export declare function makeFetcher({ method, headers, cleaner }: IMakeFetcher): (path: string, queryParams?: U, body?: V) => Promise; export interface IQueryParams { } export interface IPathParams { } export interface IRequestBody { } export interface IResponseBody { } export interface IEndpoint { pathParams?: IPathParams; queryParams?: IQueryParams; requestBody?: IRequestBody; responseBody?: IResponseBody; } export interface IError { status: 'failure'; code: string; reason: string; friendlyReason: string; } export declare function getError(e: any): IError; export declare function makeRequest( /** The URL path obtained from calling .path(). */ url: string, options?: { /** The Meem JWT. If not set will try to fetch from cookies */ jwt?: string; /** The base URL to use in the request */ baseUrl?: string; /** The HTTP method. GET by default */ method?: MeemAPI.HttpMethod; /** Headers to send with the request */ headers?: Record; /** Query parameters */ query?: TDefinition['queryParams']; /** Request body */ body?: TDefinition['requestBody']; }): Promise; export {};