import Client from "./index.js"; import { BlinkClientOptions } from "../interfaces/index.js"; declare class BlinkClient extends Client { constructor(options?: BlinkClientOptions); /** * Sends a GET request. * @param {string} url - The URL to send the request to. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.get('/posts/1'); * console.log(response.json()); * { * userId: 1, * id: 1, * title: '...', * body: '...' * } * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.get('/posts/1'); * console.log(response); * } catch (error) { * console.error(error); * } */ get(url: string, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a DELETE request. * @param {string} url - The URL to send the request to. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.delete('/posts/1'); * console.log(response.json()); * { * userId: 1, * id: 1, * title: '...', * body: '...' * } * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.delete('/posts/1'); * console.log(response); * } catch (error) { * console.error(error); * } */ delete(url: string, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a POST request. * @param {string} url - The URL to send the request to. * @param {any} body - The body of the request. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.post('/posts', { title: 'foo', body: 'bar', userId: 1 }); * console.log(response.json()); * { * userId: 1, * id: 101, * title: 'foo', * body: 'bar' * } * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.post('/posts', { title: 'foo', body: 'bar', userId: 1 }); * console.log(response); * } catch (error) { * console.error(error); * } */ post(url: string, body: any, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a PUT request. * @param {string} url - The URL to send the request to. * @param {any} body - The body of the request. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.put('/posts/1', { id: 1, title: 'foo', body: 'bar', userId: 1 }); * console.log(response.json()); * { * userId: 1, * id: 1, * title: 'foo', * body: 'bar' * } * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.put('/posts/1', { id: 1, title: 'foo', body: 'bar', userId: 1 }); * console.log(response); * } catch (error) { * console.error(error); * } */ put(url: string, body: any, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a PATCH request. * @param {string} url - The URL to send the request to. * @param {any} body - The body of the request. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.patch('/posts/1', { title: 'foo' }); * console.log(response.json()); * { * userId: 1, * id: 1, * title: 'foo', * body: 'bar' * } * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.patch('/posts/1', { title: 'foo' }); * console.log(response); * } catch (error) { * console.error(error); * } */ patch(url: string, body: any, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a HEAD request. * @param {string} url - The URL to send the request to. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.head('/posts/1'); * console.log(response.headers); * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.head('/posts/1'); * console.log(response); * } catch (error) { * console.error(error); * } */ head(url: string, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends an OPTIONS request. * @param {string} url - The URL to send the request to. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.options('/posts/1'); * console.log(response.headers); * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.options('/posts/1'); * console.log(response); * } catch (error) { * console.error(error); * } */ options(url: string, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; /** * Sends a TRACE request. * @param {string} url - The URL to send the request to. * @param {Omit} [options=DEFAULT_OPTIONS] - The options for the request. * @param {Record} [queryParams=DEFAULT_QUERY_PARAMS] - The query parameters to append to the URL. * @param {(event: ProgressEvent) => void} [onProgress] - The progress event handler. * @returns {Promise} The response from the server. * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * const response = await blink.trace('/posts/1'); * console.log(response.headers); * @example * import { BlinkClient } from 'blink-http'; * * const blink = new BlinkClient({ baseURL: 'https://jsonplaceholder.typicode.com', timeout: 2000 }); * * try { * const response = await blink.trace('/posts/1'); * console.log(response); * } catch (error) { * console.error(error); * } */ trace(url: string, options?: Omit, queryParams?: Record, onProgress?: (event: ProgressEvent) => void): Promise; } export { BlinkClient }; //# sourceMappingURL=blink.d.ts.map