/**
 * GameCanvas3D
 *
 * 3D game canvas component using Three.js.
 * Mirrors the IsometricCanvas API for easy migration.
 *
 * **State categories (closed-circuit compliant):**
 * - All game data (tiles, units, features, selection, validMoves) → received via props
 * - Rendering state (hoveredTile, internalError, asset loading, camera) → local only
 * - Events → emitted via `useGameCanvas3DEvents()` hook for trait integration
 *
 * This component is a **pure 3D renderer** — it holds no game logic state.
 *
 * @packageDocumentation
 */
import React from 'react';
import type { EventEmit } from '@almadar/core';
import * as THREE from 'three';
import { AssetLoader } from './three/loaders/AssetLoader';
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
import './GameCanvas3D.css';
export type { IsometricTile, IsometricUnit, IsometricFeature };
/** Game event for canvas display */
export interface GameEvent {
    id: string;
    type: string;
    x: number;
    z?: number;
    y?: number;
    message?: string;
}
/** Camera mode for 3D view */
export type CameraMode = 'isometric' | 'perspective' | 'top-down';
/** Map orientation */
export type MapOrientation = 'standard' | 'rotated';
/** Overlay control */
export type OverlayControl = 'default' | 'hidden' | 'minimap';
/** Unit animation state */
export type UnitAnimationState = 'idle' | 'walk' | 'attack' | 'hurt' | 'die';
/** Props for GameCanvas3D component */
export interface GameCanvas3DProps {
    /** Additional CSS classes */
    className?: string;
    /** Children to render inside the 3D canvas (e.g., physics objects, custom meshes) */
    children?: React.ReactNode;
    /** Loading state indicator */
    isLoading?: boolean;
    /** Error state */
    error?: string | null;
    /** Entity name for schema-driven auto-fetch */
    entity?: string;
    /** Array of tiles to render */
    tiles?: IsometricTile[];
    /** Array of units to render */
    units?: IsometricUnit[];
    /** Array of features to render */
    features?: IsometricFeature[];
    /** Array of events to display */
    events?: Array<GameEvent>;
    /** Fog of war data */
    fogOfWar?: boolean[][];
    /** Map orientation */
    orientation?: MapOrientation;
    /** Camera mode */
    cameraMode?: CameraMode;
    /** Show grid */
    showGrid?: boolean;
    /** Show coordinates overlay */
    showCoordinates?: boolean;
    /** Show tile information */
    showTileInfo?: boolean;
    /** Overlay control mode */
    overlay?: OverlayControl;
    /** Enable shadows */
    shadows?: boolean;
    /** Background color */
    backgroundColor?: string;
    /** Callback when a tile is clicked */
    onTileClick?: (tile: IsometricTile, event: React.MouseEvent) => void;
    /** Callback when a unit is clicked */
    onUnitClick?: (unit: IsometricUnit, event: React.MouseEvent) => void;
    /** Callback when a feature is clicked */
    onFeatureClick?: (feature: IsometricFeature, event: React.MouseEvent) => void;
    /** Callback when canvas is clicked (background) */
    onCanvasClick?: (event: React.MouseEvent) => void;
    /** Callback when mouse moves over a tile */
    onTileHover?: (tile: IsometricTile | null, event: React.MouseEvent) => void;
    /** Callback for unit animation state change */
    onUnitAnimation?: (unitId: string, state: string) => void;
    /** Asset loader instance (uses global singleton if not provided) */
    assetLoader?: AssetLoader;
    /** Custom tile renderer component */
    tileRenderer?: React.FC<{
        tile: IsometricTile;
        position: [number, number, number];
    }>;
    /** Custom unit renderer component */
    unitRenderer?: React.FC<{
        unit: IsometricUnit;
        position: [number, number, number];
    }>;
    /** Custom feature renderer component */
    featureRenderer?: React.FC<{
        feature: IsometricFeature;
        position: [number, number, number];
    }>;
    /** URLs to preload */
    preloadAssets?: string[];
    /** Declarative event: tile click */
    tileClickEvent?: EventEmit<{
        tileId: string;
        x: number;
        z: number;
        type?: string;
        terrain?: string;
        elevation?: number;
    }>;
    /** Declarative event: unit click */
    unitClickEvent?: EventEmit<{
        unitId: string;
        x: number;
        z: number;
        unitType?: string;
        name?: string;
        team?: string;
        faction?: string;
        health?: number;
        maxHealth?: number;
    }>;
    /** Declarative event: feature click */
    featureClickEvent?: EventEmit<{
        featureId: string;
        x: number;
        z: number;
        type?: string;
        elevation?: number;
    }>;
    /** Declarative event: canvas click */
    canvasClickEvent?: EventEmit<{
        clientX: number;
        clientY: number;
        button: number;
    }>;
    /** Declarative event: tile hover */
    tileHoverEvent?: EventEmit<{
        tileId: string;
        x: number;
        z: number;
        type?: string;
    }>;
    /** Declarative event: tile leave */
    tileLeaveEvent?: EventEmit<Record<string, never>>;
    /** Declarative event: unit animation */
    unitAnimationEvent?: EventEmit<{
        unitId: string;
        state: string;
        timestamp: number;
    }>;
    /** Declarative event: camera change */
    cameraChangeEvent?: EventEmit<{
        position: {
            x: number;
            y: number;
            z: number;
        };
        timestamp: number;
    }>;
    /** Loading message */
    loadingMessage?: string;
    /** Whether to use instancing for tiles */
    useInstancing?: boolean;
    /** Valid move positions */
    validMoves?: Array<{
        x: number;
        z: number;
    }>;
    /** Attack target positions */
    attackTargets?: Array<{
        x: number;
        z: number;
    }>;
    /** Selected tile IDs */
    selectedTileIds?: string[];
    /** Selected unit ID */
    selectedUnitId?: string | null;
}
/** Imperative handle for GameCanvas3D */
export interface GameCanvas3DHandle {
    /** Get current camera position */
    getCameraPosition: () => THREE.Vector3 | null;
    /** Set camera position */
    setCameraPosition: (x: number, y: number, z: number) => void;
    /** Look at a specific point */
    lookAt: (x: number, y: number, z: number) => void;
    /** Reset camera to default position */
    resetCamera: () => void;
    /** Take a screenshot */
    screenshot: () => string | null;
    /** Export current view as data */
    export: () => {
        tiles: IsometricTile[];
        units: IsometricUnit[];
        features: IsometricFeature[];
    };
}
/**
 * GameCanvas3D Component
 *
 * 3D game canvas that mirrors the IsometricCanvas API.
 * Uses Three.js and React Three Fiber for rendering.
 *
 * @example
 * ```tsx
 * <GameCanvas3D
 *   tiles={tiles}
 *   units={units}
 *   features={features}
 *   cameraMode="isometric"
 *   tileClickEvent="TILE_SELECTED"
 *   onTileClick={(tile) => console.log('Clicked:', tile)}
 * />
 * ```
 */
export declare const GameCanvas3D: React.ForwardRefExoticComponent<GameCanvas3DProps & React.RefAttributes<GameCanvas3DHandle>>;
export default GameCanvas3D;
