UNPKG

axios-camel-converter

Version:
34 lines (33 loc) 1.01 kB
import { AxiosStatic, AxiosInstance } from 'axios'; export interface InterceptorIds { /** * The interceptor id to eject the case converting of the request. * * @example * ```ts * axios.interceptors.request.eject(requestInterceptorId); * ``` */ requestInterceptorId: number; /** * The interceptor id to eject the case converting of the response. * * @example * ```ts * axios.interceptors.response.eject(responseInterceptorId); * ``` */ responseInterceptorId: number; } export interface Options { /** * Exclude keys from being snake-cased at request `params` and `data`. */ requestExcludeKeys?: ReadonlyArray<string | RegExp>; /** * Exclude keys from being camle-cased at response `data`. */ responseExcludeKeys?: ReadonlyArray<string | RegExp>; } declare const axiosCaseConverter: (axios: AxiosStatic | AxiosInstance, options?: Options) => InterceptorIds; export default axiosCaseConverter;