UNPKG

one

Version:

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

49 lines (46 loc) • 1.38 kB
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("OneContacts"); return hybrid; } function getPermissionStatus() { try { return native().getPermissionStatus(); } catch (error) { return rethrowNativeError(error); } } function requestPermission() { return native().requestPermission().catch(rethrowNativeError); } function pickContact() { return native().pickContact().then(function(contact) { return contact !== null && contact !== void 0 ? contact : void 0; }).catch(rethrowNativeError); } function search(name) { var limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return native().search(name, limit).catch(rethrowNativeError); } function create(input) { return native().create(input).catch(rethrowNativeError); } function update(identifier, changes) { return native().update(identifier, changes).catch(rethrowNativeError); } function deleteContact(identifier) { return native().remove(identifier).catch(rethrowNativeError); } var Contacts = Object.freeze({ getPermissionStatus, requestPermission, pickContact, search, create, update, delete: deleteContact }); export { Contacts }; //# sourceMappingURL=index.native.js.map