UNPKG

react-native-bluetooth-state-manager

Version:

Manage the bluetooth state of your device

38 lines (37 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BluetoothStateManager = void 0; var _reactNativeNitroModules = require("react-native-nitro-modules"); const _module = _reactNativeNitroModules.NitroModules.createHybridObject('BluetoothStateManager'); const BluetoothStateManager = exports.BluetoothStateManager = { getState: () => _module.getState(), getStateSync: () => _module.getStateSync(), /** * Opens the bluetooth settings page */ openSettings: () => _module.openSettings(), /** * Get called whenever the bluetooth state changes */ addListener: (callback, emitCurrentState = true) => { if (emitCurrentState) { callback(_module.getStateSync()); } const callbackRef = _module.addListener(callback); return () => { _module.removeListener(callbackRef); }; }, /** * Requests the user to enable bluetooth */ requestToEnable: () => _module.requestToEnable(), /** * Requests the user to disable bluetooth */ requestToDisable: () => _module.requestToDisable(), dispose: () => _module.dispose() }; //# sourceMappingURL=BluetoothStateManager.js.map