Skip to content

Commit

Permalink
fix: allow multiple type for ApiReponse in typescript (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elvinra authored and ryanlntn committed Jun 25, 2019
1 parent af82be4 commit 20cf9f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apisauce.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface ApiOkResponse<T> {
config?: AxiosRequestConfig;
duration?: number;
}
export type ApiResponse<T> = ApiErrorResponse<T> | ApiOkResponse<T>;
export type ApiResponse<T, U = T> = ApiErrorResponse<U> | ApiOkResponse<T>;

export type Monitor = (response: ApiResponse<any>) => void;
export type RequestTransform = (request: AxiosRequestConfig) => void;
Expand Down Expand Up @@ -95,7 +95,7 @@ export interface ApisauceInstance {
unlink: <T>(url: string, params?: {}, axiosConfig?: AxiosRequestConfig) => Promise<ApiResponse<T>>;
}

export function isCancel(value: any): boolean;
export function isCancel(value: any): boolean;

export const CancelToken: CancelTokenStatic;

Expand Down

0 comments on commit 20cf9f4

Please sign in to comment.