import { RpcSafeClient } from './rpcSafeClient';
/**
 * Represents the possible states a node can have in the UltraVim system.
 */
export declare enum NodeState {
    VISIBLE = "visible",
    HIDDEN = "hidden",
    GHOSTED = "ghosted",
    HIGHLIGHTED = "highlighted"
}
/**
 * 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 StateSynchronizer {
    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 nodes when not explicitly set (defaults to VISIBLE)
     */
    constructor(rpc: RpcSafeClient, getHandle: () => number, isConnected: () => boolean, onUpdate: () => void, defaultState?: NodeState);
    /**
     * Checks if all nodes are in the specified state(s).
     *
     * @param state - A single state or array of states to check against
     * @returns True if all nodes are in the specified state(s), false otherwise
     */
    areAllInState(state: NodeState | NodeState[]): boolean;
    /**
     * Gets the current state of a specific node.
     *
     * @param node - The node identifier
     * @returns The current state of the node
     */
    getNodeState(node: number): NodeState;
    /**
     * Gets all nodes that are currently in the specified state.
     *
     * @param state - The state to query
     * @returns Either 'all' if all nodes are in this state, or an array of node IDs
     */
    getNodesInState(state: NodeState): number[] | 'all';
    /**
     * Gets the default state used for nodes without explicit state settings.
     *
     * @returns The current default state
     */
    getDefaultState(): NodeState;
    /**
     * Sets the state of a specific node.
     *
     * @param nodeId - The identifier of the node
     * @param state - The new state to apply
     */
    setNodeState(nodeId: number, state: NodeState): void;
    /**
     * Sets the state of all nodes to the specified value.
     *
     * @param state - The state to apply to all nodes
     * @param clear - If true, clears all node-specific overrides
     */
    setAllNodesState(state: NodeState, clear: boolean): void;
    /**
     * Replaces all nodes in one state (or states) with another state.
     *
     * @param fromState - The state(s) to replace
     * @param toState - The new state to apply
     */
    replaceState(fromState: NodeState | NodeState[], toState: NodeState): void;
    /**
     * Reapplies all current state settings, useful after changes to the node structure.
     * 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;
    /**
     * Calls the appropriate RPC method to update the state of all nodes.
     *
     * @param state - The state to apply to all nodes
     * @private
     */
    private callRPCForStateAll;
    /**
     * Calls the appropriate RPC method to update the state of specific nodes.
     *
     * @param state - The state to apply
     * @param nodes - Array of node IDs to update
     * @private
     */
    private callRPCForStateNodes;
}
