Skip to content

Commit

Permalink
Merge pull request #14 from alovajs/release/v1.5.x
Browse files Browse the repository at this point in the history
fix: redefine the FetchRequestInit in index.d.ts instead of import
  • Loading branch information
JOU-amjs authored Jun 21, 2024
2 parents dd65436 + ed04a81 commit 690b48f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit"
},
"jest.autoRun": "off"
"jest.runMode": "deferred"
}
12 changes: 11 additions & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import { AlovaRequestAdapter, Method } from 'alova';
import { FetchRequestInit } from 'alova/GlobalFetch';
import GlobalFetch from 'alova/GlobalFetch';

type FetchRequestInit = ReturnType<typeof GlobalFetch> extends AlovaRequestAdapter<
any,
any,
infer RequestConfig,
any,
any
>
? RequestConfig
: never;

interface MockServerRequest {
headers: Record<string, any>;
Expand Down

0 comments on commit 690b48f

Please sign in to comment.