import { RpcSafeClient } from './rpcSafeClient';
/**
 * Represents the possible states an element can have in the UltraVim system.
 */
export declare enum VisibilityState {
    VISIBLE = 0,
    HIDDEN = 1,
    GHOSTED = 2,
    HIGHLIGHTED = 16,
    HIDDEN_HIGHLIGHTED = 17,
    GHOSTED_HIGHLIGHTED = 18
}
/**
 * A class that wraps a StateTracker and is responsible for synchronizing its state updates with the remote RPCs.
 * It batches updates to optimize performance and handles the communication with the remote system.
 */
export declare class VisibilitySynchronizer {
    private _tracker;
    private _rpc;
    private _getHandle;
    private _onUpdate;
    private _isConnected;
    private _animationFrame;
    /**
     * Creates a new StateSynchronizer instance.
     *
     * @param rpc - The RPC client used to communicate with the remote system
     * @param getHandle - Function that returns the current handle identifier
     * @param isConnected - Function that returns whether the connection to the remote system is active
     * @param onUpdate - Callback function invoked when updates are sent to the remote system
     * @param defaultState - The default state for elements when not explicitly set (defaults to VISIBLE)
     */
    constructor(rpc: RpcSafeClient, getHandle: () => number, isConnected: () => boolean, onUpdate: () => void, defaultState?: VisibilityState);
    /**
     * Checks if all elements are in the specified state(s).
     *
     * @param state - A single state or array of states to check against
     * @returns True if all elements are in the specified state(s), false otherwise
     */
    areAllInState(state: VisibilityState | VisibilityState[]): boolean;
    /**
     * Gets the current state of a specific element.
     *
     * @param elementIndex - The element index
     * @returns The current state of the element
     */
    getElementState(elementIndex: number): VisibilityState;
    /**
     * Gets all elements that are currently in the specified state.
     *
     * @param state - The state to query
     * @returns Either 'all' if all elements are in this state, or an array of element indices
     */
    getElementsInState(state: VisibilityState): number[] | 'all';
    /**
     * Gets the default state used for elements without explicit state settings.
     *
     * @returns The current default state
     */
    getDefaultState(): VisibilityState;
    /**
     * Sets the state of a specific elements.
     *
     * @param elementIndex - The element index to update
     * @param state - The new state to apply
     */
    setStateForElement(elementIndex: number, state: VisibilityState): void;
    /**
     * Sets the state of all elements to the specified value.
     *
     * @param state - The state to apply to all elements
     * @param clear - If true, clears all elements-specific overrides
     */
    setStateForAll(state: VisibilityState): void;
    /**
     * Replaces all elements in one state (or states) with another state.
     *
     * @param fromState - The state(s) to replace
     * @param toState - The new state to apply
     */
    replaceState(fromState: VisibilityState | VisibilityState[], toState: VisibilityState): void;
    /**
     * Reapplies all current state settings, useful after a reconnection.
     * This will remove redundant overrides and ensure consistency.
     */
    reapplyStates(): void;
    /**
     * Schedules a synchronization on the next animation frame.
     * This batches multiple rapid state changes to avoid excessive RPC calls.
     *
     * @private
     */
    private scheduleUpdate;
    /**
     * Processes all pending updates and sends them to the remote system.
     *
     * @private
     */
    private remoteUpdate;
}
