From fbb29e07cc22dfe45919d9499c0ea43326a35579 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 7 Mar 2018 22:13:02 -0800 Subject: [PATCH 1/2] Fixing missing type parameters on delete/head --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 403fd1a..0ebd3f0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -110,8 +110,8 @@ export interface AxiosInstance { }; request(config: AxiosRequestConfig): AxiosPromise; get(url: string, config?: AxiosRequestConfig): AxiosPromise; - delete(url: string, config?: AxiosRequestConfig): AxiosPromise; - head(url: string, config?: AxiosRequestConfig): AxiosPromise; + delete(url: string, config?: AxiosRequestConfig): AxiosPromise; + head(url: string, config?: AxiosRequestConfig): AxiosPromise; post(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; put(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; patch(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; From f9373e96f29baebd90dd89aa3a0cd35fc918f27b Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 7 Mar 2018 22:17:44 -0800 Subject: [PATCH 2/2] Added tests for additional type parameters --- test/typescript/axios.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/typescript/axios.ts b/test/typescript/axios.ts index 5afadd9..eb6e3fe 100644 --- a/test/typescript/axios.ts +++ b/test/typescript/axios.ts @@ -120,6 +120,14 @@ axios.get('/user', { params: { id: 12345 } }) .then(handleUserResponse) .catch(handleError); +axios.head('/user') + .then(handleResponse) + .catch(handleError); + +axios.delete('/user') + .then(handleResponse) + .catch(handleError); + axios.post('/user', { foo: 'bar' }) .then(handleUserResponse) .catch(handleError);