import { App } from 'firebase-admin/app'; import { Messaging, Message, MulticastMessage, TopicMessage } from 'firebase-admin/messaging'; interface AppWithMessaging extends App { messaging(): Messaging; } export declare class MessagingService { private readonly app; private readonly messaging; constructor(app: AppWithMessaging); sendToDevice(token: string, payload: Partial): Promise; sendToDevices(tokens: string[], payload: Partial): Promise; sendToTopic(topic: string, payload: Partial): Promise; subscribeToTopic(tokens: string[], topic: string): Promise; unsubscribeFromTopic(tokens: string[], topic: string): Promise; } export interface MessagingPayload { notification?: { title?: string; body?: string; imageUrl?: string; }; data?: { [key: string]: string; }; android?: { priority?: 'high' | 'normal'; ttl?: number; notification?: { channelId?: string; clickAction?: string; color?: string; icon?: string; sound?: string; tag?: string; title?: string; body?: string; }; }; apns?: { payload?: { aps?: { alert?: { title?: string; body?: string; }; sound?: string; badge?: number; }; }; headers?: { [key: string]: string; }; }; webpush?: { headers?: { [key: string]: string; }; notification?: { title?: string; body?: string; icon?: string; badge?: string; data?: { [key: string]: string; }; actions?: Array<{ action: string; title: string; icon?: string; }>; }; }; } export type MessagingMessage = { token: string; } & MessagingPayload; export type MessagingMulticastMessage = { tokens: string[]; } & MessagingPayload; export type MessagingTopicMessage = { topic: string; } & MessagingPayload; export type MessagingBatchResponse = { successCount: number; failureCount: number; responses: Array<{ messageId?: string; error?: { code: string; message: string; }; }>; }; export type MessagingTopicManagementResponse = { successCount: number; failureCount: number; errors: Array<{ index: number; error: { code: string; message: string; }; }>; }; export {};