diff options
author | ud2 <sjx233@qq.com> | 2023-07-04 02:36:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 14:36:55 -0400 |
commit | d632cce129cb7025a34cf0aa7262a38fb12f47c4 (patch) | |
tree | 6fe672badbe6ea0fb8a30ecc88b74c613aaa7370 /cli/tsc/dts/lib.deno.unstable.d.ts | |
parent | e8a866ca8a682b552722926161a7816c5cf94124 (diff) |
fix(dts): make globals available on globalThis (#19438)
This PR changes Web IDL interfaces to be declared with `var` instead of
`class`, so that accessing them via `globalThis` does not raise type
errors.
Closes #13390.
Diffstat (limited to 'cli/tsc/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 8f11adfff..bc770dab8 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -2268,10 +2268,19 @@ declare interface WebSocketCloseInfo { * @tags allow-net * @category Web Sockets */ -declare class WebSocketStream { - constructor(url: string, options?: WebSocketStreamOptions); +declare interface WebSocketStream { url: string; connection: Promise<WebSocketConnection>; closed: Promise<WebSocketCloseInfo>; close(closeInfo?: WebSocketCloseInfo): void; } + +/** **UNSTABLE**: New API, yet to be vetted. + * + * @tags allow-net + * @category Web Sockets + */ +declare var WebSocketStream: { + readonly prototype: WebSocketStream; + new (url: string, options?: WebSocketStreamOptions): WebSocketStream; +}; |