one
Version:
One is a React framework for web, iOS, and Android apps.
32 lines (29 loc) • 956 B
JavaScript
import { validateCallback } from "../validateCallback.native.js";
import { NitroModules } from "react-native-nitro-modules";
import { rethrowNativeError } from "../nativeError.native.js";
var hybrid;
function native() {
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneScreenOrientation");
return hybrid;
}
function getOrientation() {
return native().getOrientation().catch(rethrowNativeError);
}
function lock(orientation) {
return native().lock(orientation).catch(rethrowNativeError);
}
function unlock() {
return native().unlock().catch(rethrowNativeError);
}
function addChangeListener(onChange) {
validateCallback(onChange, "ScreenOrientation.addChangeListener requires a function");
return native().addChangeListener(onChange);
}
var ScreenOrientation = Object.freeze({
getOrientation,
lock,
unlock,
addChangeListener
});
export { ScreenOrientation };
//# sourceMappingURL=index.native.js.map