"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RainwayConnectionConnectToPeerOptionsDef = exports.RainwayAsyncCallback_RainwayVoid__RainwayErrorDef = exports.RainwayVoidDef = exports.RainwayPeerOptionsDef = exports.RainwayNullable_RainwayCreateConnectionOptionsDef = exports.RainwayCreateConnectionOptionsDef = exports.RainwayAsyncCallback_RainwayPeerId__RainwayErrorDef = exports.RainwayPeerIdDef = exports.RainwayUserDataDef = exports._RainwayUserDataDef = exports.RainwayCreateConnectionAdvancedOptionsDef = exports.RainwayLogSinkDef = exports.RainwayNullable_RainwayInitConfigDef = exports.RainwayInitConfigDef = exports.RainwayNullable_c_charDef = exports.RainwayStreamTypeDef = exports.RainwayLogLevelDef = exports.RainwayErrorDef = exports.RainwayInputLevelDef = exports.RainwayPenMaskDef = exports.RainwayPenFlagsDef = exports.RainwayKeyboardActionDef = exports.RainwayScrollAxisDef = exports.RainwayMouseButtonDef = exports.RainwayButtonActionDef = exports.RainwayVirtualKeyDef = exports.RainwayXInputButtonsDef = exports.RainwayPeerStateDef = exports.RainwayChannelModeDef = exports.RainwayTouchAbsoluteDef = exports.RainwayTouchPenPointerInfoDef = exports.RainwayRuntimeDef = exports.uintptr_tDef = exports.RainwayAudioBuffer_Tag = exports.RainwayOutboundStreamVideoBuffer_Tag = exports.RainwayInput_Tag = exports.RainwayStreamType = exports.RainwayLogLevel = exports.RainwayError = exports.RainwayInputLevel = exports.RainwayPenMask = exports.RainwayPenFlags = exports.RainwayKeyboardAction = exports.RainwayScrollAxis = exports.RainwayMouseButton = exports.RainwayButtonAction = exports.RainwayVirtualKey = exports.RainwayXInputButtons = exports.RainwayPeerState = exports.RainwayChannelMode = void 0;
exports.RainwayPcmAudioBufferDef = exports.RainwayNullable_i16Def = exports.RainwayOutboundStreamVideoBufferDef = exports.RainwayOutboundStreamVideoBuffer_UnionDef = exports.RainwayDirectX_BodyDef = exports.RainwayOutboundStreamVideoBuffer_TagDef = exports.RainwayNullable_RawTextureDef = exports.RainwayStreamStartOptionsDef = exports.RainwayAsyncCallback_RainwayStreamId__RainwayErrorDef = exports.RainwayInputFilterDef = exports.RainwayEventHandlerRet_RainwayInputEvent__boolDef = exports._RainwayEventHandler_RainwayInputEvent__boolDef = exports.RainwayInputEventDef = exports.RainwayInputDef = exports.RainwayInput_UnionDef = exports.RainwaySetClipboardText_BodyDef = exports.RainwayViewportResize_BodyDef = exports.RainwayPenAbsolute_BodyDef = exports.RainwayTouchesAbsolute_BodyDef = exports.RainwayLogicalInput_BodyDef = exports.RainwayKeyboardInput_BodyDef = exports.RainwayMouseScroll_BodyDef = exports.RainwayMouseClick_BodyDef = exports.RainwayMouseRelative_BodyDef = exports.RainwayMouseAbsolute_BodyDef = exports.RainwayGamepadRumble_BodyDef = exports.RainwayGamepadReport_BodyDef = exports.RainwayInput_TagDef = exports.RainwayStreamIdDef = exports.RainwayPeerConnectionDataChannelDataHandlerDef = exports.RainwayEventHandler_RainwayDataChannelDataEventDef = exports._RainwayEventHandler_RainwayDataChannelDataEvent__RainwayVoidDef = exports.RainwayDataChannelDataEventDef = exports.RainwayPeerConnectionDataChannelOpenedHandlerDef = exports.RainwayEventHandler_RainwayDataChannelOpenedEventDef = exports._RainwayEventHandler_RainwayDataChannelOpenedEvent__RainwayVoidDef = exports.RainwayDataChannelOpenedEventDef = exports.RainwayPeerconnectionOutboundStreamRequestHandlerDef = exports.RainwayEventHandler_RainwayStreamRequestEventDef = exports._RainwayEventHandler_RainwayStreamRequestEvent__RainwayVoidDef = exports.RainwayStreamRequestEventDef = exports.RainwayPeerConnectionStateChangedHandlerDef = exports.RainwayEventHandler_RainwayPeerStateDef = exports._RainwayEventHandler_RainwayPeerState__RainwayVoidDef = exports.RainwayNullable_u32Def = exports.RainwayNullable_RainwayPeerIdDef = exports.RainwayConnectionPeerConnectionRequestHandlerDef = exports.RainwayEventHandler_RainwayIncomingConnectionRequestDef = exports._RainwayEventHandler_RainwayIncomingConnectionRequest__RainwayVoidDef = exports.RainwayIncomingConnectionRequestDef = void 0;
exports.dlopen = exports.RainwayNullable_u8Def = exports.RainwayPeerConnectionCreateDataChannelOptionsDef = exports.RainwayStreamByofbInputHandlerDef = exports.RainwayEventHandler_RainwayByofbInputEventDef = exports._RainwayEventHandler_RainwayByofbInputEvent__RainwayVoidDef = exports.RainwayByofbInputEventDef = exports.RainwayNullable_RainwayInputLevelDef = exports.RainwayStreamCloseHandlerDef = exports.RainwayEventHandler_RainwayVoidDef = exports._RainwayEventHandler_RainwayVoid__RainwayVoidDef = exports.RainwayStreamPeerJoinLeaveHandlerDef = exports.RainwayEventHandler_RainwayPeerIdDef = exports._RainwayEventHandler_RainwayPeerId__RainwayVoidDef = exports.RainwayOutboundStreamAudioOptionsDef = exports.RainwayAudioBufferDef = exports.RainwayAudioBuffer_UnionDef = exports.RainwayFloat_BodyDef = exports.RainwayPCM_BodyDef = exports.RainwayAudioBuffer_TagDef = exports.RainwayFloatAudioBufferDef = exports.RainwayNullable_f32Def = void 0;
const ffi_napi_1 = __importDefault(require("ffi-napi"));
const ref_napi_1 = __importDefault(require("ref-napi"));
const ref_struct_di_1 = __importDefault(require("ref-struct-di"));
const ref_array_di_1 = __importDefault(require("ref-array-di"));
const ref_union_di_1 = __importDefault(require("ref-union-di"));
const Struct = (0, ref_struct_di_1.default)(ref_napi_1.default);
const Union = (0, ref_union_di_1.default)(ref_napi_1.default);
const ArrayType = (0, ref_array_di_1.default)(ref_napi_1.default);
const Pointer = ref_napi_1.default.refType;
var RainwayChannelMode;
(function (RainwayChannelMode) {
    RainwayChannelMode[RainwayChannelMode["Unreliable"] = 0] = "Unreliable";
    RainwayChannelMode[RainwayChannelMode["Reliable"] = 1] = "Reliable";
})(RainwayChannelMode = exports.RainwayChannelMode || (exports.RainwayChannelMode = {}));
var RainwayPeerState;
(function (RainwayPeerState) {
    RainwayPeerState[RainwayPeerState["New"] = 0] = "New";
    RainwayPeerState[RainwayPeerState["Connecting"] = 1] = "Connecting";
    RainwayPeerState[RainwayPeerState["Connected"] = 2] = "Connected";
    RainwayPeerState[RainwayPeerState["Disconnected"] = 3] = "Disconnected";
    RainwayPeerState[RainwayPeerState["Failed"] = 4] = "Failed";
})(RainwayPeerState = exports.RainwayPeerState || (exports.RainwayPeerState = {}));
var RainwayXInputButtons;
(function (RainwayXInputButtons) {
    RainwayXInputButtons[RainwayXInputButtons["None"] = 0] = "None";
    RainwayXInputButtons[RainwayXInputButtons["DpadUp"] = 1] = "DpadUp";
    RainwayXInputButtons[RainwayXInputButtons["DpadDown"] = 2] = "DpadDown";
    RainwayXInputButtons[RainwayXInputButtons["DpadLeft"] = 4] = "DpadLeft";
    RainwayXInputButtons[RainwayXInputButtons["DpadRight"] = 8] = "DpadRight";
    RainwayXInputButtons[RainwayXInputButtons["Start"] = 16] = "Start";
    RainwayXInputButtons[RainwayXInputButtons["Back"] = 32] = "Back";
    RainwayXInputButtons[RainwayXInputButtons["LeftStick"] = 64] = "LeftStick";
    RainwayXInputButtons[RainwayXInputButtons["RightStick"] = 128] = "RightStick";
    RainwayXInputButtons[RainwayXInputButtons["LeftBumper"] = 256] = "LeftBumper";
    RainwayXInputButtons[RainwayXInputButtons["RightBumper"] = 512] = "RightBumper";
    RainwayXInputButtons[RainwayXInputButtons["Guide"] = 1024] = "Guide";
    RainwayXInputButtons[RainwayXInputButtons["A"] = 4096] = "A";
    RainwayXInputButtons[RainwayXInputButtons["B"] = 8192] = "B";
    RainwayXInputButtons[RainwayXInputButtons["X"] = 16384] = "X";
    RainwayXInputButtons[RainwayXInputButtons["Y"] = 32768] = "Y";
})(RainwayXInputButtons = exports.RainwayXInputButtons || (exports.RainwayXInputButtons = {}));
var RainwayVirtualKey;
(function (RainwayVirtualKey) {
    RainwayVirtualKey[RainwayVirtualKey["None"] = 0] = "None";
    RainwayVirtualKey[RainwayVirtualKey["Cancel"] = 1] = "Cancel";
    RainwayVirtualKey[RainwayVirtualKey["Back"] = 2] = "Back";
    RainwayVirtualKey[RainwayVirtualKey["Tab"] = 3] = "Tab";
    RainwayVirtualKey[RainwayVirtualKey["LineFeed"] = 4] = "LineFeed";
    RainwayVirtualKey[RainwayVirtualKey["Clear"] = 5] = "Clear";
    RainwayVirtualKey[RainwayVirtualKey["Enter"] = 6] = "Enter";
    RainwayVirtualKey[RainwayVirtualKey["Pause"] = 7] = "Pause";
    RainwayVirtualKey[RainwayVirtualKey["CapsLock"] = 8] = "CapsLock";
    RainwayVirtualKey[RainwayVirtualKey["HangulMode"] = 9] = "HangulMode";
    RainwayVirtualKey[RainwayVirtualKey["JunjaMode"] = 10] = "JunjaMode";
    RainwayVirtualKey[RainwayVirtualKey["FinalMode"] = 11] = "FinalMode";
    RainwayVirtualKey[RainwayVirtualKey["HanjaMode"] = 12] = "HanjaMode";
    RainwayVirtualKey[RainwayVirtualKey["Escape"] = 13] = "Escape";
    RainwayVirtualKey[RainwayVirtualKey["ImeConvert"] = 14] = "ImeConvert";
    RainwayVirtualKey[RainwayVirtualKey["ImeNonConvert"] = 15] = "ImeNonConvert";
    RainwayVirtualKey[RainwayVirtualKey["ImeAccept"] = 16] = "ImeAccept";
    RainwayVirtualKey[RainwayVirtualKey["ImeModeChange"] = 17] = "ImeModeChange";
    RainwayVirtualKey[RainwayVirtualKey["Space"] = 18] = "Space";
    RainwayVirtualKey[RainwayVirtualKey["PageUp"] = 19] = "PageUp";
    RainwayVirtualKey[RainwayVirtualKey["PageDown"] = 20] = "PageDown";
    RainwayVirtualKey[RainwayVirtualKey["End"] = 21] = "End";
    RainwayVirtualKey[RainwayVirtualKey["Home"] = 22] = "Home";
    RainwayVirtualKey[RainwayVirtualKey["Left"] = 23] = "Left";
    RainwayVirtualKey[RainwayVirtualKey["Up"] = 24] = "Up";
    RainwayVirtualKey[RainwayVirtualKey["Right"] = 25] = "Right";
    RainwayVirtualKey[RainwayVirtualKey["Down"] = 26] = "Down";
    RainwayVirtualKey[RainwayVirtualKey["Select"] = 27] = "Select";
    RainwayVirtualKey[RainwayVirtualKey["Print"] = 28] = "Print";
    RainwayVirtualKey[RainwayVirtualKey["Execute"] = 29] = "Execute";
    RainwayVirtualKey[RainwayVirtualKey["PrintScreen"] = 30] = "PrintScreen";
    RainwayVirtualKey[RainwayVirtualKey["Insert"] = 31] = "Insert";
    RainwayVirtualKey[RainwayVirtualKey["Delete"] = 32] = "Delete";
    RainwayVirtualKey[RainwayVirtualKey["Help"] = 33] = "Help";
    RainwayVirtualKey[RainwayVirtualKey["D0"] = 34] = "D0";
    RainwayVirtualKey[RainwayVirtualKey["D1"] = 35] = "D1";
    RainwayVirtualKey[RainwayVirtualKey["D2"] = 36] = "D2";
    RainwayVirtualKey[RainwayVirtualKey["D3"] = 37] = "D3";
    RainwayVirtualKey[RainwayVirtualKey["D4"] = 38] = "D4";
    RainwayVirtualKey[RainwayVirtualKey["D5"] = 39] = "D5";
    RainwayVirtualKey[RainwayVirtualKey["D6"] = 40] = "D6";
    RainwayVirtualKey[RainwayVirtualKey["D7"] = 41] = "D7";
    RainwayVirtualKey[RainwayVirtualKey["D8"] = 42] = "D8";
    RainwayVirtualKey[RainwayVirtualKey["D9"] = 43] = "D9";
    RainwayVirtualKey[RainwayVirtualKey["A"] = 44] = "A";
    RainwayVirtualKey[RainwayVirtualKey["B"] = 45] = "B";
    RainwayVirtualKey[RainwayVirtualKey["C"] = 46] = "C";
    RainwayVirtualKey[RainwayVirtualKey["D"] = 47] = "D";
    RainwayVirtualKey[RainwayVirtualKey["E"] = 48] = "E";
    RainwayVirtualKey[RainwayVirtualKey["F"] = 49] = "F";
    RainwayVirtualKey[RainwayVirtualKey["G"] = 50] = "G";
    RainwayVirtualKey[RainwayVirtualKey["H"] = 51] = "H";
    RainwayVirtualKey[RainwayVirtualKey["I"] = 52] = "I";
    RainwayVirtualKey[RainwayVirtualKey["J"] = 53] = "J";
    RainwayVirtualKey[RainwayVirtualKey["K"] = 54] = "K";
    RainwayVirtualKey[RainwayVirtualKey["L"] = 55] = "L";
    RainwayVirtualKey[RainwayVirtualKey["M"] = 56] = "M";
    RainwayVirtualKey[RainwayVirtualKey["N"] = 57] = "N";
    RainwayVirtualKey[RainwayVirtualKey["O"] = 58] = "O";
    RainwayVirtualKey[RainwayVirtualKey["P"] = 59] = "P";
    RainwayVirtualKey[RainwayVirtualKey["Q"] = 60] = "Q";
    RainwayVirtualKey[RainwayVirtualKey["R"] = 61] = "R";
    RainwayVirtualKey[RainwayVirtualKey["S"] = 62] = "S";
    RainwayVirtualKey[RainwayVirtualKey["T"] = 63] = "T";
    RainwayVirtualKey[RainwayVirtualKey["U"] = 64] = "U";
    RainwayVirtualKey[RainwayVirtualKey["V"] = 65] = "V";
    RainwayVirtualKey[RainwayVirtualKey["W"] = 66] = "W";
    RainwayVirtualKey[RainwayVirtualKey["X"] = 67] = "X";
    RainwayVirtualKey[RainwayVirtualKey["Y"] = 68] = "Y";
    RainwayVirtualKey[RainwayVirtualKey["Z"] = 69] = "Z";
    RainwayVirtualKey[RainwayVirtualKey["LWin"] = 70] = "LWin";
    RainwayVirtualKey[RainwayVirtualKey["RWin"] = 71] = "RWin";
    RainwayVirtualKey[RainwayVirtualKey["Apps"] = 72] = "Apps";
    RainwayVirtualKey[RainwayVirtualKey["Sleep"] = 73] = "Sleep";
    RainwayVirtualKey[RainwayVirtualKey["NumPad0"] = 74] = "NumPad0";
    RainwayVirtualKey[RainwayVirtualKey["NumPad1"] = 75] = "NumPad1";
    RainwayVirtualKey[RainwayVirtualKey["NumPad2"] = 76] = "NumPad2";
    RainwayVirtualKey[RainwayVirtualKey["NumPad3"] = 77] = "NumPad3";
    RainwayVirtualKey[RainwayVirtualKey["NumPad4"] = 78] = "NumPad4";
    RainwayVirtualKey[RainwayVirtualKey["NumPad5"] = 79] = "NumPad5";
    RainwayVirtualKey[RainwayVirtualKey["NumPad6"] = 80] = "NumPad6";
    RainwayVirtualKey[RainwayVirtualKey["NumPad7"] = 81] = "NumPad7";
    RainwayVirtualKey[RainwayVirtualKey["NumPad8"] = 82] = "NumPad8";
    RainwayVirtualKey[RainwayVirtualKey["NumPad9"] = 83] = "NumPad9";
    RainwayVirtualKey[RainwayVirtualKey["Multiply"] = 84] = "Multiply";
    RainwayVirtualKey[RainwayVirtualKey["Add"] = 85] = "Add";
    RainwayVirtualKey[RainwayVirtualKey["Separator"] = 86] = "Separator";
    RainwayVirtualKey[RainwayVirtualKey["Subtract"] = 87] = "Subtract";
    RainwayVirtualKey[RainwayVirtualKey["Decimal"] = 88] = "Decimal";
    RainwayVirtualKey[RainwayVirtualKey["Divide"] = 89] = "Divide";
    RainwayVirtualKey[RainwayVirtualKey["F1"] = 90] = "F1";
    RainwayVirtualKey[RainwayVirtualKey["F2"] = 91] = "F2";
    RainwayVirtualKey[RainwayVirtualKey["F3"] = 92] = "F3";
    RainwayVirtualKey[RainwayVirtualKey["F4"] = 93] = "F4";
    RainwayVirtualKey[RainwayVirtualKey["F5"] = 94] = "F5";
    RainwayVirtualKey[RainwayVirtualKey["F6"] = 95] = "F6";
    RainwayVirtualKey[RainwayVirtualKey["F7"] = 96] = "F7";
    RainwayVirtualKey[RainwayVirtualKey["F8"] = 97] = "F8";
    RainwayVirtualKey[RainwayVirtualKey["F9"] = 98] = "F9";
    RainwayVirtualKey[RainwayVirtualKey["F10"] = 99] = "F10";
    RainwayVirtualKey[RainwayVirtualKey["F11"] = 100] = "F11";
    RainwayVirtualKey[RainwayVirtualKey["F12"] = 101] = "F12";
    RainwayVirtualKey[RainwayVirtualKey["F13"] = 102] = "F13";
    RainwayVirtualKey[RainwayVirtualKey["F14"] = 103] = "F14";
    RainwayVirtualKey[RainwayVirtualKey["F15"] = 104] = "F15";
    RainwayVirtualKey[RainwayVirtualKey["F16"] = 105] = "F16";
    RainwayVirtualKey[RainwayVirtualKey["F17"] = 106] = "F17";
    RainwayVirtualKey[RainwayVirtualKey["F18"] = 107] = "F18";
    RainwayVirtualKey[RainwayVirtualKey["F19"] = 108] = "F19";
    RainwayVirtualKey[RainwayVirtualKey["F20"] = 109] = "F20";
    RainwayVirtualKey[RainwayVirtualKey["F21"] = 110] = "F21";
    RainwayVirtualKey[RainwayVirtualKey["F22"] = 111] = "F22";
    RainwayVirtualKey[RainwayVirtualKey["F23"] = 112] = "F23";
    RainwayVirtualKey[RainwayVirtualKey["F24"] = 113] = "F24";
    RainwayVirtualKey[RainwayVirtualKey["NumLock"] = 114] = "NumLock";
    RainwayVirtualKey[RainwayVirtualKey["Scroll"] = 115] = "Scroll";
    RainwayVirtualKey[RainwayVirtualKey["LeftShift"] = 116] = "LeftShift";
    RainwayVirtualKey[RainwayVirtualKey["RightShift"] = 117] = "RightShift";
    RainwayVirtualKey[RainwayVirtualKey["LeftCtrl"] = 118] = "LeftCtrl";
    RainwayVirtualKey[RainwayVirtualKey["RightCtrl"] = 119] = "RightCtrl";
    RainwayVirtualKey[RainwayVirtualKey["LeftAlt"] = 120] = "LeftAlt";
    RainwayVirtualKey[RainwayVirtualKey["RightAlt"] = 121] = "RightAlt";
    RainwayVirtualKey[RainwayVirtualKey["BrowserBack"] = 122] = "BrowserBack";
    RainwayVirtualKey[RainwayVirtualKey["BrowserForward"] = 123] = "BrowserForward";
    RainwayVirtualKey[RainwayVirtualKey["BrowserRefresh"] = 124] = "BrowserRefresh";
    RainwayVirtualKey[RainwayVirtualKey["BrowserStop"] = 125] = "BrowserStop";
    RainwayVirtualKey[RainwayVirtualKey["BrowserSearch"] = 126] = "BrowserSearch";
    RainwayVirtualKey[RainwayVirtualKey["BrowserFavorites"] = 127] = "BrowserFavorites";
    RainwayVirtualKey[RainwayVirtualKey["BrowserHome"] = 128] = "BrowserHome";
    RainwayVirtualKey[RainwayVirtualKey["VolumeMute"] = 129] = "VolumeMute";
    RainwayVirtualKey[RainwayVirtualKey["VolumeDown"] = 130] = "VolumeDown";
    RainwayVirtualKey[RainwayVirtualKey["VolumeUp"] = 131] = "VolumeUp";
    RainwayVirtualKey[RainwayVirtualKey["MediaNextTrack"] = 132] = "MediaNextTrack";
    RainwayVirtualKey[RainwayVirtualKey["MediaPreviousTrack"] = 133] = "MediaPreviousTrack";
    RainwayVirtualKey[RainwayVirtualKey["MediaStop"] = 134] = "MediaStop";
    RainwayVirtualKey[RainwayVirtualKey["MediaPlayPause"] = 135] = "MediaPlayPause";
    RainwayVirtualKey[RainwayVirtualKey["LaunchMail"] = 136] = "LaunchMail";
    RainwayVirtualKey[RainwayVirtualKey["SelectMedia"] = 137] = "SelectMedia";
    RainwayVirtualKey[RainwayVirtualKey["LaunchApplication1"] = 138] = "LaunchApplication1";
    RainwayVirtualKey[RainwayVirtualKey["LaunchApplication2"] = 139] = "LaunchApplication2";
    RainwayVirtualKey[RainwayVirtualKey["Oem1"] = 140] = "Oem1";
    RainwayVirtualKey[RainwayVirtualKey["OemPlus"] = 141] = "OemPlus";
    RainwayVirtualKey[RainwayVirtualKey["OemComma"] = 142] = "OemComma";
    RainwayVirtualKey[RainwayVirtualKey["OemMinus"] = 143] = "OemMinus";
    RainwayVirtualKey[RainwayVirtualKey["OemPeriod"] = 144] = "OemPeriod";
    RainwayVirtualKey[RainwayVirtualKey["Oem2"] = 145] = "Oem2";
    RainwayVirtualKey[RainwayVirtualKey["Oem3"] = 146] = "Oem3";
    RainwayVirtualKey[RainwayVirtualKey["AbntC1"] = 147] = "AbntC1";
    RainwayVirtualKey[RainwayVirtualKey["AbntC2"] = 148] = "AbntC2";
    RainwayVirtualKey[RainwayVirtualKey["Oem4"] = 149] = "Oem4";
    RainwayVirtualKey[RainwayVirtualKey["Oem5"] = 150] = "Oem5";
    RainwayVirtualKey[RainwayVirtualKey["Oem6"] = 151] = "Oem6";
    RainwayVirtualKey[RainwayVirtualKey["Oem7"] = 152] = "Oem7";
    RainwayVirtualKey[RainwayVirtualKey["Oem8"] = 153] = "Oem8";
    RainwayVirtualKey[RainwayVirtualKey["Oem102"] = 154] = "Oem102";
    RainwayVirtualKey[RainwayVirtualKey["ImeProcessed"] = 155] = "ImeProcessed";
    RainwayVirtualKey[RainwayVirtualKey["System"] = 156] = "System";
    RainwayVirtualKey[RainwayVirtualKey["OemAttn"] = 157] = "OemAttn";
    RainwayVirtualKey[RainwayVirtualKey["OemFinish"] = 158] = "OemFinish";
    RainwayVirtualKey[RainwayVirtualKey["OemCopy"] = 159] = "OemCopy";
    RainwayVirtualKey[RainwayVirtualKey["OemAuto"] = 160] = "OemAuto";
    RainwayVirtualKey[RainwayVirtualKey["OemEnlw"] = 161] = "OemEnlw";
    RainwayVirtualKey[RainwayVirtualKey["OemBackTab"] = 162] = "OemBackTab";
    RainwayVirtualKey[RainwayVirtualKey["Attn"] = 163] = "Attn";
    RainwayVirtualKey[RainwayVirtualKey["CrSel"] = 164] = "CrSel";
    RainwayVirtualKey[RainwayVirtualKey["ExSel"] = 165] = "ExSel";
    RainwayVirtualKey[RainwayVirtualKey["EraseEof"] = 166] = "EraseEof";
    RainwayVirtualKey[RainwayVirtualKey["Play"] = 167] = "Play";
    RainwayVirtualKey[RainwayVirtualKey["Zoom"] = 168] = "Zoom";
    RainwayVirtualKey[RainwayVirtualKey["NoName"] = 169] = "NoName";
    RainwayVirtualKey[RainwayVirtualKey["Pa1"] = 170] = "Pa1";
    RainwayVirtualKey[RainwayVirtualKey["OemClear"] = 171] = "OemClear";
    RainwayVirtualKey[RainwayVirtualKey["DeadCharProcessed"] = 172] = "DeadCharProcessed";
})(RainwayVirtualKey = exports.RainwayVirtualKey || (exports.RainwayVirtualKey = {}));
var RainwayButtonAction;
(function (RainwayButtonAction) {
    RainwayButtonAction[RainwayButtonAction["ButtonDown"] = 0] = "ButtonDown";
    RainwayButtonAction[RainwayButtonAction["ButtonUp"] = 1] = "ButtonUp";
})(RainwayButtonAction = exports.RainwayButtonAction || (exports.RainwayButtonAction = {}));
var RainwayMouseButton;
(function (RainwayMouseButton) {
    RainwayMouseButton[RainwayMouseButton["Left"] = 0] = "Left";
    RainwayMouseButton[RainwayMouseButton["Right"] = 1] = "Right";
    RainwayMouseButton[RainwayMouseButton["Middle"] = 2] = "Middle";
    RainwayMouseButton[RainwayMouseButton["X1"] = 3] = "X1";
    RainwayMouseButton[RainwayMouseButton["X2"] = 4] = "X2";
})(RainwayMouseButton = exports.RainwayMouseButton || (exports.RainwayMouseButton = {}));
var RainwayScrollAxis;
(function (RainwayScrollAxis) {
    RainwayScrollAxis[RainwayScrollAxis["Horizontal"] = 0] = "Horizontal";
    RainwayScrollAxis[RainwayScrollAxis["Vertical"] = 1] = "Vertical";
})(RainwayScrollAxis = exports.RainwayScrollAxis || (exports.RainwayScrollAxis = {}));
var RainwayKeyboardAction;
(function (RainwayKeyboardAction) {
    RainwayKeyboardAction[RainwayKeyboardAction["KeyDown"] = 0] = "KeyDown";
    RainwayKeyboardAction[RainwayKeyboardAction["KeyUp"] = 1] = "KeyUp";
})(RainwayKeyboardAction = exports.RainwayKeyboardAction || (exports.RainwayKeyboardAction = {}));
var RainwayPenFlags;
(function (RainwayPenFlags) {
    RainwayPenFlags[RainwayPenFlags["Barrel"] = 1] = "Barrel";
    RainwayPenFlags[RainwayPenFlags["Inverted"] = 2] = "Inverted";
    RainwayPenFlags[RainwayPenFlags["Eraser"] = 4] = "Eraser";
})(RainwayPenFlags = exports.RainwayPenFlags || (exports.RainwayPenFlags = {}));
var RainwayPenMask;
(function (RainwayPenMask) {
    RainwayPenMask[RainwayPenMask["Pressure"] = 1] = "Pressure";
    RainwayPenMask[RainwayPenMask["Rotation"] = 2] = "Rotation";
    RainwayPenMask[RainwayPenMask["TiltX"] = 4] = "TiltX";
    RainwayPenMask[RainwayPenMask["TiltY"] = 8] = "TiltY";
})(RainwayPenMask = exports.RainwayPenMask || (exports.RainwayPenMask = {}));
var RainwayInputLevel;
(function (RainwayInputLevel) {
    RainwayInputLevel[RainwayInputLevel["None"] = 0] = "None";
    RainwayInputLevel[RainwayInputLevel["GamepadPort1"] = 1] = "GamepadPort1";
    RainwayInputLevel[RainwayInputLevel["GamepadPort2"] = 2] = "GamepadPort2";
    RainwayInputLevel[RainwayInputLevel["GamepadPort3"] = 4] = "GamepadPort3";
    RainwayInputLevel[RainwayInputLevel["GamepadPort4"] = 8] = "GamepadPort4";
    RainwayInputLevel[RainwayInputLevel["Gamepad"] = 15] = "Gamepad";
    RainwayInputLevel[RainwayInputLevel["Mouse"] = 16] = "Mouse";
    RainwayInputLevel[RainwayInputLevel["Keyboard"] = 32] = "Keyboard";
    RainwayInputLevel[RainwayInputLevel["Clipboard"] = 64] = "Clipboard";
    RainwayInputLevel[RainwayInputLevel["All"] = 63] = "All";
})(RainwayInputLevel = exports.RainwayInputLevel || (exports.RainwayInputLevel = {}));
var RainwayError;
(function (RainwayError) {
    RainwayError[RainwayError["Success"] = 0] = "Success";
    RainwayError[RainwayError["Failure"] = 1] = "Failure";
    RainwayError[RainwayError["PeerNotCapableOfAppIsolation"] = 2] = "PeerNotCapableOfAppIsolation";
    RainwayError[RainwayError["InvalidParameter"] = 3] = "InvalidParameter";
    RainwayError[RainwayError["NoSuchStream"] = 4] = "NoSuchStream";
    RainwayError[RainwayError["NotByofb"] = 5] = "NotByofb";
    RainwayError[RainwayError["ByofbSessionNotReady"] = 6] = "ByofbSessionNotReady";
    RainwayError[RainwayError["NoEncoderVariant"] = 7] = "NoEncoderVariant";
    RainwayError[RainwayError["InvalidTextureFormat"] = 8] = "InvalidTextureFormat";
    RainwayError[RainwayError["InvalidCallback"] = 9] = "InvalidCallback";
    RainwayError[RainwayError["RuntimeNotInitialized"] = 10] = "RuntimeNotInitialized";
    RainwayError[RainwayError["NoSuchPeer"] = 11] = "NoSuchPeer";
    RainwayError[RainwayError["NoSuchConnection"] = 12] = "NoSuchConnection";
    RainwayError[RainwayError["BufferToSmall"] = 13] = "BufferToSmall";
    RainwayError[RainwayError["NoSuchChannel"] = 14] = "NoSuchChannel";
})(RainwayError = exports.RainwayError || (exports.RainwayError = {}));
var RainwayLogLevel;
(function (RainwayLogLevel) {
    RainwayLogLevel[RainwayLogLevel["Silent"] = 0] = "Silent";
    RainwayLogLevel[RainwayLogLevel["Error"] = 1] = "Error";
    RainwayLogLevel[RainwayLogLevel["Warning"] = 2] = "Warning";
    RainwayLogLevel[RainwayLogLevel["Info"] = 3] = "Info";
    RainwayLogLevel[RainwayLogLevel["Debug"] = 4] = "Debug";
    RainwayLogLevel[RainwayLogLevel["Trace"] = 5] = "Trace";
})(RainwayLogLevel = exports.RainwayLogLevel || (exports.RainwayLogLevel = {}));
var RainwayStreamType;
(function (RainwayStreamType) {
    RainwayStreamType[RainwayStreamType["Byofb"] = 0] = "Byofb";
    RainwayStreamType[RainwayStreamType["FullDesktop"] = 1] = "FullDesktop";
    RainwayStreamType[RainwayStreamType["AppIsolation"] = 2] = "AppIsolation";
})(RainwayStreamType = exports.RainwayStreamType || (exports.RainwayStreamType = {}));
var RainwayInput_Tag;
(function (RainwayInput_Tag) {
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputUnknown"] = 0] = "RainwayInputUnknown";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputGamepadReport"] = 1] = "RainwayInputGamepadReport";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputGamepadRumble"] = 2] = "RainwayInputGamepadRumble";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputMouseAbsolute"] = 3] = "RainwayInputMouseAbsolute";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputMouseRelative"] = 4] = "RainwayInputMouseRelative";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputMouseClick"] = 5] = "RainwayInputMouseClick";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputMouseScroll"] = 6] = "RainwayInputMouseScroll";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputKeyboardInput"] = 7] = "RainwayInputKeyboardInput";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputLogicalInput"] = 8] = "RainwayInputLogicalInput";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputTouchesAbsolute"] = 9] = "RainwayInputTouchesAbsolute";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputPenAbsolute"] = 10] = "RainwayInputPenAbsolute";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputViewportResize"] = 11] = "RainwayInputViewportResize";
    RainwayInput_Tag[RainwayInput_Tag["RainwayInputSetClipboardText"] = 12] = "RainwayInputSetClipboardText";
})(RainwayInput_Tag = exports.RainwayInput_Tag || (exports.RainwayInput_Tag = {}));
var RainwayOutboundStreamVideoBuffer_Tag;
(function (RainwayOutboundStreamVideoBuffer_Tag) {
    RainwayOutboundStreamVideoBuffer_Tag[RainwayOutboundStreamVideoBuffer_Tag["RainwayOutboundStreamVideoBufferDirectX"] = 0] = "RainwayOutboundStreamVideoBufferDirectX";
})(RainwayOutboundStreamVideoBuffer_Tag = exports.RainwayOutboundStreamVideoBuffer_Tag || (exports.RainwayOutboundStreamVideoBuffer_Tag = {}));
var RainwayAudioBuffer_Tag;
(function (RainwayAudioBuffer_Tag) {
    RainwayAudioBuffer_Tag[RainwayAudioBuffer_Tag["RainwayAudioBufferPcm"] = 0] = "RainwayAudioBufferPcm";
    RainwayAudioBuffer_Tag[RainwayAudioBuffer_Tag["RainwayAudioBufferFloat"] = 1] = "RainwayAudioBufferFloat";
})(RainwayAudioBuffer_Tag = exports.RainwayAudioBuffer_Tag || (exports.RainwayAudioBuffer_Tag = {}));
exports.uintptr_tDef = ref_napi_1.default.types.ulonglong;
exports.RainwayRuntimeDef = Pointer(ref_napi_1.default.types.void);
exports.RainwayTouchPenPointerInfoDef = Struct({
    pointerId: ref_napi_1.default.types.uint32,
    frameId: ref_napi_1.default.types.uint32,
    pointerFlags: ref_napi_1.default.types.uint32,
    x: ref_napi_1.default.types.int32,
    y: ref_napi_1.default.types.int32,
});
exports.RainwayTouchAbsoluteDef = Struct({
    pointerInfo: exports.RainwayTouchPenPointerInfoDef,
    touchMask: ref_napi_1.default.types.uint32,
    contactLeft: ref_napi_1.default.types.int32,
    contactTop: ref_napi_1.default.types.int32,
    contactRight: ref_napi_1.default.types.int32,
    contactBottom: ref_napi_1.default.types.int32,
    orientation: ref_napi_1.default.types.uint32,
    pressure: ref_napi_1.default.types.uint32,
});
exports.RainwayChannelModeDef = ref_napi_1.default.types.int;
exports.RainwayPeerStateDef = ref_napi_1.default.types.int;
exports.RainwayXInputButtonsDef = ref_napi_1.default.types.int;
exports.RainwayVirtualKeyDef = ref_napi_1.default.types.int;
exports.RainwayButtonActionDef = ref_napi_1.default.types.int;
exports.RainwayMouseButtonDef = ref_napi_1.default.types.int;
exports.RainwayScrollAxisDef = ref_napi_1.default.types.int;
exports.RainwayKeyboardActionDef = ref_napi_1.default.types.int;
exports.RainwayPenFlagsDef = ref_napi_1.default.types.int;
exports.RainwayPenMaskDef = ref_napi_1.default.types.int;
exports.RainwayInputLevelDef = ref_napi_1.default.types.int;
exports.RainwayErrorDef = ref_napi_1.default.types.int;
exports.RainwayLogLevelDef = ref_napi_1.default.types.int;
exports.RainwayStreamTypeDef = ref_napi_1.default.types.int;
exports.RainwayNullable_c_charDef = ref_napi_1.default.types.CString;
exports.RainwayInitConfigDef = Struct({
    userAgent: exports.RainwayNullable_c_charDef,
});
exports.RainwayNullable_RainwayInitConfigDef = Pointer(exports.RainwayInitConfigDef);
exports.RainwayLogSinkDef = ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
    exports.RainwayLogLevelDef,
    ref_napi_1.default.types.CString,
    ref_napi_1.default.types.CString,
]);
exports.RainwayCreateConnectionAdvancedOptionsDef = Struct({
    endpoint: exports.RainwayNullable_c_charDef,
    forceNewId: ref_napi_1.default.types.bool,
});
exports._RainwayUserDataDef = Pointer(ref_napi_1.default.types.void);
exports.RainwayUserDataDef = Struct({
    data: exports._RainwayUserDataDef,
    drop: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [exports._RainwayUserDataDef]),
});
exports.RainwayPeerIdDef = ref_napi_1.default.types.int64;
exports.RainwayAsyncCallback_RainwayPeerId__RainwayErrorDef = Struct({
    callbackUserData: exports.RainwayUserDataDef,
    successCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayPeerIdDef,
    ]),
    failureCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayErrorDef,
    ]),
});
exports.RainwayCreateConnectionOptionsDef = Struct({
    apiKey: exports.RainwayNullable_c_charDef,
    externalId: exports.RainwayNullable_c_charDef,
    advanced: exports.RainwayCreateConnectionAdvancedOptionsDef,
    callbackState: exports.RainwayAsyncCallback_RainwayPeerId__RainwayErrorDef,
});
exports.RainwayNullable_RainwayCreateConnectionOptionsDef = Pointer(exports.RainwayCreateConnectionOptionsDef);
exports.RainwayPeerOptionsDef = Struct({
    portMin: ref_napi_1.default.types.uint16,
    portMax: ref_napi_1.default.types.uint16,
});
exports.RainwayVoidDef = ref_napi_1.default.types.int32;
exports.RainwayAsyncCallback_RainwayVoid__RainwayErrorDef = Struct({
    callbackUserData: exports.RainwayUserDataDef,
    successCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayVoidDef,
    ]),
    failureCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayErrorDef,
    ]),
});
exports.RainwayConnectionConnectToPeerOptionsDef = Struct({
    connectionId: exports.RainwayPeerIdDef,
    peerId: exports.RainwayPeerIdDef,
    options: exports.RainwayPeerOptionsDef,
    callbackState: exports.RainwayAsyncCallback_RainwayVoid__RainwayErrorDef,
});
exports.RainwayIncomingConnectionRequestDef = Struct({
    id: exports.RainwayPeerIdDef,
    externalId: ref_napi_1.default.types.CString,
});
exports._RainwayEventHandler_RainwayIncomingConnectionRequest__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayIncomingConnectionRequestDef,
    ]),
});
exports.RainwayEventHandler_RainwayIncomingConnectionRequestDef = exports._RainwayEventHandler_RainwayIncomingConnectionRequest__RainwayVoidDef;
exports.RainwayConnectionPeerConnectionRequestHandlerDef = exports.RainwayEventHandler_RainwayIncomingConnectionRequestDef;
exports.RainwayNullable_RainwayPeerIdDef = Pointer(exports.RainwayPeerIdDef);
exports.RainwayNullable_u32Def = Pointer(ref_napi_1.default.types.uint32);
exports._RainwayEventHandler_RainwayPeerState__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayPeerStateDef,
    ]),
});
exports.RainwayEventHandler_RainwayPeerStateDef = exports._RainwayEventHandler_RainwayPeerState__RainwayVoidDef;
exports.RainwayPeerConnectionStateChangedHandlerDef = exports.RainwayEventHandler_RainwayPeerStateDef;
exports.RainwayStreamRequestEventDef = Struct({
    inputLevel: exports.RainwayInputLevelDef,
    supportsAppIsolation: ref_napi_1.default.types.bool,
});
exports._RainwayEventHandler_RainwayStreamRequestEvent__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayStreamRequestEventDef,
    ]),
});
exports.RainwayEventHandler_RainwayStreamRequestEventDef = exports._RainwayEventHandler_RainwayStreamRequestEvent__RainwayVoidDef;
exports.RainwayPeerconnectionOutboundStreamRequestHandlerDef = exports.RainwayEventHandler_RainwayStreamRequestEventDef;
exports.RainwayDataChannelOpenedEventDef = Struct({
    name: ref_napi_1.default.types.CString,
    mode: exports.RainwayChannelModeDef,
});
exports._RainwayEventHandler_RainwayDataChannelOpenedEvent__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayDataChannelOpenedEventDef,
    ]),
});
exports.RainwayEventHandler_RainwayDataChannelOpenedEventDef = exports._RainwayEventHandler_RainwayDataChannelOpenedEvent__RainwayVoidDef;
exports.RainwayPeerConnectionDataChannelOpenedHandlerDef = exports.RainwayEventHandler_RainwayDataChannelOpenedEventDef;
exports.RainwayDataChannelDataEventDef = Struct({
    data: Pointer(ref_napi_1.default.types.uint8),
    len: exports.uintptr_tDef,
});
exports._RainwayEventHandler_RainwayDataChannelDataEvent__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayDataChannelDataEventDef,
    ]),
});
exports.RainwayEventHandler_RainwayDataChannelDataEventDef = exports._RainwayEventHandler_RainwayDataChannelDataEvent__RainwayVoidDef;
exports.RainwayPeerConnectionDataChannelDataHandlerDef = exports.RainwayEventHandler_RainwayDataChannelDataEventDef;
exports.RainwayStreamIdDef = ref_napi_1.default.types.uint8;
exports.RainwayInput_TagDef = ref_napi_1.default.types.int;
exports.RainwayGamepadReport_BodyDef = Struct({
    buttons: exports.RainwayXInputButtonsDef,
    leftTrigger: ref_napi_1.default.types.uint8,
    rightTrigger: ref_napi_1.default.types.uint8,
    leftThumbX: ref_napi_1.default.types.int16,
    leftThumbY: ref_napi_1.default.types.int16,
    rightThumbX: ref_napi_1.default.types.int16,
    rightThumbY: ref_napi_1.default.types.int16,
    slot: ref_napi_1.default.types.uint8,
});
exports.RainwayGamepadRumble_BodyDef = Struct({
    port: ref_napi_1.default.types.uint8,
    leftMotorSpeed: ref_napi_1.default.types.uint16,
    rightMotorSpeed: ref_napi_1.default.types.uint16,
});
exports.RainwayMouseAbsolute_BodyDef = Struct({
    x: ref_napi_1.default.types.int32,
    y: ref_napi_1.default.types.int32,
});
exports.RainwayMouseRelative_BodyDef = Struct({
    dx: ref_napi_1.default.types.int32,
    dy: ref_napi_1.default.types.int32,
});
exports.RainwayMouseClick_BodyDef = Struct({
    action: exports.RainwayButtonActionDef,
    button: exports.RainwayMouseButtonDef,
});
exports.RainwayMouseScroll_BodyDef = Struct({
    axis: exports.RainwayScrollAxisDef,
    delta: ref_napi_1.default.types.int32,
});
exports.RainwayKeyboardInput_BodyDef = Struct({
    action: exports.RainwayKeyboardActionDef,
    keycode: exports.RainwayVirtualKeyDef,
});
exports.RainwayLogicalInput_BodyDef = Struct({
    inputString: ref_napi_1.default.types.CString,
});
exports.RainwayTouchesAbsolute_BodyDef = Struct({
    touches: Pointer(exports.RainwayTouchAbsoluteDef),
    numTouches: exports.uintptr_tDef,
});
exports.RainwayPenAbsolute_BodyDef = Struct({
    pointerId: ref_napi_1.default.types.uint32,
    frameId: ref_napi_1.default.types.uint32,
    pointerFlags: ref_napi_1.default.types.uint32,
    x: ref_napi_1.default.types.int32,
    y: ref_napi_1.default.types.int32,
    penFlags: exports.RainwayPenFlagsDef,
    penMask: exports.RainwayPenMaskDef,
    pressure: ref_napi_1.default.types.uint32,
    rotation: ref_napi_1.default.types.uint32,
    tiltX: ref_napi_1.default.types.int32,
    tiltY: ref_napi_1.default.types.int32,
});
exports.RainwayViewportResize_BodyDef = Struct({
    width: ref_napi_1.default.types.uint32,
    height: ref_napi_1.default.types.uint32,
});
exports.RainwaySetClipboardText_BodyDef = Struct({
    text: ref_napi_1.default.types.CString,
});
exports.RainwayInput_UnionDef = Union({
    GAMEPAD_REPORT: exports.RainwayGamepadReport_BodyDef,
    GAMEPAD_RUMBLE: exports.RainwayGamepadRumble_BodyDef,
    MOUSE_ABSOLUTE: exports.RainwayMouseAbsolute_BodyDef,
    MOUSE_RELATIVE: exports.RainwayMouseRelative_BodyDef,
    MOUSE_CLICK: exports.RainwayMouseClick_BodyDef,
    MOUSE_SCROLL: exports.RainwayMouseScroll_BodyDef,
    KEYBOARD_INPUT: exports.RainwayKeyboardInput_BodyDef,
    LOGICAL_INPUT: exports.RainwayLogicalInput_BodyDef,
    TOUCHES_ABSOLUTE: exports.RainwayTouchesAbsolute_BodyDef,
    PEN_ABSOLUTE: exports.RainwayPenAbsolute_BodyDef,
    VIEWPORT_RESIZE: exports.RainwayViewportResize_BodyDef,
    SET_CLIPBOARD_TEXT: exports.RainwaySetClipboardText_BodyDef,
});
exports.RainwayInputDef = Struct({
    tag: exports.RainwayInput_TagDef,
    union: exports.RainwayInput_UnionDef,
});
exports.RainwayInputEventDef = Struct({
    peer: exports.RainwayPeerIdDef,
    stream: exports.RainwayStreamIdDef,
    input: Pointer(exports.RainwayInputDef),
    heldKeys: Pointer(exports.RainwayVirtualKeyDef),
    numHeldKeys: exports.uintptr_tDef,
});
exports._RainwayEventHandler_RainwayInputEvent__boolDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(ref_napi_1.default.types.bool, [
        exports._RainwayUserDataDef,
        exports.RainwayInputEventDef,
    ]),
});
exports.RainwayEventHandlerRet_RainwayInputEvent__boolDef = exports._RainwayEventHandler_RainwayInputEvent__boolDef;
exports.RainwayInputFilterDef = exports.RainwayEventHandlerRet_RainwayInputEvent__boolDef;
exports.RainwayAsyncCallback_RainwayStreamId__RainwayErrorDef = Struct({
    callbackUserData: exports.RainwayUserDataDef,
    successCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayStreamIdDef,
    ]),
    failureCallback: ffi_napi_1.default.Function(ref_napi_1.default.types.void, [
        exports._RainwayUserDataDef,
        exports.RainwayErrorDef,
    ]),
});
exports.RainwayStreamStartOptionsDef = Struct({
    type: exports.RainwayStreamTypeDef,
    defaultPermissions: exports.RainwayInputLevelDef,
    inputFilter: exports.RainwayInputFilterDef,
    processIds: exports.RainwayNullable_u32Def,
    processIdsLen: exports.uintptr_tDef,
    callbackState: exports.RainwayAsyncCallback_RainwayStreamId__RainwayErrorDef,
});
exports.RainwayNullable_RawTextureDef = Pointer(ref_napi_1.default.types.void);
exports.RainwayOutboundStreamVideoBuffer_TagDef = ref_napi_1.default.types.int;
exports.RainwayDirectX_BodyDef = Struct({
    buffer: exports.RainwayNullable_RawTextureDef,
});
exports.RainwayOutboundStreamVideoBuffer_UnionDef = Union({
    DIRECT_X: exports.RainwayDirectX_BodyDef,
});
exports.RainwayOutboundStreamVideoBufferDef = Struct({
    tag: exports.RainwayOutboundStreamVideoBuffer_TagDef,
    union: exports.RainwayOutboundStreamVideoBuffer_UnionDef,
});
exports.RainwayNullable_i16Def = Pointer(ref_napi_1.default.types.int16);
exports.RainwayPcmAudioBufferDef = exports.RainwayNullable_i16Def;
exports.RainwayNullable_f32Def = Pointer(ref_napi_1.default.types.float);
exports.RainwayFloatAudioBufferDef = exports.RainwayNullable_f32Def;
exports.RainwayAudioBuffer_TagDef = ref_napi_1.default.types.int;
exports.RainwayPCM_BodyDef = Struct({
    buffer: exports.RainwayPcmAudioBufferDef,
});
exports.RainwayFloat_BodyDef = Struct({
    buffer: exports.RainwayFloatAudioBufferDef,
});
exports.RainwayAudioBuffer_UnionDef = Union({
    PCM: exports.RainwayPCM_BodyDef,
    FLOAT: exports.RainwayFloat_BodyDef,
});
exports.RainwayAudioBufferDef = Struct({
    tag: exports.RainwayAudioBuffer_TagDef,
    union: exports.RainwayAudioBuffer_UnionDef,
});
exports.RainwayOutboundStreamAudioOptionsDef = Struct({
    samplesPerSec: ref_napi_1.default.types.uint32,
    channels: ref_napi_1.default.types.uint16,
    sampleCount: ref_napi_1.default.types.uint32,
    buffer: exports.RainwayAudioBufferDef,
});
exports._RainwayEventHandler_RainwayPeerId__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayPeerIdDef,
    ]),
});
exports.RainwayEventHandler_RainwayPeerIdDef = exports._RainwayEventHandler_RainwayPeerId__RainwayVoidDef;
exports.RainwayStreamPeerJoinLeaveHandlerDef = exports.RainwayEventHandler_RainwayPeerIdDef;
exports._RainwayEventHandler_RainwayVoid__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [exports._RainwayUserDataDef, exports.RainwayVoidDef]),
});
exports.RainwayEventHandler_RainwayVoidDef = exports._RainwayEventHandler_RainwayVoid__RainwayVoidDef;
exports.RainwayStreamCloseHandlerDef = exports.RainwayEventHandler_RainwayVoidDef;
exports.RainwayNullable_RainwayInputLevelDef = Pointer(exports.RainwayInputLevelDef);
exports.RainwayByofbInputEventDef = Struct({
    peerId: exports.RainwayPeerIdDef,
    input: exports.RainwayInputDef,
});
exports._RainwayEventHandler_RainwayByofbInputEvent__RainwayVoidDef = Struct({
    userData: exports.RainwayUserDataDef,
    handler: ffi_napi_1.default.Function(exports.RainwayVoidDef, [
        exports._RainwayUserDataDef,
        exports.RainwayByofbInputEventDef,
    ]),
});
exports.RainwayEventHandler_RainwayByofbInputEventDef = exports._RainwayEventHandler_RainwayByofbInputEvent__RainwayVoidDef;
exports.RainwayStreamByofbInputHandlerDef = exports.RainwayEventHandler_RainwayByofbInputEventDef;
exports.RainwayPeerConnectionCreateDataChannelOptionsDef = Struct({
    connectionId: exports.RainwayPeerIdDef,
    peerId: exports.RainwayPeerIdDef,
    name: exports.RainwayNullable_c_charDef,
    mode: exports.RainwayChannelModeDef,
    callbackState: exports.RainwayAsyncCallback_RainwayVoid__RainwayErrorDef,
});
exports.RainwayNullable_u8Def = Pointer(ref_napi_1.default.types.uint8);
function dlopen(libPath) {
    return ffi_napi_1.default.Library(libPath, {
        rainway_version: [ref_napi_1.default.types.CString, []],
        rainway_init: [exports.RainwayErrorDef, [exports.RainwayNullable_RainwayInitConfigDef]],
        rainway_shutdown: [ref_napi_1.default.types.void, []],
        rainway_set_log_level: [
            ref_napi_1.default.types.void,
            [exports.RainwayLogLevelDef, ref_napi_1.default.types.CString],
        ],
        rainway_set_log_sink: [ref_napi_1.default.types.void, [exports.RainwayLogSinkDef]],
        rainway_create_connection: [
            exports.RainwayErrorDef,
            [exports.RainwayNullable_RainwayCreateConnectionOptionsDef],
        ],
        rainway_close_connection: [exports.RainwayErrorDef, [exports.RainwayPeerIdDef]],
        rainway_connection_connect_to_peer: [
            exports.RainwayErrorDef,
            [exports.RainwayConnectionConnectToPeerOptionsDef],
        ],
        rainway_connection_set_connection_request_handler: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerIdDef, exports.RainwayConnectionPeerConnectionRequestHandlerDef],
        ],
        rainway_connection_accept_request: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayPeerOptionsDef,
                exports.RainwayAsyncCallback_RainwayPeerId__RainwayErrorDef,
            ],
        ],
        rainway_connection_reject_request: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerIdDef, exports.RainwayPeerIdDef, exports.RainwayNullable_c_charDef],
        ],
        rainway_connection_get_peers: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayNullable_RainwayPeerIdDef,
                exports.RainwayNullable_u32Def,
            ],
        ],
        rainway_peer_connection_set_state_change_handler: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayPeerConnectionStateChangedHandlerDef,
            ],
        ],
        rainway_peer_connection_set_stream_request_handler: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayPeerconnectionOutboundStreamRequestHandlerDef,
            ],
        ],
        rainway_peer_connection_set_data_channel_opened_handler: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayPeerConnectionDataChannelOpenedHandlerDef,
            ],
        ],
        rainway_peer_connection_set_data_channel_data_handler: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayNullable_c_charDef,
                exports.RainwayPeerConnectionDataChannelDataHandlerDef,
            ],
        ],
        rainway_peer_connection_get_external_id: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayNullable_c_charDef,
                exports.RainwayNullable_u32Def,
            ],
        ],
        rainway_peer_connection_close: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerIdDef, exports.RainwayPeerIdDef],
        ],
        rainway_peer_connection_accept_stream_request: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerIdDef, exports.RainwayPeerIdDef, exports.RainwayStreamStartOptionsDef],
        ],
        rainway_peer_connection_reject_stream_request: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerIdDef, exports.RainwayPeerIdDef, exports.RainwayNullable_c_charDef],
        ],
        rainway_outbound_stream_submit_video: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayOutboundStreamVideoBufferDef],
        ],
        rainway_outbound_stream_submit_audio: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayOutboundStreamAudioOptionsDef],
        ],
        rainway_outbound_stream_set_peer_join_handler: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayStreamPeerJoinLeaveHandlerDef],
        ],
        rainway_outbound_stream_set_peer_leave_handler: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayStreamPeerJoinLeaveHandlerDef],
        ],
        rainway_outbound_stream_set_close_handler: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayStreamCloseHandlerDef],
        ],
        rainway_outbound_stream_get_peer_default_permissions: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayNullable_RainwayInputLevelDef],
        ],
        rainway_outbound_stream_set_peer_default_permissions: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayInputLevelDef],
        ],
        rainway_outbound_stream_get_peer_permissions: [
            exports.RainwayErrorDef,
            [
                exports.RainwayStreamIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayNullable_RainwayInputLevelDef,
            ],
        ],
        rainway_outbound_stream_set_peer_permissions: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayPeerIdDef, exports.RainwayInputLevelDef],
        ],
        rainway_outbound_stream_close: [exports.RainwayErrorDef, [exports.RainwayStreamIdDef]],
        rainway_outbound_stream_set_input_filter: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayInputFilterDef],
        ],
        rainway_outbound_stream_set_input_handler: [
            exports.RainwayErrorDef,
            [exports.RainwayStreamIdDef, exports.RainwayStreamByofbInputHandlerDef],
        ],
        rainway_peer_connection_create_data_channel: [
            exports.RainwayErrorDef,
            [exports.RainwayPeerConnectionCreateDataChannelOptionsDef],
        ],
        rainway_peer_connection_data_channel_send: [
            exports.RainwayErrorDef,
            [
                exports.RainwayPeerIdDef,
                exports.RainwayPeerIdDef,
                exports.RainwayNullable_c_charDef,
                exports.RainwayNullable_u8Def,
                ref_napi_1.default.types.uint32,
            ],
        ],
    });
}
exports.dlopen = dlopen;
//# sourceMappingURL=rainway-ffi.js.map