Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function updateEventAsync(
id: string,
details: Event = {},
{ futureEvents = false, instanceStartDate }: RecurringEventOptions = {}
): Promise {
if (!ExpoCalendar.saveEventAsync) {
throw new UnavailabilityError('Calendar', 'updateEventAsync');
}
if (!id) {
throw new Error('updateEventAsync must be called with an id (string) of the target event');
}
if (Platform.OS === 'ios') {
if (
details.hasOwnProperty('creationDate') ||
details.hasOwnProperty('lastModifiedDate') ||
details.hasOwnProperty('originalStartDate') ||
details.hasOwnProperty('isDetached') ||
details.hasOwnProperty('status') ||
details.hasOwnProperty('organizer')
) {
console.warn(
'updateEventAsync was called with one or more read-only properties, which will not be updated'
export async function updateEventAsync(id, details = {}, { futureEvents = false, instanceStartDate } = {}) {
if (!ExpoCalendar.saveEventAsync) {
throw new UnavailabilityError('Calendar', 'updateEventAsync');
}
if (!id) {
throw new Error('updateEventAsync must be called with an id (string) of the target event');
}
if (Platform.OS === 'ios') {
if (details.hasOwnProperty('creationDate') ||
details.hasOwnProperty('lastModifiedDate') ||
details.hasOwnProperty('originalStartDate') ||
details.hasOwnProperty('isDetached') ||
details.hasOwnProperty('status') ||
details.hasOwnProperty('organizer')) {
console.warn('updateEventAsync was called with one or more read-only properties, which will not be updated');
}
}
const newDetails = { ...details, id, instanceStartDate };
return ExpoCalendar.saveEventAsync(newDetails, { futureEvents });
export async function getPermissionsAsync() {
if (!ExpoContacts.getPermissionsAsync) {
throw new UnavailabilityError('Contacts', 'getPermissionsAsync');
}
return ExpoContacts.getPermissionsAsync();
}
export async function requestPermissionsAsync() {
export async function selectPrinterAsync(): Promise {
if (ExponentPrint.selectPrinter) {
return await ExponentPrint.selectPrinter();
}
throw new UnavailabilityError('Print', 'selectPrinterAsync');
}
export async function unlockAsync() {
if (!ExpoScreenOrientation.unlockAsync) {
throw new UnavailabilityError('ScreenOrientation', 'unlockAsync');
}
await ExpoScreenOrientation.unlockAsync();
}
export async function getOrientationAsync() {
export async function initAsync(options) {
if (!ExpoGoogleSignIn.initAsync) {
throw new UnavailabilityError('GoogleSignIn', 'initAsync');
}
_options = validateOptions(options || _options || {});
const hasPlayServices = await getPlayServiceAvailability();
if (!hasPlayServices) {
return;
}
_initialization = ExpoGoogleSignIn.initAsync(_options || {});
return _initialization;
}
export async function isSignedInAsync() {
export async function notificationAsync(type = NotificationFeedbackType.Success) {
if (!ExpoHaptics.notificationAsync) {
throw new UnavailabilityError('Haptics', 'notificationAsync');
}
await ExpoHaptics.notificationAsync(type);
}
/**
export function flush() {
if (!ExponentSegment.flush) {
throw new UnavailabilityError('expo-analytics-segment', 'flush');
}
ExponentSegment.flush();
}
export async function getEnabledAsync() {
async function invokeAuthMethod(method) {
if (!ExpoGoogleSignIn[method]) {
throw new UnavailabilityError('GoogleSignIn', method);
}
await ensureGoogleIsInitializedAsync();
const payload = await ExpoGoogleSignIn[method]();
let account = payload != null ? new GoogleUser(payload) : null;
return setCurrentUser(account);
}
export function allowInClient() {
export async function registerTaskAsync(taskName, options = {}) {
if (!ExpoBackgroundFetch.registerTaskAsync) {
throw new UnavailabilityError('BackgroundFetch', 'registerTaskAsync');
}
if (!TaskManager.isTaskDefined(taskName)) {
throw new Error(`Task '${taskName}' is not defined. You must define a task using TaskManager.defineTask before registering.`);
}
await ExpoBackgroundFetch.registerTaskAsync(taskName, options);
}
export async function unregisterTaskAsync(taskName) {