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).
InboundStreamAn 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
PeerAn 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
RTCTransport_2A WebRTC-based transport implementation.
Transport_2A base class which can be used to instantiate various network transports.

Enumerations

EnumerationDescription
AudioChannels
AudioCodec
AudioContainer
AudioDataType
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.
FormFactor
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.
LogicError
LogLevel
MouseButtonAn enum for buttons on a mouse or touch device.
OperatingSystem
PeerInformationTypeIndicates the type of SDP/ICE message being transported over the Rainway Network for signaling.
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
TransportStatusThe status of a Rainway transport implementation.
VideoCodecTypeA 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-profilesFor H.265 codecs, this is just an "H265" value for now.
VideoContainer
VideoDataType
VirtualKeyAn 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
AudioConfigurationAudio configuration for getting decoding info.
CreateStreamOptions
CursorA structure which represents a remote cursor.
DataChannelEvents
DecodingInfoDecoding info result.
FrameDimensions
FullscreenOptions_2Options passed into InboundStream.requestFullscreen().
IAudioConfigA combination of an audio codec and containerization format.
IAudioData
IChunkA part of a chunked message.Certain WebRTC implementations cause large packets (>64kB or >256kB) on DataChannels to be dropped, clipped, or split down the middle (rendering their parts individually invalid). To sidestep this, Rainway peers chunk large messages into small enough units whose data fields are reassembled by the remote peer.A receiver stores these chunks, and reinterprets the concatenated data once all parts have been received. (The index values run from 0 to chunksInGroup - 1.)On the Arbitrary channel, reassembled messages are sent to the application, and this struct is in fact the body of ArbitraryDatagram. (A short enough piece of arbitrary data is sent as a group of one chunk.)On the Media channel, reassembled messages are interpreted as MediaDatagram and fed back into the message handler, and chunks occur as the MediaChunk of the MediaBody union.
IClientCapabilitiesA client reports its capabilities to a peer.The "supported" values indicate all configurations that will work for this client, but the "preferred" value will be chosen if possible (e.g. by a host in a 1:1 setting.)
ICodecPackRequestA client requests a codec pack from a peer.
ICodecPackResponseA peer sends a pack of codecs it can use for streaming back to the client.
IDesktopRect
IDeviceInfoInfo about the device a peer is using Rainway from. Peers exchange this freely.
IErrorResponseA client asked for something that the host could not handle.
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.
IInputBodyThe body of an InputDatagram.
IInputLevelRequestA client requests a new input level in a host's stream. The response is InputLevelUpdate (the client can check which bits they were or weren't granted).
IInputLevelUpdateA host informs a client of its new input level in a stream.
IJoinStreamA client tells a host that it's interested in its stream, and wishes to start receiving captured media. The host should send a keyframe.
IKeyboardInputA request to perform a remote keypress of the given keycode.
IKeyframeRequestA client asks a host for a keyframe.
ILeaveStreamA client tells a host that it's no longer interested in its stream (i.e. for all it cares, it's okay if the capture session is completely terminated).
IListStreamsA peer is asking another peer to list their streams
ILogicalInputA request to perform a remote text insertion (as if pasting some Unicode text). This is independent of keyboard layout.
IMediaChunkA chunk of a large MediaDatagram. (When all chunks are received, the resulting concatenated buffer is to be reinterpreted as a MediaDatagram.)
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.
IPauseStreamA client tells a host to pause the stream. The host can temporarily stop sending media until it hears a JoinStream message.
IPeerSignalingInformation
IPenAbsoluteA request to perform a remote absolute pen movement. https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer\_pen\_info
IPointerDataA packet describing the position and appearance of the remote mouse pointer.A guest receiving such a packet must draw the pointer locally at locally-computed mouse coordinates, as the mouse pointer is not part of the video stream.See: https://www.notion.so/rainway/Pointer-Data-788741724ec9440bbe8c9d3cb785b3f2
IRejectStreamRequestA would-be host rejects a client stream request.
IRemoteStreamInfoImportant information about a peers stream
ISetClipboardTextA request to store some text in the other peer's clipboard.
IStreamAnnouncementPeer is announcing a stream
IStreamRequestA client asks a host for a stream at the given input level.
IStreamStoppingA host informs a peer that a stream is stopping.
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
IVideoBitrateRequestA client asks a host for a new video bitrate.
IVideoCodecA video codec recognized by Rainway.
IVideoConfigA combination of a video codec and containerization format.
IVideoData
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.
MediaDecodingConfigurationMedia configuration for getting decoding info.
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
StreamEvents
TransportStatsRainway transport statistics.
VideoConfigurationVideo 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
RainwayThe Rainway SDKFor more information,

Type Aliases

Type AliasDescription
EventHandlerHelper to constrain event handlers
EventNameHelper type to constrain event names
EventProviderHelper type to constrain event provider types
IInputBodyInnerInner body of an input datagram
ILogicBodyThe body of a LogicDatagram.
IMediaBodyThe body of a MediaDatagram.
IMediaBodyNotChunk
IRainwayMessage
OutgoingInputAn 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