1import { UnavailabilityError } from 'expo-modules-core';
2import NotificationScheduler from './NotificationScheduler';
3/**
4 * Cancels a single scheduled notification. The scheduled notification of given ID will not trigger.
5 * @param identifier The notification identifier with which `scheduleNotificationAsync` method resolved when the notification has been scheduled.
6 * @return A Promise resolves once the scheduled notification is successfully canceled or if there is no scheduled notification for a given identifier.
7 * @example Schedule and then cancel the notification:
8 * ```ts
9 * import * as Notifications from 'expo-notifications';
10 *
11 * async function scheduleAndCancel() {
12 *   const identifier = await Notifications.scheduleNotificationAsync({
13 *     content: {
14 *       title: 'Hey!',
15 *     },
16 *     trigger: { seconds: 60, repeats: true },
17 *   });
18 *   await Notifications.cancelScheduledNotificationAsync(identifier);
19 * }
20 * ```
21 * @header schedule
22 */
23export default async function cancelScheduledNotificationAsync(identifier) {
24    if (!NotificationScheduler.cancelScheduledNotificationAsync) {
25        throw new UnavailabilityError('Notifications', 'cancelScheduledNotificationAsync');
26    }
27    return await NotificationScheduler.cancelScheduledNotificationAsync(identifier);
28}
29//# sourceMappingURL=cancelScheduledNotificationAsync.js.map