mirror of
https://github.com/denoland/deno.git
synced 2025-01-05 22:09:02 -05:00
fix: deprecate URL as the first arg of fetch (#14113)
This commit is contained in:
parent
172de68920
commit
3953059b74
1 changed files with 11 additions and 1 deletions
12
ext/fetch/lib.deno_fetch.d.ts
vendored
12
ext/fetch/lib.deno_fetch.d.ts
vendored
|
@ -435,6 +435,16 @@ declare class Response implements Body {
|
|||
* ```
|
||||
*/
|
||||
declare function fetch(
|
||||
input: Request | URL | string,
|
||||
input: Request | string,
|
||||
init?: RequestInit,
|
||||
): Promise<Response>;
|
||||
// TODO(kt3k): Remove the following overloaded declaration for 2.0.
|
||||
/** @deprecated URL is deprecated as the first argument. Use string or Request object instead.
|
||||
*
|
||||
* Fetch a resource from the network. It returns a `Promise` that resolves to the
|
||||
* `Response` to that `Request`, whether it is successful or not.
|
||||
*/
|
||||
declare function fetch(
|
||||
input: URL,
|
||||
init?: RequestInit,
|
||||
): Promise<Response>;
|
||||
|
|
Loading…
Reference in a new issue