import { Payload, QueryParams } from './types.js'; /** * Does a GET request to the given url, with the query params if * they are provided. Then gives the result to the configured middleware * for processing. * * @example * ```js * get('/api/pokemon', { page: 1 }).then((json) => { * // Do something with the json here * }); * ``` * @export * @param {string} url The url you want to send a GET request to. * @param {QueryParams} queryParams Optional query params as an object. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function get(url: string, queryParams?: QueryParams): Promise; /** * Does a POST request to the given url, with the given payload. * Then gives the result to the configured middleware * for processing. * * @example * ```js * post('/api/pokemon', { name: "bulbasaur" }).then((json) => { * // Do something with the json here * }); * ``` * * @export * @param {string} url The url you want to send a POST request to. * @param {Payload} payload The payload you want to send to the server. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function post>(url: string, payload: D): Promise; /** * Does a PUT request to the given url, with the given payload. * Then gives the result to the configured middleware * for processing. * * @example * ```js * put('/api/pokemon/1', { id: 1, name: "bulbasaur" }).then((json) => { * // Do something with the json here * }); * ``` * * @export * @param {string} url The url you want to send a PUT request to. * @param {Payload} payload The payload you want to send to the server. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function put>(url: string, payload: D): Promise; /** * Does a PATCH request to the given url, with the given payload. * Then gives the result to the configured middleware * for processing. * * @example * ```js * patch('/api/pokemon/1', { id: 1, name: "bulbasaur" }).then((json) => { * // Do something with the json here * });; * ``` * * @export * @param {string} url The url you want to send a PATCH request to. * @param {Payload} payload The payload you want to send to the server. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function patch>(url: string, payload: D): Promise; /** * Does a DELETE request to the given url. * Then gives the result to the configured middleware * for processing. * * Note: this function is called 'remove' and not 'delete' because * delete is a keyword in JavaScript. * * @example * ```js * remove('/api/pokemon/1').then(() => { * // Do something here. * });; * ``` * * @export * @param {string} url The url you want to send a DELETE request to. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function remove(url: string): Promise; /** * Does a GET request to the given url, with the query params if * they are provided. Then causes the result file to be sent to * the browser as download. * * @example * ```js * downloadFile('/api/pokemon/pdf', { sort: 'id,asc' }); * ``` * @export * @param {string} url The url you want to send a GET request to. * @param {QueryParams} queryParams Optional query params as an object. * @returns {Promise} Returns a Promise, the content of the promise depends on the configured middleware. */ export declare function downloadFile(url: string, queryParams?: QueryParams): Promise;