HomeGuidesAPI Reference
HubBlogChangelogSupport ForumLog In
API Reference

Web SDK

Home > @rainway/web

web package

Classes

ClassDescription
DataChannelRepresents a data channel between oursevles and a remote peer
EventEmitterEvent emitter
HeldKeysAn interface for querying which keyboard keys are currently held down (locally, on the web page).
InboundStream

An incoming Rainway stream.

To ask a host for a stream, use Peer.createStream(). You can also listen for unsolicited stream announcements using the stream event on Peer. To clean up, call InboundStream.close().

For more info, see: https://docs.rainway.com/tutorial/streaming

Peer

An object representing a remote Rainway peer.

Acquire one of these objects from RainwayConnection.connect(). Then ask for a stream with Peer.createStream().

For more info, see: https://docs.rainway.com/tutorial/exchanging-messages https://docs.rainway.com/tutorial/streaming

RainwayConnectionA connection to the Rainway network over which peer connection requests are transmitted.
RainwayErrorA runtime error that occurred in the Rainway SDK.
RainwaySDK

Enumerations

EnumerationDescription
AudioCodec
AudioContainer
ButtonActionA flag indicating whether a mouse button went down or up.
DataChannelModeA "reliability mode" for a custom-created data channel, which controls the reliability of the traffic over that channel.
InputLevelA bitmask of kinds of input a client can control in a stream.
InputType
KeyboardActionA flag indicating whether a keyboard key went down or up.
LogLevel
MessageEventTypeIndicates whether a received data channel message expects a response.
MouseButtonAn enum for buttons on a mouse or touch device.
PeerState
PenFlagsFlags for PenAbsolute.
PenMaskIndicates which fields of PenAbsolute are valid. https://docs.microsoft.com/en-us/previous-versions/windows/desktop/inputmsg/pen-mask-constants
ScrollAxisAn enum for axes that can be scrolled over.
StreamFit
StreamTypeThe type of the stream (full desktop, app isolation, or byofb).
TouchMaskIndicates which fields of TouchAbsolute are valid. https://docs.microsoft.com/en-us/previous-versions/windows/desktop/inputmsg/touch-mask-constants
VideoCodecType

A bitmask enum coarsely describing a video codec.

For H.264 codecs, this is the "profile": https://superuser.com/questions/489087/what-are-the-differences-between-h-264-profiles

For H.265 codecs, this is just an "H265" value for now.

VideoContainer
VideoReadyState
VirtualKey

An enum representing a "virtual key". That is, each member of this enum represents a _behavior_ a key on a keyboard may have (for example "the behavior of the Tab key"), regardless of the physical position of that key (for example "the squat, leftmost key underneath the number row").

This coincides with the Windows VirtualKey enum, but in the context of the Rainway Protocol it can be considered platform-independent, and peers should convert to/from it when generating/processing Rainway keyboard messages.

See: https://docs.microsoft.com/en-us/uwp/api/windows.system.virtualkey?view=winrt-19041

WindowsPointerFlagsSee https://docs.microsoft.com/en-us/windows/win32/inputmsg/pointer-flags-contants
XInputButtonsA bit-mask enum for buttons on a gamepad.

Interfaces

InterfaceDescription
CreateStreamOptions
CursorA structure which represents a remote cursor.
DataChannelEvents
DecodingInfoDecoding info result.
FullscreenOptions_2Options passed into InboundStream.requestFullscreen().
IAudioConfigA combination of an audio codec and containerization format.
IDesktopRect
IGamepadReportA request to bring the remote virtual gamepad with ID "slot" into the state described.
IGamepadRumbleA feedback message, telling a guest about the gamepad rumble motor speed values.
IKeyboardInputA request to perform a remote keypress of the given keycode.
ILogicalInputA request to perform a remote text insertion (as if pasting some Unicode text). This is independent of keyboard layout.
IMouseAbsoluteA request to move the remote mouse to an absolute pixel coordinate on the streamed monitor.
IMouseClickA request to click a button on the remote mouse.
IMouseRelativeA request to move the remote mouse by (dx, dy) pixels.
IMouseScrollA request to scroll the remote mouse.
IPenAbsoluteA request to perform a remote absolute pen movement. https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer\_pen\_info
IRemoteStreamInfoImportant information about a peers stream
ISetClipboardTextA request to store some text in the other peer's clipboard.
ITouchAbsolute
ITouchesAbsoluteA request to perform a remote absolute touch movement. https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer\_touch\_info
ITouchPenPointerInfoInformation common to touch and pen events. This is a subset of: https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer\_info
IVideoCodecA video codec recognized by Rainway.
IVideoConfigA combination of a video codec and containerization format.
IViewportResizeA request to resize the streamed application, because the local stream viewport size has changed. Currently this request will be carried out in App Isolation, when one window is isolated. Otherwise it is ignored.
JoinStreamOptions
MessageEventRequestA data channel "request" message, expecting a response.
MessageEventStandaloneA standalone message received on a data channel.
OpenDataChannelOptionsOptions for opening data channels
PeerConnectionRequestAn incoming request from a peer who wants to connect to this device.
PeerEvents
RainwayConnectionEvents
RainwayConnectOptionsConfiguration for RainwayConnection.
RainwayEvents
RainwayInputEvent
RainwayStreamAnnouncement
StatsSummaryA summary of statistical measurements over some elapsed polling window.
StreamEvents
StreamReport
VideoConfiguration_2Video configuration for getting decoding info.
VideoFrameA video frame, consisting of a parsed metadata header and a buffer of raw h264 video stream data.
VideoFrameHeaderVideo frame properties.

Variables

VariableDescription
Rainway

The Rainway SDK

For more information,

Type Aliases

Type AliasDescription
EventHandlerHelper to constrain event handlers
EventNameHelper type to constrain event names
EventProviderHelper type to constrain event provider types
MessageEvent_2
OutgoingInput

An input we're asking to perform in someone's interactive stream.

This is a discriminated union type: match on type to distinguish types of input, and then handle the fields of the narrowed type.

See: https://basarat.gitbook.io/typescript/type-system/discriminated-unions

PeerId
ReportEntry

An entry in the stream metrics report, describing some event or stats probe in the stream.

This is intentionally "stringy" for ease of JSON exporting.

SimpleEvent
TimestampedReportEntry