UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

267 lines 11.1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); // generarted by genProto.ts const protobufjs_1 = require("protobufjs"); const ThirdUtils_1 = __importDefault(require("../ThirdUtils")); let singleton = null; let root; class STFServiceBuf { static async internalInit() { const proto = ThirdUtils_1.default.getResourcePath('wireService.proto'); const _root = await (0, protobufjs_1.load)(proto); root = _root; return new STFServiceBuf(_root); } static get() { if (!singleton) singleton = this.internalInit(); return singleton; } constructor(_root) { this._root = _root; this.write = { Envelope(env) { const type = root.lookupType('Envelope'); return Buffer.from(type.encodeDelimited(env).finish()); }, GetVersionRequest(req) { const type = root.lookupType('GetVersionRequest'); return Buffer.from(type.encode(req).finish()); }, SetKeyguardStateRequest(req) { const type = root.lookupType('SetKeyguardStateRequest'); return Buffer.from(type.encode(req).finish()); }, SetWakeLockRequest(req) { const type = root.lookupType('SetWakeLockRequest'); return Buffer.from(type.encode(req).finish()); }, SetClipboardRequest(req) { const type = root.lookupType('SetClipboardRequest'); return Buffer.from(type.encode(req).finish()); }, GetClipboardRequest(req) { const type = root.lookupType('GetClipboardRequest'); return Buffer.from(type.encode(req).finish()); }, GetBrowsersRequest(req) { const type = root.lookupType('GetBrowsersRequest'); return Buffer.from(type.encode(req).finish()); }, GetDisplayRequest(req) { const type = root.lookupType('GetDisplayRequest'); return Buffer.from(type.encode(req).finish()); }, GetPropertiesRequest(req) { const type = root.lookupType('GetPropertiesRequest'); return Buffer.from(type.encode(req).finish()); }, DoIdentifyRequest(req) { const type = root.lookupType('DoIdentifyRequest'); return Buffer.from(type.encode(req).finish()); }, GetAccountsRequest(req) { const type = root.lookupType('GetAccountsRequest'); return Buffer.from(type.encode(req).finish()); }, DoAddAccountMenuRequest(req) { const type = root.lookupType('DoAddAccountMenuRequest'); return Buffer.from(type.encode(req).finish()); }, DoRemoveAccountRequest(req) { const type = root.lookupType('DoRemoveAccountRequest'); return Buffer.from(type.encode(req).finish()); }, SetRingerModeRequest(req) { const type = root.lookupType('SetRingerModeRequest'); return Buffer.from(type.encode(req).finish()); }, GetRingerModeRequest(req) { const type = root.lookupType('GetRingerModeRequest'); return Buffer.from(type.encode(req).finish()); }, SetWifiEnabledRequest(req) { const type = root.lookupType('SetWifiEnabledRequest'); return Buffer.from(type.encode(req).finish()); }, GetWifiStatusRequest(req) { const type = root.lookupType('GetWifiStatusRequest'); return Buffer.from(type.encode(req).finish()); }, GetRootStatusRequest(req) { const type = root.lookupType('GetRootStatusRequest'); return Buffer.from(type.encode(req).finish()); }, SetBluetoothEnabledRequest(req) { const type = root.lookupType('SetBluetoothEnabledRequest'); return Buffer.from(type.encode(req).finish()); }, GetBluetoothStatusRequest(req) { const type = root.lookupType('GetBluetoothStatusRequest'); return Buffer.from(type.encode(req).finish()); }, GetSdStatusRequest(req) { const type = root.lookupType('GetSdStatusRequest'); return Buffer.from(type.encode(req).finish()); }, SetMasterMuteRequest(req) { const type = root.lookupType('SetMasterMuteRequest'); return Buffer.from(type.encode(req).finish()); }, KeyEventRequest(req) { const type = root.lookupType('KeyEventRequest'); return Buffer.from(type.encode(req).finish()); }, DoTypeRequest(req) { const type = root.lookupType('DoTypeRequest'); return Buffer.from(type.encode(req).finish()); }, SetRotationRequest(req) { const type = root.lookupType('SetRotationRequest'); return Buffer.from(type.encode(req).finish()); }, DoWakeRequest(req) { const type = root.lookupType('DoWakeRequest'); return Buffer.from(type.encode(req).finish()); }, }; this.read = { Envelope(data) { const type = root.lookupType('Envelope'); return type.decode(data); }, AirplaneModeEvent(data) { const type = root.lookupType('AirplaneModeEvent'); return type.decode(data); }, BatteryEvent(data) { const type = root.lookupType('BatteryEvent'); return type.decode(data); }, BrowserApp(data) { const type = root.lookupType('BrowserApp'); return type.decode(data); }, BrowserPackageEvent(data) { const type = root.lookupType('BrowserPackageEvent'); return type.decode(data); }, ConnectivityEvent(data) { const type = root.lookupType('ConnectivityEvent'); return type.decode(data); }, PhoneStateEvent(data) { const type = root.lookupType('PhoneStateEvent'); return type.decode(data); }, RotationEvent(data) { const type = root.lookupType('RotationEvent'); return type.decode(data); }, GetVersionResponse(data) { const type = root.lookupType('GetVersionResponse'); return type.decode(data); }, SetKeyguardStateResponse(data) { const type = root.lookupType('SetKeyguardStateResponse'); return type.decode(data); }, SetWakeLockResponse(data) { const type = root.lookupType('SetWakeLockResponse'); return type.decode(data); }, SetClipboardResponse(data) { const type = root.lookupType('SetClipboardResponse'); return type.decode(data); }, GetClipboardResponse(data) { const type = root.lookupType('GetClipboardResponse'); return type.decode(data); }, GetBrowsersResponse(data) { const type = root.lookupType('GetBrowsersResponse'); return type.decode(data); }, GetDisplayResponse(data) { const type = root.lookupType('GetDisplayResponse'); return type.decode(data); }, Property(data) { const type = root.lookupType('Property'); return type.decode(data); }, GetPropertiesResponse(data) { const type = root.lookupType('GetPropertiesResponse'); return type.decode(data); }, DoIdentifyResponse(data) { const type = root.lookupType('DoIdentifyResponse'); return type.decode(data); }, GetAccountsResponse(data) { const type = root.lookupType('GetAccountsResponse'); return type.decode(data); }, DoAddAccountMenuResponse(data) { const type = root.lookupType('DoAddAccountMenuResponse'); return type.decode(data); }, DoRemoveAccountResponse(data) { const type = root.lookupType('DoRemoveAccountResponse'); return type.decode(data); }, SetRingerModeResponse(data) { const type = root.lookupType('SetRingerModeResponse'); return type.decode(data); }, GetRingerModeResponse(data) { const type = root.lookupType('GetRingerModeResponse'); return type.decode(data); }, SetWifiEnabledResponse(data) { const type = root.lookupType('SetWifiEnabledResponse'); return type.decode(data); }, GetWifiStatusResponse(data) { const type = root.lookupType('GetWifiStatusResponse'); return type.decode(data); }, GetRootStatusResponse(data) { const type = root.lookupType('GetRootStatusResponse'); return type.decode(data); }, SetBluetoothEnabledResponse(data) { const type = root.lookupType('SetBluetoothEnabledResponse'); return type.decode(data); }, GetBluetoothStatusResponse(data) { const type = root.lookupType('GetBluetoothStatusResponse'); return type.decode(data); }, GetSdStatusResponse(data) { const type = root.lookupType('GetSdStatusResponse'); return type.decode(data); }, SetMasterMuteResponse(data) { const type = root.lookupType('SetMasterMuteResponse'); return type.decode(data); }, }; } get root() { return this._root; } readEnvelope(data) { const type = root.lookupType('Envelope'); return type.decode(data); } readEnvelopeDelimited(data) { const type = root.lookupType('Envelope'); return type.decodeDelimited(data); } } exports.default = STFServiceBuf; //# sourceMappingURL=STFServiceBuf.js.map