diff options
author | ayame113 <40050810+ayame113@users.noreply.github.com> | 2022-07-20 19:30:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 18:30:41 +0800 |
commit | 27a72a12b772cfa74b519714aca6e3b6fdaa5eeb (patch) | |
tree | 7a36d0494797e3296f1deae51e733378f2abfd99 /ext | |
parent | b8e1250500ba07971b2f05847fdcbbfe548caa44 (diff) |
chore: align some Web API type definitions to lib.dom.d.ts (#15219)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/fetch/lib.deno_fetch.d.ts | 4 | ||||
-rw-r--r-- | ext/url/lib.deno_url.d.ts | 2 | ||||
-rw-r--r-- | ext/websocket/lib.deno_websocket.d.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index 18c39c866..79d435468 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -252,7 +252,7 @@ interface RequestInit { /** This Fetch API interface represents a resource request. */ declare class Request implements Body { - constructor(input: RequestInfo, init?: RequestInit); + constructor(input: RequestInfo | URL, init?: RequestInit); /** * Returns the cache mode associated with request, which is a string @@ -385,7 +385,7 @@ declare class Response implements Body { constructor(body?: BodyInit | null, init?: ResponseInit); static json(data: unknown, init?: ResponseInit): Response; static error(): Response; - static redirect(url: string, status?: number): Response; + static redirect(url: string | URL, status?: number): Response; readonly headers: Headers; readonly ok: boolean; diff --git a/ext/url/lib.deno_url.d.ts b/ext/url/lib.deno_url.d.ts index 4dc56b3f6..d3a51a00e 100644 --- a/ext/url/lib.deno_url.d.ts +++ b/ext/url/lib.deno_url.d.ts @@ -153,7 +153,7 @@ declare class URLSearchParams { /** The URL interface represents an object providing static methods used for creating object URLs. */ declare class URL { - constructor(url: string, base?: string | URL); + constructor(url: string | URL, base?: string | URL); static createObjectURL(blob: Blob): string; static revokeObjectURL(url: string): void; diff --git a/ext/websocket/lib.deno_websocket.d.ts b/ext/websocket/lib.deno_websocket.d.ts index 8b79fa5cc..70d0bd61d 100644 --- a/ext/websocket/lib.deno_websocket.d.ts +++ b/ext/websocket/lib.deno_websocket.d.ts @@ -40,7 +40,7 @@ interface WebSocketEventMap { * If you are looking to create a WebSocket server, please take a look at `Deno.upgradeWebSocket()`. */ declare class WebSocket extends EventTarget { - constructor(url: string, protocols?: string | string[]); + constructor(url: string | URL, protocols?: string | string[]); static readonly CLOSED: number; static readonly CLOSING: number; |