From c3acba43875e85a49762ed06e1092dc4fe01d490 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 26 Oct 2023 21:42:39 +0200 Subject: [PATCH 1/3] feat: expose `SharedOptions` --- src/index.ts | 2 +- src/types.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e372db9..045effb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import { createFetch } from "./base"; export * from "./base"; -export type * from "./types"; +export * from "./types"; // ref: https://github.com/tc39/proposal-global const _globalThis = (function () { diff --git a/src/types.ts b/src/types.ts index 10a75d8..f2da2ff 100644 --- a/src/types.ts +++ b/src/types.ts @@ -77,6 +77,11 @@ export interface CreateFetchOptions { AbortController?: typeof AbortController; } +export type SharedOptions = Pick< + FetchOptions, + "timeout" | "retry" | "retryDelay" +>; + // -------------------------- // Response Types // -------------------------- From 550b571995ff548f74d63cb54437c62361b5a59b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 26 Oct 2023 21:45:29 +0200 Subject: [PATCH 2/3] keep export type --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 045effb..e372db9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import { createFetch } from "./base"; export * from "./base"; -export * from "./types"; +export type * from "./types"; // ref: https://github.com/tc39/proposal-global const _globalThis = (function () { From 17f3290cf369353a3c1331bbe7a298a9bbb0acde Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 26 Oct 2023 21:45:51 +0200 Subject: [PATCH 3/3] rename to GlobalOptions --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index f2da2ff..d4f2e11 100644 --- a/src/types.ts +++ b/src/types.ts @@ -77,7 +77,7 @@ export interface CreateFetchOptions { AbortController?: typeof AbortController; } -export type SharedOptions = Pick< +export type GlobalOptions = Pick< FetchOptions, "timeout" | "retry" | "retryDelay" >;