diff --git a/.vscode/settings.json b/.vscode/settings.json index 968b589..3c344f8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,5 @@ "source.organizeImports": "explicit", "source.fixAll.eslint": "explicit" }, - "jest.autoRun": "off" + "jest.runMode": "deferred" } diff --git a/typings/index.d.ts b/typings/index.d.ts index f125fad..2ee0f75 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,5 +1,15 @@ import { AlovaRequestAdapter, Method } from 'alova'; -import { FetchRequestInit } from 'alova/GlobalFetch'; +import GlobalFetch from 'alova/GlobalFetch'; + +type FetchRequestInit = ReturnType extends AlovaRequestAdapter< + any, + any, + infer RequestConfig, + any, + any +> + ? RequestConfig + : never; interface MockServerRequest { headers: Record;