bigbuffet-rw/app/soapbox/utils/notification.ts
marcin mikołajczak 04b4a57e06 Manage event
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-09-25 23:18:11 +02:00

29 lines
661 B
TypeScript

/** Notification types known to Soapbox. */
const NOTIFICATION_TYPES = [
'follow',
'follow_request',
'mention',
'reblog',
'favourite',
'poll',
'status',
'move',
'pleroma:chat_mention',
'pleroma:emoji_reaction',
'user_approved',
'update',
'pleroma:event_reminder',
'pleroma:participation_request',
'pleroma:participation_accepted',
] as const;
type NotificationType = typeof NOTIFICATION_TYPES[number];
/** Ensure the Notification is a valid, known type. */
const validType = (type: string): type is NotificationType => NOTIFICATION_TYPES.includes(type as any);
export {
NOTIFICATION_TYPES,
NotificationType,
validType,
};