import { RpcSafeClient } from './rpcSafeClient';
import { RemoteColor } from './remoteColor';
import * as THREE from 'three';
/**
 * Manages the creation, caching, and deletion of color instances.
 * Handles batched deletion of colors to optimize RPC calls.
 */
export declare class ColorManager {
    private _rpc;
    private _hexToColor;
    private _idToColor;
    private _toDelete;
    private _deleteId;
    /**
     * Creates a new ColorManager instance.
     * @param rpc - The RPC client used for communication with the rendering backend
     */
    constructor(rpc: RpcSafeClient);
    /**
     * Creates or retrieves a cached color instance for the given hex value.
     * @param hex - The RGBA32 color value
     * @returns Promise resolving to a ColorHandle, or undefined if creation fails
     */
    getColor(color: THREE.Color): Promise<RemoteColor | undefined>;
    /**
     * Creates or retrieves cached color instances for multiple hex values.
     * @param colors - Array of color values or undefined for no color
     * @returns Promise resolving to an array of ColorHandles in the same order as input, or undefined if creation fails
     * @remarks Duplicate hex values will be mapped to the same color instance for efficiency
     */
    getColors(colors: (THREE.Color | undefined)[]): Promise<RemoteColor[]>;
    /**
     * Retrieves a color instance by its unique identifier.
     * @param id - The unique identifier of the color
     * @returns The ColorHandle associated with the ID, or undefined if not found
     */
    getFromId(id: number): RemoteColor;
    /**
     * Destroys a color instance and removes it from the cache.
     * @param color - The ColorHandle to destroy
     */
    destroy(color: RemoteColor): void;
    /**
     * Destroys all color instances and clears the cache.
     */
    clear(): void;
    /**
     * Creates multiple color instances via RPC.
     * @param colors - Array of RGBA32 color values to create
     * @returns Promise resolving to an array of ColorHandles, or undefined if creation fails
     * @private
     */
    private _createColors;
    /**
     * Creates a single color instance and adds it to the cache.
     * @param color - The RGBA32 color value
     * @param id - The unique identifier for the color instance
     * @returns The created ColorHandle
     * @private
     */
    private _createColor;
    /**
     * Queues a color for deletion in the next batch.
     * @param color - The ColorHandle to delete
     * @private
     */
    private _deleteColor;
    /**
     * Immediately deletes all queued colors.
     * @private
     */
    private _deleteBatch;
}
