import RedisClient, { RedisClientOptions } from ".";
import RedisCommandsQueue from "./commands-queue";
import { RedisArgument } from "../RESP/types";
type RedisType = RedisClient<any, any, any, any, any>;
export declare const SMIGRATED_EVENT = "__SMIGRATED";
interface Address {
    host: string;
    port: number;
}
interface Destination {
    addr: Address;
    slots: (number | [number, number])[];
}
interface SMigratedEntry {
    source: Address;
    destinations: Destination[];
}
export interface SMigratedEvent {
    seqId: number;
    entries: SMigratedEntry[];
}
export declare const MAINTENANCE_EVENTS: {
    readonly PAUSE_WRITING: "pause-writing";
    readonly RESUME_WRITING: "resume-writing";
    readonly TIMEOUTS_UPDATE: "timeouts-update";
};
export type DiagnosticsEvent = {
    type: string;
    timestamp: number;
    data?: Object;
};
export declare const dbgMaintenance: (...args: any[]) => void;
export declare const emitDiagnostics: (event: DiagnosticsEvent) => void;
export interface MaintenanceUpdate {
    relaxedCommandTimeout?: number;
    relaxedSocketTimeout?: number;
}
export default class EnterpriseMaintenanceManager {
    #private;
    static setupDefaultMaintOptions(options: RedisClientOptions): void;
    static getHandshakeCommand(options: RedisClientOptions): Promise<{
        cmd: Array<RedisArgument>;
        errorHandler: (error: Error) => void;
    } | undefined>;
    constructor(commandsQueue: RedisCommandsQueue, client: RedisType, options: RedisClientOptions);
    /**
     * Parses an SMIGRATED push message into a structured SMigratedEvent.
     *
     * SMIGRATED format:
     * - SMIGRATED, "seqid", followed by a list of N triplets:
     *     - source endpoint
     *     - target endpoint
     *     - comma separated list of slot ranges
     *
     * A source and a target endpoint may appear in multiple triplets.
     * There is no optimization of the source, dest, slot-range list in the SMIGRATED message.
     * The client code should read through the entire list of triplets in order to get a full
     * list of moved slots, or full list of sources and targets.
     *
     * Example:
     * [ 'SMIGRATED', 15, [ [ '127.0.0.1:6379', '127.0.0.2:6379', '123,456,789-1000' ], [ '127.0.0.3:6380', '127.0.0.4:6380', '124,457,300-500' ] ] ]
     *                ^seq     ^source1          ^destination1     ^slots                  ^source2          ^destination2    ^slots
     *
     * Result structure guarantees:
     * - Each source address appears in exactly one entry (entries are deduplicated by source)
     * - Within each entry, each destination address appears exactly once (destinations are deduplicated per source)
     * - Each destination contains the complete list of slots that moved from that source to that destination
     * - Note: The same destination address CAN appear under different sources (e.g., node X receives slots from both A and B)
     */
    static parseSMigratedPush(push: any[]): SMigratedEvent;
}
export type MovingEndpointType = "auto" | "internal-ip" | "internal-fqdn" | "external-ip" | "external-fqdn" | "none";
export {};
//# sourceMappingURL=enterprise-maintenance-manager.d.ts.map