import * as console from "ext:deno_console/02_console.js";
import * as headers from "ext:deno_fetch/20_headers.js";
import * as formData from "ext:deno_fetch/21_formdata.js";
import * as request from "ext:deno_fetch/23_request.js";
import * as response from "ext:deno_fetch/23_response.js";
import * as fetch from "ext:deno_fetch/26_fetch.js";

const { core } = Deno;

function createClient() {
  return core.opAsync("as__client_new");
}

globalThis.console = new console.Console((msg, level) =>
  core.print(msg, level > 1)
);

globalThis.createClient = createClient;

globalThis.Headers = headers.Headers;
globalThis.Request = request.Request;
globalThis.Response = response.Response;
globalThis.FormData = formData.FormData;
globalThis.fetch = fetch.fetch;
