Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Oct 21, 2023
1 parent 60ab174 commit 924817d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-games-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-app/prelude": patch
---

fix type
6 changes: 2 additions & 4 deletions packages/prelude/_src/client/clientFor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import type { GetResponse, Methods, QueryRequest, RequestSchemed } from "@effect
import { condemnCustom } from "@effect-app/prelude/schema"
import * as utils from "@effect-app/prelude/utils"
import { Path } from "path-parser"

import type { Http } from "@effect-app/core/http/http-client"
import type { ApiConfig } from "./config.js"
import type { FetchError, FetchResponse } from "./fetch.js"
import {
Expand All @@ -29,8 +27,8 @@ type AnyRequest = Omit<QueryRequest<any, any, any, any, any>, "method"> & {
const cache = new Map<any, Client<any>>()

export type Client<M extends Requests> =
& RequestHandlers<ApiConfig | Http, FetchError | ResponseError, M>
& RequestHandlersE<ApiConfig | Http, FetchError | ResponseError, M>
& RequestHandlers<ApiConfig | HttpClient.Default, FetchError | ResponseError, M>
& RequestHandlersE<ApiConfig | HttpClient.Default, FetchError | ResponseError, M>

export function clientFor<M extends Requests>(models: M): Client<M> {
const found = cache.get(models)
Expand Down

0 comments on commit 924817d

Please sign in to comment.