one
Version:
One is a React framework for web, iOS, and Android apps.
77 lines (74 loc) • 2.46 kB
JavaScript
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("OneCalendar");
return hybrid;
}
function getPermissionStatus() {
try {
return native().getPermissionStatus();
} catch (error) {
return rethrowNativeError(error);
}
}
function requestPermission() {
return native().requestPermission().catch(rethrowNativeError);
}
function list(startMs, endMs) {
var limit = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 100;
return native().list(startMs, endMs, limit).catch(rethrowNativeError);
}
function create(input) {
var _input_allDay;
return native().create({
...input,
allDay: (_input_allDay = input.allDay) !== null && _input_allDay !== void 0 ? _input_allDay : false
}).catch(rethrowNativeError);
}
function update(identifier, originalStartMs, changes) {
return native().update(identifier, originalStartMs, changes).catch(rethrowNativeError);
}
function deleteEvent(identifier, startMs) {
return native().remove(identifier, startMs).catch(rethrowNativeError);
}
function getRemindersPermissionStatus() {
try {
return native().getRemindersPermissionStatus();
} catch (error) {
return rethrowNativeError(error);
}
}
function requestRemindersPermission() {
return native().requestRemindersPermission().catch(rethrowNativeError);
}
function listReminders() {
var limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 100, includeCompleted = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
return native().listReminders(limit, includeCompleted).catch(rethrowNativeError);
}
function createReminder(input) {
return native().createReminder(input).catch(rethrowNativeError);
}
function setReminderCompleted(identifier, completed) {
return native().setReminderCompleted(identifier, completed).catch(rethrowNativeError);
}
function deleteReminder(identifier) {
return native().removeReminder(identifier).catch(rethrowNativeError);
}
var nativeCalendar = Object.freeze({
getPermissionStatus,
requestPermission,
list,
create,
update,
delete: deleteEvent,
getRemindersPermissionStatus,
requestRemindersPermission,
listReminders,
createReminder,
setReminderCompleted,
deleteReminder
});
var Calendar = nativeCalendar;
export { Calendar };
//# sourceMappingURL=index.native.js.map