/**
 * Base Alert Channel
 *
 * Abstract base class for all alert channels providing common functionality:
 * - Exponential backoff retry logic
 * - Error handling and logging
 * - Delivery result formatting
 *
 * @packageDocumentation
 * @module security/alerting/channels/base
 */
import { createLogger } from '../../../common/logger.js';
import { type SecurityAlert, type AlertDeliveryResult, type AlertChannel } from '../types.js';
/**
 * Base configuration for all alert channels
 */
export interface BaseChannelConfig {
    /** Timeout for requests in ms */
    timeout?: number;
    /** Maximum retry attempts */
    maxRetries?: number;
    /** Maximum backoff delay in ms */
    maxBackoffDelay?: number;
    /** Base delay for exponential backoff in ms */
    baseBackoffDelay?: number;
}
/**
 * Internal result from sendInternal implementations
 */
export interface SendInternalResult {
    /** Message ID if available */
    messageId?: string;
}
/**
 * Abstract base class for all alert channels
 *
 * Provides common retry logic, error handling, and result formatting.
 * Subclasses must implement sendInternal() with channel-specific logic.
 */
export declare abstract class BaseAlertChannel {
    protected readonly logger: ReturnType<typeof createLogger>;
    protected readonly timeout: number;
    protected readonly maxRetries: number;
    protected readonly maxBackoffDelay: number;
    protected readonly baseBackoffDelay: number;
    /**
     * The channel type identifier
     */
    protected abstract readonly channelType: AlertChannel;
    /**
     * Channel name for logging
     */
    protected abstract readonly channelName: string;
    constructor(config?: BaseChannelConfig);
    /**
     * Send an alert through this channel with retry logic
     */
    send(alert: SecurityAlert): Promise<AlertDeliveryResult>;
    /**
     * Channel-specific send implementation
     *
     * Subclasses must implement this method with their specific delivery logic.
     * Should throw an error on failure to trigger retry.
     */
    protected abstract sendInternal(alert: SecurityAlert): Promise<SendInternalResult>;
    /**
     * Test the channel connection
     */
    abstract test(): Promise<boolean>;
    /**
     * Calculate exponential backoff delay
     */
    protected calculateBackoff(attempt: number): number;
    /**
     * Sleep for specified milliseconds
     */
    protected sleep(ms: number): Promise<void>;
    /**
     * Create a success delivery result
     */
    protected createSuccessResult(messageId?: string, retryCount?: number): AlertDeliveryResult;
    /**
     * Create a failure delivery result
     */
    protected createFailureResult(error: string, retryCount?: number): AlertDeliveryResult;
    /**
     * Create logger for a specific component
     */
    protected createChannelLogger(component: string): ReturnType<typeof createLogger>;
}
//# sourceMappingURL=base.d.ts.map