query-harbor
Version:
A React Query utility package for efficient data fetching and caching
22 lines • 724 B
TypeScript
import { AxiosResponse } from 'axios';
type ApiAction = "GET" | "POST" | "PUT" | "DELETE";
interface ApiRequestParams {
action: ApiAction;
url: string;
data?: Record<string, any>;
headers?: any;
baseURL?: string;
}
interface ApiResponse<T = any> {
status: boolean;
data?: T;
message?: string;
error?: string;
type?: string;
statusCode?: number;
errorType?: string;
}
export declare const ActionHandler: ({ action, url, data, headers, baseURL }: ApiRequestParams) => Promise<AxiosResponse<any>>;
export declare const APIHandler: <T = any>({ action, url, data, headers, baseURL }: ApiRequestParams) => Promise<ApiResponse<T>>;
export {};
//# sourceMappingURL=apiHandler.d.ts.map