fetch-api-client
Version:
A TypeScript API client using fetch with axios-like interface
6 lines (5 loc) • 1.55 kB
TypeScript
export { ApiClient, createClient } from './client';
export type { HttpMethod, RequestConfig, ClientConfig, ApiResponse, ApiError, RequestInterceptor, ResponseInterceptor, InterceptorManager, QueryParams, } from './types';
export { RequestInterceptorManager, ResponseInterceptorManager } from './interceptors';
export declare const defaultClient: import("./client").ApiClient;
export declare const get: <T = any>(url: string, config?: Omit<import("./types").RequestConfig, "method" | "url">) => Promise<import("./types").ApiResponse<T>>, post: <T = any>(url: string, data?: any, config?: Omit<import("./types").RequestConfig, "method" | "url" | "data">) => Promise<import("./types").ApiResponse<T>>, put: <T = any>(url: string, data?: any, config?: Omit<import("./types").RequestConfig, "method" | "url" | "data">) => Promise<import("./types").ApiResponse<T>>, del: <T = any>(url: string, config?: Omit<import("./types").RequestConfig, "method" | "url">) => Promise<import("./types").ApiResponse<T>>, patch: <T = any>(url: string, data?: any, config?: Omit<import("./types").RequestConfig, "method" | "url" | "data">) => Promise<import("./types").ApiResponse<T>>, head: <T = any>(url: string, config?: Omit<import("./types").RequestConfig, "method" | "url">) => Promise<import("./types").ApiResponse<T>>, options: <T = any>(url: string, config?: Omit<import("./types").RequestConfig, "method" | "url">) => Promise<import("./types").ApiResponse<T>>, request: <T = any>(config: import("./types").RequestConfig) => Promise<import("./types").ApiResponse<T>>;