import { Repository } from 'typeorm';
import { ClusterFirewallEntity, ReconciliationStatus } from '../entities/cluster-firewall.entity';
import { FirewallRuleDto } from '../../../providers/dto/firewall.dto';
import { FirewallResponseDto, ListFirewallsQueryDto, ReconciliationStatusDto } from '../dto/cluster-firewall.dto';
export declare class FirewallDesiredStateService {
    private readonly firewallRepository;
    private readonly logger;
    constructor(firewallRepository: Repository<ClusterFirewallEntity>);
    /**
     * Create a new firewall for a cluster
     */
    createFirewall(clusterId: string, desiredRules: FirewallRuleDto[]): Promise<ClusterFirewallEntity>;
    /**
     * Get firewall by ID
     */
    getFirewallById(id: string): Promise<ClusterFirewallEntity>;
    /**
     * Get firewall by cluster ID
     */
    getFirewallByClusterId(clusterId: string): Promise<ClusterFirewallEntity>;
    /**
     * List all firewalls with optional filters
     */
    listFirewalls(filters?: ListFirewallsQueryDto): Promise<ClusterFirewallEntity[]>;
    /**
     * Set desired rules for a firewall
     */
    setDesiredRules(firewallId: string, desiredRules: FirewallRuleDto[]): Promise<ClusterFirewallEntity>;
    /**
     * Update firewall reconciliation status
     */
    updateReconciliationStatus(firewallId: string, status: ReconciliationStatus, errorMessage?: string): Promise<ClusterFirewallEntity>;
    /**
     * Mark reconciliation complete and update applied state
     */
    markReconciliationComplete(firewallId: string, appliedRules: FirewallRuleDto[], providerFirewallId?: string): Promise<ClusterFirewallEntity>;
    /**
     * Update both desired and applied state atomically after successful provider update
     * Used by updateAndApplyRules flow
     */
    updateDesiredAndAppliedState(firewall: ClusterFirewallEntity, rules: FirewallRuleDto[], providerFirewallId?: string): Promise<ClusterFirewallEntity>;
    /**
     * Detect drift between desired and last applied state
     */
    detectDrift(firewallId: string): Promise<boolean>;
    /**
     * Get reconciliation status
     */
    getReconciliationStatus(firewallId: string): Promise<ReconciliationStatusDto>;
    /**
     * Delete a firewall
     */
    deleteFirewall(firewallId: string): Promise<void>;
    /**
     * Calculate canonical hash of rules
     */
    calculateHash(rules: FirewallRuleDto[]): string;
    /**
     * Canonicalize rules for consistent hashing and comparison
     * - Sorts rules by direction, protocol, port, description
     * - Sorts source/destination IPs
     * - Normalizes protocol to lowercase
     */
    canonicalizeRules(rules: FirewallRuleDto[]): FirewallRuleDto[];
    /**
     * Convert entity to DTO
     */
    toResponseDto(firewall: ClusterFirewallEntity): FirewallResponseDto;
    /**
     * Compute firewall coverage status from cluster node state (no provider calls)
     */
    private computeCoverage;
}
