import type { NotificationPayload, ProviderConfig } from "./types.js"; export interface NotificationServiceConfig { db: any; schema: { notificationProviders: any; notificationRules: any; notificationHistory: any; monitorAlertState: any; monitors: any; pulseNotificationConfig: any; }; orm: { eq: any; and: any; or: any; isNull: any; desc: any; sql: any; }; logger?: { error: (err: any, msg: string) => void; warn: (msg: string) => void; info: (msg: string) => void; }; } /** * Notification Service * Manages sending notifications through multiple channels */ export declare class NotificationService { private db; private schema; private orm; private logger; private notifme; private customChannels; constructor(config: NotificationServiceConfig); /** * Initialize the notification service * Loads provider configurations and sets up notifme */ initialize(): Promise; /** * Seed default providers if they don't exist */ seedDefaultProviders(): Promise; seedDefaultRules(): Promise; /** * Send a test notification using a specific provider * Public method for API testing */ testNotification(provider: ProviderConfig, recipient: any, payload: NotificationPayload): Promise<{ success: boolean; error?: string; }>; /** * Process monitor check result and determine if notification should be sent */ processMonitorResult(monitorId: string, status: "up" | "down" | "unknown", result: { message?: string; pingMs?: number | null; httpStatus?: number | null; sslExpiresAt?: Date | null; extra?: Record; }): Promise; /** * Get or create alert state for a monitor */ private getOrCreateAlertState; /** * Update alert state based on new status */ private updateAlertState; /** * Get Pulse-specific notification configuration */ private getPulseConfig; /** * Get list of rules that match current criteria and are ready to fire */ private getMatchingRules; /** * Send notifications through all configured channels */ private sendNotifications; /** * Send notification to a specific provider */ private sendToProvider; private sendEmail; /** * Helper to check if the provided config matches the current global config for a channel */ private isGlobalConfig; /** * Send Slack notification * Supports dynamic webhook URLs per recipient or global notifme instance */ private sendSlack; private formatEmailHtml; private getRecipientString; private getRecipients; } //# sourceMappingURL=service.d.ts.map