chromium/third_party/blink/renderer/modules/websockets/websocket_stream.idl

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Explainer: https://github.com/ricea/websocketstream-explainer/blob/master/README.md
// TODO(ricea): Add standard link when there is one.

[
    Exposed=(Window,Worker),
    RuntimeEnabled=WebSocketStream,
    ActiveScriptWrappable
] interface WebSocketStream {
  [CallWith=ScriptState, RaisesException, MeasureAs=WebSocketStreamConstructor] constructor(USVString url, optional WebSocketStreamOptions options = {});
  readonly attribute USVString url;
  [CallWith=ScriptState] readonly attribute Promise<WebSocketOpenInfo> opened;
  [CallWith=ScriptState] readonly attribute Promise<WebSocketCloseInfo> closed;
  [RaisesException] void close(optional WebSocketCloseInfo closeInfo = {});
};