From 7d45fad05d1395a6c2d04b6dffaa1e241d5d245d Mon Sep 17 00:00:00 2001 From: Tiago Rodrigues Date: Tue, 24 Sep 2019 18:04:26 +0200 Subject: [PATCH] Add toJSON property to AxiosError type 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> {