diff --git a/packages/taxios/src/index.ts b/packages/taxios/src/index.ts index 13a1590..0822a5b 100644 --- a/packages/taxios/src/index.ts +++ b/packages/taxios/src/index.ts @@ -224,7 +224,9 @@ export class Taxios { ...args: InferredRequestArgs ): Promise> { const [url, axiosConfig] = this.prepare('GET', route, ...args); - return await this.axios.get(url, axiosConfig).then((response) => response.data); + return await this.axios + .get(url, axiosConfig) + .then((response) => response.data as Response); } async head>( @@ -240,7 +242,9 @@ export class Taxios { ...args: InferredRequestArgs ): Promise> { const [url, axiosConfig] = this.prepare('HEAD', route, ...args); - return await this.axios.head(url, axiosConfig).then((response) => response.data); + return await this.axios + .head(url, axiosConfig) + .then((response) => response.data as Response); } async post>( @@ -260,7 +264,9 @@ export class Taxios { const [body, config] = args; const prepareArgs = [config] as InferredUrlArgs; const [url, axiosConfig] = this.prepare('POST', route, ...prepareArgs); - return await this.axios.post(url, body, axiosConfig).then((response) => response.data); + return await this.axios + .post(url, body, axiosConfig) + .then((response) => response.data as Response); } async put>( @@ -280,7 +286,9 @@ export class Taxios { const [body, config] = args; const prepareArgs = [config] as InferredUrlArgs; const [url, axiosConfig] = this.prepare('PUT', route, ...prepareArgs); - return await this.axios.put(url, body, axiosConfig).then((response) => response.data); + return await this.axios + .put(url, body, axiosConfig) + .then((response) => response.data as Response); } async delete>( @@ -296,7 +304,9 @@ export class Taxios { ...args: InferredRequestArgs ): Promise> { const [url, axiosConfig] = this.prepare('DELETE', route, ...args); - return await this.axios.delete(url, axiosConfig).then((response) => response.data); + return await this.axios + .delete(url, axiosConfig) + .then((response) => response.data as Response); } async options>( @@ -312,7 +322,9 @@ export class Taxios { ...args: InferredRequestArgs ): Promise> { const [url, axiosConfig] = this.prepare('OPTIONS', route, ...args); - return await this.axios.options(url, axiosConfig).then((response) => response.data); + return await this.axios + .options(url, axiosConfig) + .then((response) => response.data as Response); } async patch>( @@ -332,6 +344,8 @@ export class Taxios { const [body, config] = args; const prepareArgs = [config] as InferredUrlArgs; const [url, axiosConfig] = this.prepare('PATCH', route, ...prepareArgs); - return await this.axios.patch(url, body, axiosConfig).then((response) => response.data); + return await this.axios + .patch(url, body, axiosConfig) + .then((response) => response.data as Response); } }