import type { Map as MapboxMap } from 'mapbox-gl';
import type { ViewportBounds, Tile, TileKey, ApiBounds } from '../stores/viewport-store/types';
/**
 * Fixed zoom level for tile calculations.
 * Zoom 11 creates tiles approximately 12 miles (~19 km) across at mid-latitudes.
 */
export declare const TILE_ZOOM = 11;
/**
 * Size of the initial/fallback data-loading grid around a center point.
 * 12 tiles = 4x3 grid, approximately 48 miles x 36 miles at mid-latitudes.
 * Used for seeding viewport bounds and deciding when radius-derived bounds
 * are too large and should fall back to the grid.
 */
export declare const MAX_TILES_FOR_FETCH = 12;
/**
 * Viewport tile-count ceiling for enabling data loading.
 * Above this count, the "Zoom in to load wells" hint shows, fetches are
 * suppressed, and fit-bounds clamps zoom up to stay under.
 *
 * Kept above MAX_TILES_FOR_FETCH because a 4x3 geographic area fit into a
 * typical 16:9 viewport (with padding) naturally occupies ~18 zoom-11 tiles.
 * 25 lets the user zoom out to ~3.6 mi scale before the hint fires (initial
 * scale is ~2.7 mi on a typical display).
 */
export declare const MAX_VIEWPORT_TILES_FOR_FETCH = 25;
/**
 * Calculates zoom increase needed to reduce visible tiles to within limit.
 * Each zoom level roughly halves visible area in each dimension (4x total reduction).
 */
export declare const getZoomIncreaseForTileLimit: (currentTileCount: number) => number;
/**
 * Converts a tile [x, y, z] to a string key "z/x/y"
 */
export declare const tileToKey: (tile: Tile) => TileKey;
/**
 * Parses a tile key "z/x/y" back to [x, y, z] array
 */
export declare const keyToTile: (key: TileKey) => Tile;
/**
 * Converts a tile to geographic bounding box in API format.
 * tilebelt returns [west, south, east, north] (BBox format)
 */
export declare const tileToBounds: (tile: Tile) => ApiBounds;
/**
 * Converts a point [longitude, latitude] to a tile at TILE_ZOOM
 */
export declare const pointToTile: (longitude: number, latitude: number) => Tile;
/**
 * Estimates the number of tiles for a viewport without iterating.
 * O(1) complexity - safe to call frequently.
 */
export declare const estimateTileCount: (bounds: ViewportBounds) => number;
/**
 * Gets all tiles that intersect with the given viewport bounds.
 * Returns an array of tile keys for the visible area.
 *
 * WARNING: This function iterates through all tiles. For zoomed-out views,
 * use estimateTileCount() first to check if tile count is acceptable.
 */
export declare const getTilesForViewport: (bounds: ViewportBounds) => TileKey[];
/**
 * Checks if a point is within bounds
 */
export declare const isPointInBounds: (longitude: number, latitude: number, bounds: ViewportBounds) => boolean;
/**
 * Converts tile keys to GeoJSON FeatureCollection for debug visualization.
 */
export declare const tilesToGeoJSON: (tileKeys: TileKey[]) => GeoJSON.FeatureCollection;
/**
 * Checks if viewport shows too many tiles and zooms in if needed.
 * Also ensures zoom is at least enough to break clusters.
 * Returns true if zoom was adjusted, false otherwise.
 */
export declare const enforceZoomLimitIfNeeded: (map: MapboxMap) => boolean;
//# sourceMappingURL=tile-math.d.ts.map