UNPKG

@js-smart/react-kit

Version:
13 lines (12 loc) 522 B
/** * Tiny fetch wrapper for making HTTP requests with TypeScript support. * @template T - The expected response type. * @param {string} url - The URL to request. * @param {RequestInit} [options] - Options for the fetch request. * @returns {Promise<T>} - A promise that resolves to the JSON response of type T. * @throws {Error} - Throws an isError if the response is not OK. * * @author Pavan Kumar Jadda * @since 1.0.3 */ export declare function fetchClient<T>(url: string, options?: RequestInit): Promise<T>;