import { MapComponentProps } from './types';
import { SpatialFilter } from '@carto/api-client';
import { MultiPolygon } from 'geojson';
/**
 * Hook that provides access to the combined spatial filter state for a map, automatically
 * switching between lasso tools, static, and viewport spatial filters based on priority.
 *
 * @returns An object containing the active `spatialFilter` and individual filter sources:
 * `lassoToolsSpatialFilter`, `staticSpatialFilter`, and `viewportSpatialFilter`.
 *
 * @remarks
 * Priority order: lasso tools filter > static filter > viewport filter.
 * If you only need one type of filter, prefer {@link useViewportSpatialFilter} or
 * {@link useLassoToolsSpatialFilter} to avoid unnecessary re-renders.
 *
 * @example
 * ```tsx
 * const { spatialFilter, lassoToolsSpatialFilter, viewportSpatialFilter } = useSpatialFilter({ mapId: 'main-map' })
 * ```
 */
export declare function useSpatialFilter({ mapId, }: {
    mapId: MapComponentProps['id'];
}): {
    spatialFilter: SpatialFilter | undefined;
    staticSpatialFilter: SpatialFilter | undefined;
    lassoToolsSpatialFilter: SpatialFilter | undefined;
    viewportSpatialFilter: SpatialFilter | undefined;
};
/**
 * Hook that provides access to the current map viewport as a spatial filter polygon.
 * Updates automatically when the map viewport changes.
 *
 * @returns The current viewport as a `Polygon` spatial filter, or `undefined` if the viewport is not available.
 *
 * @remarks
 * Use this hook instead of {@link useSpatialFilter} to avoid unnecessary re-renders when
 * lasso tool or static spatial filter changes.
 *
 * @example
 * ```tsx
 * const viewportSpatialFilter = useViewportSpatialFilter({ mapId: 'main-map' })
 * ```
 */
export declare function useViewportSpatialFilter({ mapId, }: {
    mapId: MapComponentProps['id'];
}): SpatialFilter | undefined;
/**
 * Hook that provides access to the spatial filter polygon drawn by the lasso tool.
 *
 * @returns A `MultiPolygon` geometry from visible lasso tool values, or `undefined` if no lasso selection exists.
 *
 * @remarks
 * Use this hook instead of {@link useSpatialFilter} to avoid unnecessary re-renders when
 * the viewport or static spatial filter changes.
 *
 * @example
 * ```tsx
 * const lassoToolsSpatialFilter = useLassoToolsSpatialFilter({ mapId: 'main-map' })
 * ```
 */
export declare function useLassoToolsSpatialFilter({ mapId, }: {
    mapId: MapComponentProps['id'];
}): MultiPolygon | undefined;
/**
 * Hook that provides access to the static spatial filter set programmatically by the user.
 *
 * @returns A `MultiPolygon` geometry from static spatial filters, or `undefined` if none are set.
 *
 * @remarks
 * Use this hook to avoid unnecessary re-renders when viewport or lasso tool changes.
 */
export declare function useStaticSpatialFilter({ mapId, }: {
    mapId: MapComponentProps['id'];
}): SpatialFilter | undefined;
/**
 * Type for grouped spatial filter result
 */
export type GroupedSpatialFilterResult = SpatialFilter[];
/**
 * Hook that provides grouped spatial filter results, returning arrays of spatial filters
 * instead of single merged filters. Follows the same priority as {@link useSpatialFilter}:
 * lasso tools > static > viewport.
 *
 * @returns An object containing grouped `spatialFilter`, `staticSpatialFilter`,
 * `lassoToolsSpatialFilter`, and `viewportSpatialFilter` arrays.
 */
export declare function useGroupedSpatialFilter({ mapId, }: {
    mapId: MapComponentProps['id'];
}): {
    spatialFilter: GroupedSpatialFilterResult;
    staticSpatialFilter: GroupedSpatialFilterResult;
    lassoToolsSpatialFilter: GroupedSpatialFilterResult;
    viewportSpatialFilter: GroupedSpatialFilterResult;
};
/**
 * Hook to create multipolygon geometries for each group of lasso tool values.
 * Groups are identified by the groupId property in LassoToolsData.
 * Uses per-group memoization to only recompute multipolygons when a specific group changes.
 * This optimizes performance by avoiding expensive multiPolygon() calls for unchanged groups.
 *
 * @param mapId - The map component ID
 * @param groupIds - Optional array of group IDs to filter results. If empty or undefined, returns all groups
 * @returns Array of objects with groupId and spatialFilter, ordered by groupId
 */
export declare function useGroupedLassoToolsSpatialFilters({ mapId, groupIds, }: {
    mapId: MapComponentProps['id'];
    groupIds?: number[];
}): GroupedSpatialFilterResult;
/**
 * Hook to create multipolygon geometries for each group of static spatial filters.
 * Groups are identified by the groupId property in SpatialFilterWithGroup.
 * Uses per-group memoization to only recompute multipolygons when a specific group changes.
 * This optimizes performance by avoiding expensive multiPolygon() calls for unchanged groups.
 *
 * @param mapId - The map component ID
 * @param groupIds - Optional array of group IDs to filter results. If empty or undefined, returns all groups
 * @returns Array of objects with groupId and spatialFilter, ordered by groupId
 */
export declare function useGroupedStaticSpatialFilters({ mapId, groupIds, }: {
    mapId: MapComponentProps['id'];
    groupIds?: number[];
}): GroupedSpatialFilterResult;
