import { core } from "ext:core/mod.js";
import { SymbolDispose } from "ext:deno_web/00_infra.js";
const {
op_fetch_custom_client,
} = core.ensureFastOps();
function createHttpClient(options) {
options.caCerts ??= [];
return new HttpClient(
op_fetch_custom_client(
options,
),
);
}
class HttpClient {
constructor(rid) {
this.rid = rid;
}
close() {
core.close(this.rid);
}
[SymbolDispose]() {
core.tryClose(this.rid);
}
}
const HttpClientPrototype = HttpClient.prototype;
export { createHttpClient, HttpClient, HttpClientPrototype };