mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
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.
This commit is contained in:
parent
d5c00ef50e
commit
f88a9e7467
2 changed files with 13 additions and 15 deletions
13
cli/tsc/dts/lib.deno.shared_globals.d.ts
vendored
13
cli/tsc/dts/lib.deno.shared_globals.d.ts
vendored
|
@ -13,6 +13,7 @@
|
||||||
/// <reference lib="deno.fetch" />
|
/// <reference lib="deno.fetch" />
|
||||||
/// <reference lib="deno.websocket" />
|
/// <reference lib="deno.websocket" />
|
||||||
/// <reference lib="deno.crypto" />
|
/// <reference lib="deno.crypto" />
|
||||||
|
/// <reference lib="deno.ns" />
|
||||||
|
|
||||||
/** @category WASM */
|
/** @category WASM */
|
||||||
declare namespace WebAssembly {
|
declare namespace WebAssembly {
|
||||||
|
@ -740,3 +741,15 @@ declare interface ErrorConstructor {
|
||||||
// TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this
|
// TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this
|
||||||
// internally in a way that makes it unavailable for users.
|
// 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<Response>;
|
||||||
|
|
15
cli/tsc/dts/lib.deno.unstable.d.ts
vendored
15
cli/tsc/dts/lib.deno.unstable.d.ts
vendored
|
@ -1216,21 +1216,6 @@ declare namespace Deno {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** **UNSTABLE**: New API, yet to be vetted.
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
declare function fetch(
|
|
||||||
input: Request | URL | string,
|
|
||||||
init?: RequestInit & { client: Deno.HttpClient },
|
|
||||||
): Promise<Response>;
|
|
||||||
|
|
||||||
/** **UNSTABLE**: New API, yet to be vetted.
|
/** **UNSTABLE**: New API, yet to be vetted.
|
||||||
*
|
*
|
||||||
* @category Workers
|
* @category Workers
|
||||||
|
|
Loading…
Reference in a new issue