From 39453470988bf6f0529ece838638d935b08aa2d5 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 20 Feb 2023 20:52:36 +0100 Subject: [PATCH 1/2] fix(fetch): improve Headers and Request type-compatibility --- types/fetch.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/fetch.d.ts b/types/fetch.d.ts index fa4619c9182..e16925bdf0e 100644 --- a/types/fetch.d.ts +++ b/types/fetch.d.ts @@ -68,7 +68,7 @@ export declare class Headers implements SpecIterable<[string, string]> { readonly keys: () => SpecIterableIterator readonly values: () => SpecIterableIterator readonly entries: () => SpecIterableIterator<[string, string]> - readonly [Symbol.iterator]: () => SpecIterator<[string, string]> + readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]> } export type RequestCache = @@ -146,7 +146,8 @@ export declare class Request implements BodyMixin { readonly method: string readonly mode: RequestMode readonly redirect: RequestRedirect - readonly referrerPolicy: string + readonly referrer: string + readonly referrerPolicy: ReferrerPolicy readonly url: string readonly keepalive: boolean From 1c9f4701dd9da1e5a453bbede5a2f63673bd8255 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Wed, 1 May 2024 12:46:58 +0200 Subject: [PATCH 2/2] test: fix "request.referrerPolicy" type assertion --- test/types/fetch.test-d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/types/fetch.test-d.ts b/test/types/fetch.test-d.ts index e11296aa85c..163a9a06cdc 100644 --- a/test/types/fetch.test-d.ts +++ b/test/types/fetch.test-d.ts @@ -138,7 +138,7 @@ expectType(request.integrity) expectType(request.method) expectType(request.mode) expectType(request.redirect) -expectType(request.referrerPolicy) +expectType(request.referrerPolicy) expectType(request.url) expectType(request.keepalive) expectType(request.signal)