import { OnApplicationBootstrap } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Repository } from 'typeorm';
import { MessageBatch, BatchStatus, BatchProgress } from './entities/message-batch.entity';
import { SendBulkMessageDto } from './dto/bulk-message.dto';
import { EngineRegistry } from '../../engine/engine-registry.service';
import { MessageService } from './message.service';
import { SendPacingService } from './send-pacing.service';
import { SessionOwnershipService } from '../session/session-ownership.service';
import { HookManager } from '../../core/hooks';
export declare function resolveFinalBatchStatus(cancelled: boolean, stoppedOnError: boolean, progress: Pick<BatchProgress, 'sent' | 'failed'>): BatchStatus;
export declare function sanitizeBatchError(error: unknown): {
    code: string;
    message: string;
};
export declare function resolveMaxConcurrentBatches(): number;
export declare class BulkMessageService implements OnApplicationBootstrap {
    private readonly batchRepository;
    private readonly engines;
    private readonly messageService;
    private readonly hookManager;
    private readonly pacing;
    private readonly ownership?;
    private readonly configService?;
    private readonly logger;
    private readonly processingBatches;
    private inFlightBatches;
    constructor(batchRepository: Repository<MessageBatch>, engines: EngineRegistry, messageService: MessageService, hookManager: HookManager, pacing: SendPacingService, ownership?: SessionOwnershipService | undefined, configService?: ConfigService | undefined);
    onApplicationBootstrap(): Promise<void>;
    private failOrphanedBatch;
    reapProcessingBatches(sessionId: string, reason: string): Promise<number>;
    private ownedByThisNode;
    createBatch(sessionId: string, dto: SendBulkMessageDto): Promise<MessageBatch>;
    getBatchStatus(sessionId: string, batchId: string): Promise<MessageBatch>;
    cancelBatch(sessionId: string, batchId: string): Promise<MessageBatch>;
    private processBatch;
    private executeBatch;
    private markBatchProcessing;
    private failBatchWithoutEngine;
    private processBatchMessages;
    private processBatchMessage;
    private finalizeBatch;
    private assertContentMediaWithinCap;
    private stripBatchMediaPayloads;
    private applyVariables;
    private persistSentMessage;
    private sendMessage;
    private calculateDelay;
}
