Skip to content

Commit

Permalink
Merge pull request #72 from qnighy/returns-promise
Browse files Browse the repository at this point in the history
Fix AxiosFetch type to return Promise
  • Loading branch information
mdlavin authored Jun 16, 2021
2 parents 01f95a6 + a024c11 commit 732e3d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export interface FetchInit extends Record<string, any> {

export type AxiosTransformer = (config: AxiosRequestConfig, input: string | undefined, init: FetchInit) => AxiosRequestConfig;

export type AxiosFetch = (input?: string, init?: FetchInit) => Response;
export type AxiosFetch = (input?: string, init?: FetchInit) => Promise<Response>;

/**
* A Fetch WebAPI implementation based on the Axios client
*/
async function axiosFetch (
axios: AxiosInstance,
// Convert the `fetch` style arguments into a Axios style config
transformer: AxiosTransformer,
transformer?: AxiosTransformer,
input?: string,
init: FetchInit = {}
) {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"esModuleInterop": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strict": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
Expand Down

0 comments on commit 732e3d5

Please sign in to comment.