From 086181d7d7f263e734daacd352d1d471108b2f52 Mon Sep 17 00:00:00 2001 From: Maurice <1245183029@qq.com> Date: Thu, 7 Mar 2024 11:19:05 +0800 Subject: [PATCH] Fix custom fetch type --- .changeset/gorgeous-planes-rhyme.md | 5 +++++ packages/openapi-fetch/src/index.d.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/gorgeous-planes-rhyme.md diff --git a/.changeset/gorgeous-planes-rhyme.md b/.changeset/gorgeous-planes-rhyme.md new file mode 100644 index 000000000..5ece1b05e --- /dev/null +++ b/.changeset/gorgeous-planes-rhyme.md @@ -0,0 +1,5 @@ +--- +"openapi-fetch": patch +--- + +Fix the custom fetch type diff --git a/packages/openapi-fetch/src/index.d.ts b/packages/openapi-fetch/src/index.d.ts index 3d7b70c99..b448cb58e 100644 --- a/packages/openapi-fetch/src/index.d.ts +++ b/packages/openapi-fetch/src/index.d.ts @@ -19,7 +19,7 @@ export interface ClientOptions extends Omit { /** set the common root URL for all API requests */ baseUrl?: string; /** custom fetch (defaults to globalThis.fetch) */ - fetch?: typeof fetch; + fetch?: (request: Request) => ReturnType; /** global querySerializer */ querySerializer?: QuerySerializer | QuerySerializerOptions; /** global bodySerializer */