1import { UnavailabilityError } from 'expo-modules-core';
2
3import NotificationChannelManager from './NotificationChannelManager';
4import { NotificationChannelInput, NotificationChannel } from './NotificationChannelManager.types';
5
6export default async function setNotificationChannelAsync(
7  channelId: string,
8  channel: NotificationChannelInput
9): Promise<NotificationChannel | null> {
10  if (!NotificationChannelManager.setNotificationChannelAsync) {
11    throw new UnavailabilityError('Notifications', 'setNotificationChannelAsync');
12  }
13
14  return await NotificationChannelManager.setNotificationChannelAsync(channelId, channel);
15}
16