/**
 * Grid 3D Utilities
 *
 * Utility functions for 3D grid coordinate transformations,
 * raycasting, and spatial calculations for GameCanvas3D.
 *
 * @packageDocumentation
 */
import * as THREE from 'three';
export interface Grid3DConfig {
    /** Size of each grid cell */
    cellSize: number;
    /** Grid offset X */
    offsetX?: number;
    /** Grid offset Z */
    offsetZ?: number;
    /** Grid Y height (elevation) */
    elevation?: number;
}
export interface GridCoordinate {
    x: number;
    y: number;
    z: number;
}
/**
 * Convert grid coordinates to world position
 * @param gridX - Grid X coordinate
 * @param gridZ - Grid Z coordinate
 * @param config - Grid configuration
 * @returns World position vector
 */
export declare function gridToWorld(gridX: number, gridZ: number, config?: Grid3DConfig): THREE.Vector3;
/**
 * Convert world position to grid coordinates
 * @param worldX - World X position
 * @param worldZ - World Z position
 * @param config - Grid configuration
 * @returns Grid coordinates
 */
export declare function worldToGrid(worldX: number, worldZ: number, config?: Grid3DConfig): {
    x: number;
    z: number;
};
/**
 * Raycast from camera through mouse position to find grid intersection
 * @param camera - Three.js camera
 * @param mouseX - Mouse X position (normalized -1 to 1)
 * @param mouseY - Mouse Y position (normalized -1 to 1)
 * @param planeY - Y height of the intersection plane (default: 0)
 * @returns Intersection point or null
 */
export declare function raycastToPlane(camera: THREE.Camera, mouseX: number, mouseY: number, planeY?: number): THREE.Vector3 | null;
/**
 * Raycast from camera through mouse position against a set of objects
 * @param camera - Three.js camera
 * @param mouseX - Mouse X position (normalized -1 to 1)
 * @param mouseY - Mouse Y position (normalized -1 to 1)
 * @param objects - Array of objects to test
 * @returns First intersection or null
 */
export declare function raycastToObjects(camera: THREE.Camera, mouseX: number, mouseY: number, objects: THREE.Object3D[]): THREE.Intersection | null;
/**
 * Calculate distance between two grid coordinates
 * @param a - First grid coordinate
 * @param b - Second grid coordinate
 * @returns Distance in grid units
 */
export declare function gridDistance(a: {
    x: number;
    z: number;
}, b: {
    x: number;
    z: number;
}): number;
/**
 * Calculate Manhattan distance between two grid coordinates
 * @param a - First grid coordinate
 * @param b - Second grid coordinate
 * @returns Manhattan distance
 */
export declare function gridManhattanDistance(a: {
    x: number;
    z: number;
}, b: {
    x: number;
    z: number;
}): number;
/**
 * Get neighboring grid cells
 * @param x - Center X coordinate
 * @param z - Center Z coordinate
 * @param includeDiagonal - Whether to include diagonal neighbors
 * @returns Array of neighbor coordinates
 */
export declare function getNeighbors(x: number, z: number, includeDiagonal?: boolean): {
    x: number;
    z: number;
}[];
/**
 * Check if a grid coordinate is within bounds
 * @param x - X coordinate
 * @param z - Z coordinate
 * @param bounds - Bounds object
 * @returns Whether the coordinate is within bounds
 */
export declare function isInBounds(x: number, z: number, bounds: {
    minX: number;
    maxX: number;
    minZ: number;
    maxZ: number;
}): boolean;
/**
 * Get all grid cells within a circular radius
 * @param centerX - Center X coordinate
 * @param centerZ - Center Z coordinate
 * @param radius - Radius in grid units
 * @returns Array of coordinates within radius
 */
export declare function getCellsInRadius(centerX: number, centerZ: number, radius: number): {
    x: number;
    z: number;
}[];
/**
 * Create a highlight mesh for grid cells
 * @param color - Highlight color
 * @param opacity - Opacity (0-1)
 * @returns Mesh that can be positioned at grid cells
 */
export declare function createGridHighlight(color?: number, opacity?: number): THREE.Mesh;
/**
 * Normalize mouse coordinates to NDC (-1 to 1)
 * @param clientX - Mouse client X
 * @param clientY - Mouse client Y
 * @param element - Canvas element
 * @returns Normalized coordinates
 */
export declare function normalizeMouseCoordinates(clientX: number, clientY: number, element: HTMLElement): {
    x: number;
    y: number;
};
declare const _default: {
    gridToWorld: typeof gridToWorld;
    worldToGrid: typeof worldToGrid;
    raycastToPlane: typeof raycastToPlane;
    raycastToObjects: typeof raycastToObjects;
    gridDistance: typeof gridDistance;
    gridManhattanDistance: typeof gridManhattanDistance;
    getNeighbors: typeof getNeighbors;
    isInBounds: typeof isInBounds;
    getCellsInRadius: typeof getCellsInRadius;
    createGridHighlight: typeof createGridHighlight;
    normalizeMouseCoordinates: typeof normalizeMouseCoordinates;
};
export default _default;
