UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

70 lines (67 loc) • 1.9 kB
import { NitroModules } from "react-native-nitro-modules"; import { rethrowNativeError } from "../nativeError.native.js"; import { assertBrightnessListener, assertBrightnessValue, assertSystemMode } from "./validate.native.js"; var hybrid; function native() { hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneBrightness"); return hybrid; } function get() { return native().get().catch(rethrowNativeError); } function set(value) { assertBrightnessValue(value, "Brightness.set"); return native().set(value).catch(rethrowNativeError); } function getSystem() { return native().getSystem().catch(rethrowNativeError); } function setSystem(value) { assertBrightnessValue(value, "Brightness.setSystem"); return native().setSystem(value).catch(rethrowNativeError); } function getSystemMode() { return native().getSystemMode().catch(rethrowNativeError); } function setSystemMode(mode) { assertSystemMode(mode); return native().setSystemMode(mode).catch(rethrowNativeError); } function isUsingSystem() { return native().isUsingSystem().catch(rethrowNativeError); } function restoreSystem() { return native().restoreSystem().catch(rethrowNativeError); } function getPermissions() { return native().getPermissions().catch(rethrowNativeError); } function requestPermissions() { return native().requestPermissions().catch(rethrowNativeError); } function isAvailable() { return native().isAvailable(); } function addListener(listener) { assertBrightnessListener(listener); var remove = native().addListener(listener); return { remove: function remove1() { return remove(); } }; } var Brightness = Object.freeze({ get, set, getSystem, setSystem, getSystemMode, setSystemMode, isUsingSystem, restoreSystem, getPermissions, requestPermissions, isAvailable, addListener }); export { Brightness }; //# sourceMappingURL=index.native.js.map