@altostra/core
Version:
Core library for shared types and logic
10 lines (9 loc) • 538 B
TypeScript
import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
export declare function isAxiosError(err: unknown): err is AxiosError;
/**
* Return the response data, if `err` is axios error (without checking what it is)
* @param err Any thrown error
*/
export declare function axiosSerializedError(err: any): unknown;
export declare function axiosResponse<T>(config: AxiosRequestConfig, data: T, status?: number, statusText?: string): AxiosResponse<T>;
export declare function jsonableAxiosError(err: AxiosError): object;