NeahStable/lib/services/notifications/notification-adapter.interface.ts
2026-01-11 23:01:31 +01:00

30 lines
904 B
TypeScript

import { Notification, NotificationCount } from '@/lib/types/notification';
export interface NotificationAdapter {
/**
* The source name of this notification adapter
*/
readonly sourceName: string;
/**
* Fetch all notifications for a user
* @param userId The user ID
* @param page Page number for pagination
* @param limit Number of items per page
* @returns Promise with notification data
*/
getNotifications(userId: string, page?: number, limit?: number): Promise<Notification[]>;
/**
* Get count of notifications for a user
* @param userId The user ID
* @returns Promise with notification count data
*/
getNotificationCount(userId: string): Promise<NotificationCount>;
/**
* Check if this adapter is configured and ready to use
* @returns Promise with boolean indicating if adapter is ready
*/
isConfigured(): Promise<boolean>;
}