bigbuffet-rw/app/soapbox/utils/notification.ts
marcin mikołajczak d05cabe9a8 Status edits notifications
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-27 23:47:16 +02:00

26 lines
562 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',
] 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,
};