UNPKG

one

Version:

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

40 lines (37 loc) • 1.15 kB
import { NitroModules } from "react-native-nitro-modules"; import { rethrowNativeError } from "../nativeError.native.js"; import { assertStepCountListener, assertStepCountRange } from "./validate.native.js"; var hybrid; function native() { hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OnePedometer"); return hybrid; } function isAvailable() { return native().isAvailable(); } function watchStepCount(listener) { assertStepCountListener(listener); var remove = native().watchStepCount(listener); return { remove: function remove1() { return remove(); } }; } function getStepCount(start, end) { assertStepCountRange(start, end); return native().getStepCount(start.getTime(), end.getTime()).catch(rethrowNativeError); } function getPermissions() { return native().getPermissions().catch(rethrowNativeError); } function requestPermissions() { return native().requestPermissions().catch(rethrowNativeError); } var Pedometer = Object.freeze({ isAvailable, watchStepCount, getStepCount, getPermissions, requestPermissions }); export { Pedometer }; //# sourceMappingURL=index.native.js.map