From 5c9a5199e1672da6538507c587da438fcb3579ae Mon Sep 17 00:00:00 2001 From: Tim Smart Date: Sun, 17 Dec 2023 18:05:16 +1300 Subject: [PATCH] fix headers type for schemaJson --- .changeset/twenty-fans-double.md | 5 +++++ docs/platform/Http/ClientResponse.ts.md | 2 +- packages/platform/src/Http/ClientResponse.ts | 2 +- packages/platform/src/internal/http/clientResponse.ts | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/twenty-fans-double.md diff --git a/.changeset/twenty-fans-double.md b/.changeset/twenty-fans-double.md new file mode 100644 index 00000000..8f0b76c1 --- /dev/null +++ b/.changeset/twenty-fans-double.md @@ -0,0 +1,5 @@ +--- +"@effect/platform": patch +--- + +fix headers type for schemaJson diff --git a/docs/platform/Http/ClientResponse.ts.md b/docs/platform/Http/ClientResponse.ts.md index 37eddcb1..459f35a4 100644 --- a/docs/platform/Http/ClientResponse.ts.md +++ b/docs/platform/Http/ClientResponse.ts.md @@ -102,7 +102,7 @@ Added in v1.0.0 export declare const schemaJson: < I extends { readonly status?: number | undefined - readonly headers?: Headers.Headers | undefined + readonly headers?: Readonly> | undefined readonly body?: unknown }, A diff --git a/packages/platform/src/Http/ClientResponse.ts b/packages/platform/src/Http/ClientResponse.ts index 18fc3965..29d58ee2 100644 --- a/packages/platform/src/Http/ClientResponse.ts +++ b/packages/platform/src/Http/ClientResponse.ts @@ -63,7 +63,7 @@ export const fromWeb: (request: ClientRequest.ClientRequest, source: Response) = export const schemaJson: < I extends { readonly status?: number - readonly headers?: Headers.Headers + readonly headers?: Readonly> readonly body?: unknown }, A diff --git a/packages/platform/src/internal/http/clientResponse.ts b/packages/platform/src/internal/http/clientResponse.ts index b5b87634..f26d9a0d 100644 --- a/packages/platform/src/internal/http/clientResponse.ts +++ b/packages/platform/src/internal/http/clientResponse.ts @@ -135,7 +135,7 @@ class ClientResponseImpl implements ClientResponse.ClientResponse { export const schemaJson = < I extends { readonly status?: number - readonly headers?: Headers.Headers + readonly headers?: Readonly> readonly body?: unknown }, A @@ -157,7 +157,7 @@ export const schemaJson = < export const schemaNoBody = < I extends { readonly status?: number - readonly headers?: Headers.Headers + readonly headers?: Readonly> }, A >(schema: Schema.Schema) => {