import { Layer, LayerLegend } from './providers/layers/types';
/**
 * Provides legend data and interaction handlers for the specified layers, enabling visibility, opacity, and collapse control.
 *
 * @param layersId - Array of layer identifiers to include in the legend.
 * @param callback - Mapping function that transforms each layer into the desired legend data shape (e.g., `mappingLegendMeridian`).
 * @returns An object containing `legend` data and callbacks `onChangeVisibility`, `onChangeOpacity`, and `onChangeRowCollapse`.
 *
 * @example
 * ```tsx
 * const { legend, onChangeOpacity, onChangeVisibility, onChangeRowCollapse } =
 *   useLegend([LAYER_ID], mappingLegendMeridian)
 * ```
 *
 * @deprecated Legend state is moving into the react-ui legend module, which
 * owns the legend store and its setters. Prefer the store-backed `Legend`
 * components from `@carto/ps-react-ui/legend` (and `…/legend/stores`). This
 * hook will be removed once the react-ui ↔ react-maps store-sync adapter
 * lands; until then it remains functional.
 */
export declare function useLegend<T>(layersId: string[], callback: (layer: Layer) => T): {
    legend: T[];
    onChangeVisibility: ({ id, visible, ...legend }: {
        id: string;
        visible: boolean;
    } & Partial<LayerLegend>) => void;
    onChangeOpacity: ({ id, opacity }: {
        id: string;
        opacity: number;
    }) => void;
    onChangeRowCollapse: ({ id, collapsed }: {
        id: string;
        collapsed: boolean;
    }) => void;
};
