axios-light-my-request-adapter
Version:
Axios adapter for Light my Request
20 lines (19 loc) • 954 B
TypeScript
import { AxiosResponse } from "axios";
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
* @returns {string} The combined full path
*/
export declare function buildFullPath(baseURL: string | undefined, requestedURL: string): string;
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
export declare function settle<T>(resolve: (value: AxiosResponse<T> | PromiseLike<AxiosResponse<T>>) => void, reject: (reason?: unknown) => void, response: AxiosResponse): void;