UNPKG

@magicbell/react-headless

Version:

Hooks to build a notification inbox

32 lines (31 loc) 1.24 kB
/** * Performs a GET request. * * @param url - the server URL that will be used for the request * @param params - the URL parameters to be sent with the request */ export declare function fetchAPI(url: string, params?: Record<string, unknown>): Promise<unknown>; /** * Performs a POST request. * * @param url - the server URL that will be used for the request * @param data - the data to be sent as the request body * @param params - the URL parameters to be sent with the request */ export declare function postAPI(url: string, data?: Record<string, unknown>, params?: Record<string, unknown>): Promise<unknown>; /** * Performs a DELETE request. * * @param url - the server URL that will be used for the request * @param params - the URL parameters to be sent with the request */ export declare function deleteAPI(url: string, params?: Record<string, unknown>): Promise<unknown>; /** * Performs a PUT request. * * @param url - the server URL that will be used for the request * @param data - the data to be sent as the request body * @param params - the URL parameters to be sent with the request * @returns - A promise. */ export declare function putAPI(url: string, data: Record<string, unknown>): Promise<unknown>;