/**
 * Firebase Cloud Messaging (FCM) Client
 * Uses FCM HTTP v1 API with Google OAuth2 authentication
 *
 * Prerequisites:
 * - Firebase project
 * - Service account JSON key from Firebase Console
 *
 * @example
 * ```ts
 * const fcm = new FCMClient({
 *   projectId: 'your-project-id',
 *   clientEmail: 'firebase-adminsdk@project.iam.gserviceaccount.com',
 *   privateKey: '-----BEGIN PRIVATE KEY-----\n...',
 * })
 *
 * await fcm.send({
 *   token: '...',
 *   title: 'Hello',
 *   body: 'World',
 * })
 * ```
 */
export interface FCMConfig {
    /** Firebase project ID */
    projectId: string;
    /** Service account client email */
    clientEmail: string;
    /** Service account private key (PEM format) */
    privateKey: string;
}
export interface FCMNotification {
    /** Device FCM token */
    token?: string;
    /** Topic to send to (instead of token) */
    topic?: string;
    /** Condition expression for targeting multiple topics */
    condition?: string;
    /** Notification title */
    title?: string;
    /** Notification body */
    body?: string;
    /** Notification image URL */
    imageUrl?: string;
    /** Custom data payload */
    data?: Record<string, string>;
    /** Android-specific options */
    android?: {
        /** Channel ID for Android O+ */
        channelId?: string;
        /** Notification priority */
        priority?: 'normal' | 'high';
        /** Time to live in seconds */
        ttl?: number;
        /** Collapse key for message deduplication */
        collapseKey?: string;
        /** Notification icon */
        icon?: string;
        /** Notification icon color (hex) */
        color?: string;
        /** Sound to play */
        sound?: string;
        /** Click action */
        clickAction?: string;
        /** Tag for notification replacement */
        tag?: string;
        /** Direct boot aware */
        directBootOk?: boolean;
        /** Visibility: private, public, secret */
        visibility?: 'private' | 'public' | 'secret';
        /** Notification count */
        notificationCount?: number;
    };
    /** Web push options */
    webpush?: {
        /** Web notification options */
        notification?: {
            title?: string;
            body?: string;
            icon?: string;
            badge?: string;
            image?: string;
            requireInteraction?: boolean;
            silent?: boolean;
            tag?: string;
            actions?: Array<{
                action: string;
                title: string;
                icon?: string;
            }>;
        };
        /** FCM options for web */
        fcmOptions?: {
            link?: string;
            analyticsLabel?: string;
        };
        /** Custom headers */
        headers?: Record<string, string>;
        /** Custom data */
        data?: Record<string, string>;
    };
    /** APNS options (for iOS via FCM) */
    apns?: {
        /** APNs headers */
        headers?: Record<string, string>;
        /** APNs payload */
        payload?: {
            aps?: Record<string, any>;
            [key: string]: any;
        };
        /** FCM options */
        fcmOptions?: {
            analyticsLabel?: string;
            image?: string;
        };
    };
    /** FCM options */
    fcmOptions?: {
        analyticsLabel?: string;
    };
}
export interface FCMSendResult {
    success: boolean;
    messageId?: string;
    error?: string;
    errorCode?: string;
}
export interface FCMBatchResult {
    sent: number;
    failed: number;
    results: Array<FCMSendResult & {
        token?: string;
    }>;
}
/**
 * Firebase Cloud Messaging client
 */
export declare class FCMClient {
    private config;
    private accessToken;
    private tokenExpiresAt;
    constructor(config: FCMConfig);
    /**
     * Load config from service account JSON
     */
    static fromServiceAccount(serviceAccount: {
        project_id: string;
        client_email: string;
        private_key: string;
    }): FCMClient;
    /**
     * Generate a JWT for Google OAuth2
     */
    private generateJWT;
    /**
     * Get a valid access token, refreshing if needed
     */
    private getAccessToken;
    /**
     * Build FCM message payload
     */
    private buildMessage;
    /**
     * Send a push notification
     */
    send(notification: FCMNotification): Promise<FCMSendResult>;
    /**
     * Send to multiple device tokens
     */
    sendBatch(tokens: string[], notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>, options?: {
        concurrency?: number;
    }): Promise<FCMBatchResult>;
    /**
     * Send to a topic
     */
    sendToTopic(topic: string, notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>): Promise<FCMSendResult>;
    /**
     * Send to topics with a condition
     * @example sendToCondition("'TopicA' in topics && 'TopicB' in topics", {...})
     */
    sendToCondition(condition: string, notification: Omit<FCMNotification, 'token' | 'topic' | 'condition'>): Promise<FCMSendResult>;
    /**
     * Send a simple notification (convenience method)
     */
    sendSimple(token: string, title: string, body: string, data?: Record<string, string>): Promise<FCMSendResult>;
    /**
     * Send a data-only (silent) notification
     */
    sendSilent(token: string, data: Record<string, string>): Promise<FCMSendResult>;
    /**
     * Subscribe a token to a topic
     */
    subscribeToTopic(tokens: string[], topic: string): Promise<{
        success: boolean;
        error?: string;
    }>;
    /**
     * Unsubscribe a token from a topic
     */
    unsubscribeFromTopic(tokens: string[], topic: string): Promise<{
        success: boolean;
        error?: string;
    }>;
}
export default FCMClient;
