Skip to content

Commit 4797cdb

Browse files
committed
refactor: enhance Axios type definitions in BaseAPI and OAuth2Configuration
1 parent 24e88a0 commit 4797cdb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/versions/v1/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import type { Configuration } from './configuration';
1717
// Some imports not used depending on template conditions
1818
// @ts-ignore
19-
import type { AxiosError, AxiosResponse, AxiosRequestConfig , InternalAxiosRequestConfig } from 'axios';
19+
import type { AxiosError, AxiosResponse, AxiosRequestConfig , InternalAxiosRequestConfig, AxiosInstance } from 'axios';
2020
import axios from 'axios';
2121
import { join, dirname } from 'path';
2222
import { existsSync } from 'fs';
@@ -95,7 +95,7 @@ export const errorInterceptor = (error: AxiosError) => {
9595
export class BaseAPI {
9696
protected configuration: Configuration | undefined;
9797
protected basePath: string = BASE_PATH;
98-
protected axios = axios.create();
98+
protected axios: AxiosInstance = axios.create();
9999
constructor(configuration: Configuration) {
100100
if (configuration) {
101101
this.configuration = configuration;

src/versions/v1/configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515

16-
import axios from "axios";
16+
import axios, { AxiosResponse } from "axios";
1717
import { stringify } from "qs";
1818
import { errorInterceptor, responseInterceptor, versionInterceptor } from './base';
1919

@@ -186,7 +186,7 @@ export class OAuth2Configuration {
186186
* Revoke Refresh Token aka marking an app uninstalled or revoke the Access Token.
187187
* @param {String} tokenTypeHint values can be: 'access_token' or 'refresh_token'.
188188
*/
189-
public async revokeToken(tokenTypeHint?: 'access_token' | 'refresh_token') {
189+
public async revokeToken(tokenTypeHint?: 'access_token' | 'refresh_token'): Promise<AxiosResponse<any, any>> {
190190

191191
const token = tokenTypeHint === 'refresh_token'
192192
? this.refreshToken : encodeURIComponent(this.accessToken);

0 commit comments

Comments
 (0)