-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom IDL for WebSocketStream (#1341)
This would help update data for Chrome 124: mdn/browser-compat-data#22681
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// https://github.com/whatwg/websockets/pull/48 | ||
|
||
dictionary WebSocketOpenInfo { | ||
ReadableStream readable; | ||
WritableStream writable; | ||
DOMString extensions; | ||
DOMString protocol; | ||
}; | ||
|
||
dictionary WebSocketCloseInfo { | ||
[EnforceRange] unsigned short closeCode; | ||
USVString reason = ""; | ||
}; | ||
|
||
dictionary WebSocketStreamOptions { | ||
sequence<USVString> protocols; | ||
AbortSignal signal; | ||
}; | ||
|
||
[Exposed=(Window,Worker)] | ||
interface WebSocketStream { | ||
constructor(USVString url, optional WebSocketStreamOptions options = {}); | ||
readonly attribute USVString url; | ||
readonly attribute Promise<WebSocketOpenInfo> opened; | ||
readonly attribute Promise<WebSocketCloseInfo> closed; | ||
undefined close(optional WebSocketCloseInfo closeInfo = {}); | ||
}; | ||
|
||
[Exposed=(Window,Worker)] | ||
interface WebSocketError : DOMException { | ||
constructor(optional DOMString message = "", | ||
optional WebSocketCloseInfo init = {}); | ||
|
||
readonly attribute unsigned short? closeCode; | ||
readonly attribute USVString reason; | ||
}; |