import * as HttpClient from "effect/http/HttpClient"; import * as Layer from "effect/Layer"; /** * @category re-exports * @since 4.0.0 */ export * from "effect/http/FetchHttpClient"; /** * Bun fetch options applied to every request sent by `layerOptions`. * * **Details** * * This is Bun's `BunFetchRequestInit` without the fields the client sets per * request: `method`, `body`, `signal` and `duplex`. `headers` are merged with * the request headers, with request headers taking precedence. * * Bun-specific fields include `unix` for a Unix domain socket path, `tls` for * `ca`, `cert`, `key`, `rejectUnauthorized` and `checkServerIdentity`, `proxy`, * `session` for a shared connection pool, `protocol`, `decompress`, `verbose` * and `s3`. Standard `RequestInit` fields such as `credentials` or `redirect` * are accepted too. * * @stability unstable * @category models * @since 4.0.6 */ export type Options = Omit; /** * Layer that provides an `HttpClient` sending every request through Bun's * `fetch` with the supplied native options. * * **When to use** * * Use to send every request over a Unix domain socket with `{ unix: path }`, * or over TLS with a custom CA and client certificate with * `{ tls: { ca, cert, key } }`. * * **Details** * * Before each request the options are merged over the `RequestInit` in effect * for that request: the `RequestInit` service in the request context, or * otherwise the one provided while building this layer. An application-wide * `RequestInit` for `credentials`, `cache` or default headers therefore still * applies, and the native options win per top-level key. Method, body, abort * signal and duplex mode are set per request, and request headers override * the same keys in `headers`. * * **Example** (Sending requests over a Unix domain socket) * * ```ts * import { BunHttpClient } from "@effect/platform-bun" * * const DockerClient = BunHttpClient.layerOptions({ unix: "/var/run/docker.sock" }) * ``` * * **Example** (Mutual TLS with a private CA) * * ```ts * import { BunHttpClient } from "@effect/platform-bun" * * declare const ca: string * declare const cert: string * declare const key: string * * const MtlsClient = BunHttpClient.layerOptions({ tls: { ca, cert, key } }) * ``` * * @see {@link Options} for the accepted fields * * @stability unstable * @category layers * @since 4.0.6 */ export declare const layerOptions: (options: Options) => Layer.Layer; //# sourceMappingURL=BunHttpClient.d.ts.map