diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2022-03-25 20:23:55 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 20:23:55 +0900 |
commit | 3462d8750344743b7b0cdbedcbff6c4b98a383ba (patch) | |
tree | 1e4fcb7f05c24921d767ea0ada211250f133fc73 /ext/fetch/lib.deno_fetch.d.ts | |
parent | bb3387de17953ea1f0558f5f9863b0cd6c59d48c (diff) |
fix: deprecate URL as the first arg of fetch (#14113)
Diffstat (limited to 'ext/fetch/lib.deno_fetch.d.ts')
-rw-r--r-- | ext/fetch/lib.deno_fetch.d.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index e538fe4ec..cd06deffb 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -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>; |