UNPKG

@uplink-protocol/calendar-controller

Version:

Flexible calendar and time picker API supporting both calendar, date-picker, and time-picker integrations for any JavaScript framework or library

62 lines (61 loc) 3.33 kB
import { IEventNotificationService, NotificationRequest, NotificationStatus, NotificationConfig, NotificationTemplate, NotificationHistory, BulkNotificationRequest, NotificationAnalytics, NotificationType, NotificationChannel } from '../interfaces/event-notification.interfaces'; import { CalendarEvent } from '../interfaces/event.interfaces'; /** * Event Notification Service Implementation * Provides comprehensive notification capabilities for events */ export declare class EventNotificationService implements IEventNotificationService { private defaultConfig; private templates; private userConfigs; private notifications; private notificationStatus; private history; private notificationCounter; private notificationSentCallbacks; private notificationFailedCallbacks; /** * Reset all internal state - used for test isolation */ reset(): void; initialize(config?: Partial<NotificationConfig>): Promise<void>; sendNotification(request: NotificationRequest): Promise<NotificationStatus>; scheduleNotification(request: NotificationRequest): Promise<string>; sendBulkNotifications(request: BulkNotificationRequest): Promise<NotificationStatus[]>; cancelNotification(notificationId: string): Promise<void>; getNotificationStatus(notificationId: string): Promise<NotificationStatus | null>; configureUserNotifications(userId: string, config: NotificationConfig): Promise<void>; getUserNotificationConfig(userId: string): Promise<NotificationConfig | null>; createTemplate(template: NotificationTemplate): Promise<void>; updateTemplate(templateId: string, updates: Partial<NotificationTemplate>): Promise<void>; getTemplates(type?: NotificationType): Promise<NotificationTemplate[]>; deleteTemplate(templateId: string): Promise<void>; processEventNotifications(event: CalendarEvent, action: 'created' | 'updated' | 'deleted' | 'reminder'): Promise<void>; getNotificationHistory(userId?: string, dateRange?: { start: Date; end: Date; }, type?: NotificationType): Promise<NotificationHistory[]>; markNotificationInteraction(notificationId: string, interaction: 'opened' | 'clicked' | 'dismissed'): Promise<void>; getPendingNotifications(userId?: string): Promise<NotificationRequest[]>; getAnalytics(dateRange: { start: Date; end: Date; }, userId?: string): Promise<NotificationAnalytics>; testNotification(userId: string, channel: NotificationChannel, message: string): Promise<NotificationStatus>; cleanupExpiredNotifications(): Promise<number>; onNotificationSent(callback: (notification: NotificationRequest, status: NotificationStatus) => void): () => void; onNotificationFailed(callback: (notification: NotificationRequest, error: string) => void): () => void; private initializeDefaultTemplates; private simulateNotificationDelivery; private addToHistory; private sendEventCreatedNotifications; private sendEventUpdatedNotifications; private sendEventDeletedNotifications; private sendEventReminderNotifications; private calculateDeliveryRates; private calculateOpenRates; private calculateClickRates; private calculateTopChannels; private calculateEngagementScores; private calculateErrorStats; }