From 006b60425c68d8b60df7ae85407b26cf0832343d Mon Sep 17 00:00:00 2001 From: Tiago Rodrigues Date: Thu, 26 Sep 2019 14:11:34 +0200 Subject: [PATCH] Add toJSON property to AxiosError type (#2427) I noticed the error object has a `toJSON` method but when I tried to use it in my typescript code it complained it didn't exist, even though I was using the `AxiosError` type. --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index f934886659..8490672664 100644 --- a/index.d.ts +++ b/index.d.ts @@ -82,6 +82,7 @@ export interface AxiosError extends Error { request?: any; response?: AxiosResponse; isAxiosError: boolean; + toJSON: () => object; } export interface AxiosPromise extends Promise> {