From f88a9e746744258ead3cc7a205644c18da5bab60 Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Wed, 18 Sep 2024 15:38:21 +0900 Subject: fix(dts): stabilize `fetch` declaration for use with `Deno.HttpClient` (#25683) This commit stabilizes the `fetch` function declaration for use with `Deno.HttpClient` and moves it from `lib.deno.unstable.d.ts` to `lib.deno.shared_globals.d.ts`. `Deno.HttpClient` was stabilized in #25569, but the associated override declaration for `fetch` is still marked as experimental. This should also be stabilized now and moved to a different d.ts file. --- cli/tsc/dts/lib.deno.shared_globals.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cli/tsc/dts/lib.deno.shared_globals.d.ts') diff --git a/cli/tsc/dts/lib.deno.shared_globals.d.ts b/cli/tsc/dts/lib.deno.shared_globals.d.ts index 6727e42f1..b907a4e9a 100644 --- a/cli/tsc/dts/lib.deno.shared_globals.d.ts +++ b/cli/tsc/dts/lib.deno.shared_globals.d.ts @@ -13,6 +13,7 @@ /// /// /// +/// /** @category WASM */ declare namespace WebAssembly { @@ -740,3 +741,15 @@ declare interface ErrorConstructor { // TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this // internally in a way that makes it unavailable for users. } + +/** The [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) + * which also supports setting a {@linkcode Deno.HttpClient} which provides a + * way to connect via proxies and use custom TLS certificates. + * + * @tags allow-net, allow-read + * @category Fetch + */ +declare function fetch( + input: Request | URL | string, + init?: RequestInit & { client: Deno.HttpClient }, +): Promise; -- cgit v1.2.3