import { ForwardRefExoticComponent } from 'react';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { RefAttributes } from 'react';
import * as THREE from 'three';

/**
 * Ambient light configuration - uniform background lighting (no shadows)
 *
 * @example
 * ```tsx
 * { type: 'ambient', intensity: 0.3, color: '#ffffff' }
 * ```
 */
declare interface AmbientLightConfig {
    type: 'ambient';
    /** Light intensity. Default: 0.5 */
    intensity?: number;
    /** Light color. Default: '#ffffff' */
    color?: string;
}

/**
 * AnimatedModel - 3D model with animation support and bone attachment capability
 *
 * @remarks
 * This component:
 * - Loads GLB/GLTF models with animations using useGLTF
 * - Properly clones skinned meshes using SkeletonUtils for multiple instances
 * - Plays animations with automatic crossfading
 * - Supports morph targets for character customization
 * - Provides context for BoneAttachment children
 * - Exposes imperative API via ref for external animation control
 *
 * The ref provides these methods:
 * - `playAnimation(name, options)` - Play an animation with optional loop/restore
 * - `playAnimationLayers(layers)` - Play multiple animation layers in parallel
 * - `stopAnimation()` - Stop current animation
 * - `stopAnimationLayers()` - Stop all active animation layers
 * - `getAnimationNames()` - Get list of available animations
 * - `getGroup()` - Get the THREE.Group for advanced manipulation
 * - `setMorphTarget(name, value)` - Set morph target value
 * - `getMorphTargetNames()` - Get available morph target names
 *
 * @param ref - React ref for imperative API access
 * @param url - URL or path to GLB/GLTF model file with animations. Example: `"/models/character.glb"`
 * @param position - Model position in 3D space as [x, y, z]. Example: `[0, -1, 0]`. Default: `[0, 0, 0]`
 * @param rotation - Model rotation in radians as [x, y, z]. Example: `[0, Math.PI, 0]`. Default: `[0, 0, 0]`
 * @param scale - Uniform scale (number) or per-axis scale [x, y, z]. Examples: `0.5` or `[1, 2, 1]`. Default: `1`
 * @param defaultAnimation - Name of animation to play on load. If not specified, plays first animation. Example: `"Idle"`
 * @param animation - Controlled single animation name
 * @param animationLayers - Controlled parallel animation layers (takes priority over `animation`)
 * @param morphTargets - Morph target values as key-value pairs where value is 0-1. Example: `{ muscular: 0.5, thin: 0.2 }`
 * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Hairgirl1": true, "Hairgirl2": false }`
 * @param materialColors - Material colors as key-value pairs. Example: `{ "Hair_girl_1": "#ff0000" }`
 * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
 * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
 * @param children - Child components, typically BoneAttachment components for attaching items
 * @param onLoad - Callback when model loads. Receives AnimatedModelInfo object: `{ meshes, materials, bones, nodeCount, animations, morphTargetNames }`
 * @param onError - Callback when model fails to load. Receives Error object
 *
 * @example
 * ```tsx
 * const modelRef = useRef<AnimatedModelHandle>(null);
 *
 * <AnimatedModel
 *   ref={modelRef}
 *   url="/models/character.glb"
 *   defaultAnimation="Idle"
 *   morphTargets={{ muscular: 0.5 }}
 *   meshVisibility={{ "Hairgirl1": true, "Hairgirl2": false }}
 *   materialColors={{ "Hair_girl_1": "#ff0000" }}
 *   materialTextures={{ "Metal": { map: "/metal.webp", roughnessMap: "/rough.webp" } }}
 *   position={[0, -1, 0]}
 * >
 *   <BoneAttachment bone="hand_r">
 *     <Model url="/models/sword.glb" />
 *   </BoneAttachment>
 * </AnimatedModel>
 *
 * // Control animations from outside
 * modelRef.current?.playAnimation('Attack', { loop: false });
 * ```
 */
export declare const AnimatedModel: ForwardRefExoticComponent<AnimatedModelProps & RefAttributes<AnimatedModelHandle>>;

/**
 * Single animation layer configuration for parallel playback.
 */
export declare interface AnimatedModelAnimationLayer {
    /** Animation name (supports exact and partial matching) */
    name: string;
    /** Loop layer continuously. Default: true */
    loop?: boolean;
    /** Layer weight. Default: 1 */
    weight?: number;
    /** Playback speed multiplier. Default: 1 */
    timeScale?: number;
    /** Fade-in duration in seconds. Default: 0.2 */
    fadeIn?: number;
    /** Optional mask to apply this layer only to selected nodes */
    mask?: AnimatedModelAnimationMask;
}

/**
 * Animation layer input (short form string or full config).
 */
export declare type AnimatedModelAnimationLayerInput = string | AnimatedModelAnimationLayer;

/**
 * Node mask for animation layer tracks.
 * Use node names from `onLoad` (`meshes` and `bones`) to limit where a layer applies.
 */
export declare interface AnimatedModelAnimationMask {
    /** Only tracks targeting these nodes will be played */
    includeNodes?: string[];
    /** Tracks targeting these nodes will be removed from the layer */
    excludeNodes?: string[];
}

/**
 * Imperative handle for AnimatedModel (accessed via ref)
 *
 * @example
 * ```tsx
 * ref.current?.playAnimation('Attack', { loop: false });
 * ref.current?.setMorphTarget('muscular', 0.8);
 * ```
 */
export declare interface AnimatedModelHandle {
    /**
     * Play an animation by name
     * @param name - Animation name (supports partial matching)
     * @param options - Playback options
     */
    playAnimation: (name: string, options?: {
        /** Loop the animation continuously. Default: false */
        loop?: boolean;
        /** Duration of crossfade in seconds. Default: 0.2 */
        crossFadeDuration?: number;
        /** Restore default animation when this one finishes. Default: true */
        restoreDefault?: boolean;
    }) => void;
    /** Stop the currently playing animation */
    stopAnimation: () => void;
    /**
     * Play multiple animations in parallel layers
     * @param layers - List of animation layer configs (or plain names)
     */
    playAnimationLayers: (layers: AnimatedModelAnimationLayerInput[]) => void;
    /** Stop all currently active animation layers */
    stopAnimationLayers: () => void;
    /** Get array of all available animation names */
    getAnimationNames: () => string[];
    /** Get the THREE.Group object for advanced manipulation */
    getGroup: () => THREE.Group | null;
    /**
     * Set a morph target value
     * @param name - Morph target name
     * @param value - Value between 0 and 1
     */
    setMorphTarget: (name: string, value: number) => void;
    /** Get array of all available morph target names */
    getMorphTargetNames: () => string[];
    /**
     * Set mesh visibility
     * @param name - Mesh name
     * @param visible - True to show, false to hide
     */
    setMeshVisibility: (name: string, visible: boolean) => void;
    /** Get array of all mesh names */
    getMeshNames: () => string[];
    /**
     * Set material color
     * @param name - Material name
     * @param color - Hex color string (e.g., "#ff0000") or RGB array [r, g, b] where values are 0-1
     */
    setMaterialColor: (name: string, color: string | [number, number, number]) => void;
    /** Get array of all material names */
    getMaterialNames: () => string[];
    /**
     * Get current color of a material
     * @param name - Material name
     * @returns Hex color string or null
     */
    getMaterialColor: (name: string) => string | null;
    /**
     * Set textures for a material
     * @param name - Material name
     * @param textures - Texture configuration or single map URL
     */
    setMaterialTextures: (name: string, textures: MaterialTextures | string) => void;
    /**
     * Clear all textures from a material
     * @param name - Material name
     */
    clearMaterialTextures: (name: string) => void;
}

/**
 * Extended model information including animation and morph target data
 */
export declare interface AnimatedModelInfo extends ModelInfo {
    /** Names of all animations in the model */
    animations: string[];
    /** Names of all morph targets (blend shapes) */
    morphTargetNames: string[];
}

/**
 * Props for AnimatedModel component
 *
 * @example
 * ```tsx
 * const ref = useRef<AnimatedModelHandle>(null);
 *
 * <AnimatedModel
 *   ref={ref}
 *   url="/character.glb"
 *   defaultAnimation="Idle"
 *   morphTargets={{ muscular: 0.5 }}
 *   position={[0, -1, 0]}
 * >
 *   <BoneAttachment bone="hand_r">
 *     <Model url="/sword.glb" />
 *   </BoneAttachment>
 * </AnimatedModel>
 * ```
 */
export declare interface AnimatedModelProps extends Omit<ModelProps, 'onLoad'> {
    /** Child components (typically BoneAttachment components) */
    children?: React.ReactNode;
    /** Name of animation to play on load (auto-plays first if not specified) */
    defaultAnimation?: string;
    /** Controlled animation name. When changed, AnimatedModel switches to this animation */
    animation?: string;
    /**
     * Controlled parallel animation layers.
     * If provided, takes priority over `animation`.
     *
     * @example
     * animationLayers={[
     *   'Idleger1',
     *   { name: 'GirlFaceidle.007', mask: { includeNodes: ['Eyewitegirl', 'Girlbody_1'] } },
     *   { name: 'Lashesgirl6idle.013', mask: { includeNodes: ['Lashesgirl'] } },
     * ]}
     */
    animationLayers?: AnimatedModelAnimationLayerInput[];
    /** Morph target values as key-value pairs { targetName: value } where value is 0-1 */
    morphTargets?: Record<string, number>;
    /** Mesh visibility as key-value pairs { meshName: visible }. Example: { "Hairgirl1": true, "Hairgirl2": false } */
    meshVisibility?: Record<string, boolean>;
    /** Material colors as key-value pairs { materialName: color }. Example: { "Hair_girl_1": "#ff0000" } */
    materialColors?: Record<string, string | [number, number, number]>;
    /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
    materialTextures?: Record<string, MaterialTextures | string>;
    /** Enable verbose material texture logs for this model instance. Default: false */
    materialTextureLogging?: boolean;
    /**
     * Names of eye bone objects to animate with mouse-follow behavior.
     * When provided, the model's eyes will track the mouse cursor.
     * @example eyeNames={['Eye_L', 'Eye_R']}
     */
    eyeNames?: string[];
    /** Callback when model loads with extended metadata including animations */
    onLoad?: (info: AnimatedModelInfo) => void;
}

/**
 * Base light configuration with common properties
 */
declare interface BaseLightConfig {
    /** Light type */
    type: LightType;
    /** Light color as hex string. Default: '#ffffff' */
    color?: string;
    /** Light intensity. Default varies by light type */
    intensity?: number;
}

/**
 * BoneAttachment - Attach models to bones of an AnimatedModel parent
 *
 * @remarks
 * This component:
 * - Must be used as a child of AnimatedModel
 * - Uses React Three Fiber's createPortal to attach to a bone
 * - Automatically follows bone transformations during animations
 * - Supports position/rotation/scale offsets relative to the bone
 *
 * Common bone names:
 * - Hand bones: "hand_r", "hand_l", "DEF-handR", "DEF-handL"
 * - Spine/Back: "spine", "spine_upper", "back"
 * - Head: "head", "neck"
 *
 * @param children - Child components to attach to the bone (typically Model components)
 * @param bone - Bone name to attach to. Must match bone name in the parent AnimatedModel. Example: `"hand_r"` or `"DEF-handR"`
 * @param position - Position offset relative to the bone as [x, y, z]. Example: `[0.1, 0, 0]`. Default: `[0, 0, 0]`
 * @param rotation - Rotation offset relative to the bone in radians as [x, y, z]. Example: `[0, Math.PI/2, 0]`. Default: `[0, 0, 0]`
 * @param scale - Uniform scale (number) or per-axis scale [x, y, z]. Examples: `0.7` or `[1, 2, 1]`. Default: `1`
 *
 * @example
 * ```tsx
 * <AnimatedModel url="/character.glb">
 *   // Sword in right hand
 *   <BoneAttachment
 *     bone="hand_r"
 *     position={[0.1, 0, 0]}
 *     rotation={[0, Math.PI/2, 0]}
 *   >
 *     <Model url="/sword.glb" scale={0.7} />
 *   </BoneAttachment>
 *
 *   // Shield on back
 *   <BoneAttachment bone="spine_upper">
 *     <Model url="/shield.glb" />
 *   </BoneAttachment>
 * </AnimatedModel>
 * ```
 */
export declare function BoneAttachment({ children, bone, position, rotation, scale, }: BoneAttachmentProps): JSX.Element | null;

export declare interface BoneAttachmentProps {
    children: React.ReactNode;
    /** Bone name to attach to */
    bone: string;
    /** Position offset relative to bone */
    position?: [number, number, number];
    /** Rotation offset relative to bone (radians) */
    rotation?: [number, number, number];
    /** Scale */
    scale?: number | [number, number, number];
}

/**
 * Directional light configuration - parallel rays (like sunlight)
 *
 * @example
 * ```tsx
 * { type: 'directional', position: [10, 20, 10], intensity: 40, castShadow: true, shadowMapSize: 2048 }
 * ```
 */
declare interface DirectionalLightConfig extends BaseLightConfig {
    type: 'directional';
    /** Light position [x, y, z]. Default: [10, 20, 10] */
    position?: [number, number, number];
    /** Enable shadow casting. Default: true */
    castShadow?: boolean;
    /** Shadow map size in px (square). Default: 2048 */
    shadowMapSize?: number;
}

/**
 * Environment (HDRI) configuration for realistic lighting and reflections
 *
 * @remarks
 * Works together with `lights` (they are not mutually exclusive).
 * `intensity` and `blur` are applied to the active scene environment/background.
 *
 * @example
 * ```tsx
 * { files: '/scenes/studio.hdr', intensity: 1, background: false }
 * ```
 */
declare interface EnvironmentConfig {
    /** URL to HDRI file (.hdr or .exr) */
    files: string;
    /** Environment intensity multiplier for scene environment. Default: 1 */
    intensity?: number;
    /** Use HDRI as scene background. Default: false */
    background?: boolean;
    /** Background blur amount (0-1). Default: 0 */
    blur?: number;
}

/**
 * Hemisphere light configuration - soft sky/ground lighting (no shadows)
 *
 * @example
 * ```tsx
 * { type: 'hemisphere', skyColor: '#87CEEB', groundColor: '#362312', intensity: 0.5 }
 * ```
 */
declare interface HemisphereLightConfig {
    type: 'hemisphere';
    /** Sky color. Default: '#ffffff' */
    skyColor?: string;
    /** Ground color. Default: '#444444' */
    groundColor?: string;
    /** Light intensity. Default: 0.5 */
    intensity?: number;
    /** Light position [x, y, z]. Default: [0, 10, 0] */
    position?: [number, number, number];
}

/**
 * Union type for all light configurations
 */
declare type LightConfigUnion = SpotLightConfig | PointLightConfig | DirectionalLightConfig | HemisphereLightConfig | AmbientLightConfig;

/**
 * Light types supported by Scene3D component
 */
declare type LightType = 'spot' | 'point' | 'directional' | 'hemisphere' | 'ambient';

export declare type MaterialTextures = MaterialTextures_2;

/**
 * Material texture maps configuration
 */
declare interface MaterialTextures_2 {
    /** Base/Diffuse color map */
    map?: string;
    /** Normal map */
    normalMap?: string;
    /** Roughness map */
    roughnessMap?: string;
    /** Metallic map */
    metalnessMap?: string;
    /** Emissive map */
    emissiveMap?: string;
    /** Alpha/Opacity map */
    alphaMap?: string;
    /** Ambient Occlusion map */
    aoMap?: string;
}

/**
 * Model - Simple 3D model component for loading and displaying GLB/GLTF files
 *
 * @remarks
 * This component:
 * - Loads GLB/GLTF models using drei's useGLTF hook
 * - Automatically clones the scene for independent instances
 * - Configures shadows on all meshes
 * - Supports position, rotation, and scale transforms
 * - Provides onLoad callback with model metadata
 *
 * @param url - URL or path to GLB/GLTF model file. Example: `"/models/sword.glb"`
 * @param position - Model position in 3D space as [x, y, z]. Example: `[0, 0, 0]`. Default: `[0, 0, 0]`
 * @param rotation - Model rotation in radians as [x, y, z]. Example: `[0, Math.PI/2, 0]`. Default: `[0, 0, 0]`
 * @param scale - Uniform scale (number) or per-axis scale [x, y, z]. Examples: `0.5` or `[1, 2, 1]`. Default: `1`
 * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Part1": true, "Part2": false }`
 * @param materialColors - Material colors as key-value pairs. Example: `{ "MaterialName": "#ff0000" }`
 * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
 * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
 * @param onLoad - Callback when model finishes loading. Receives ModelInfo object with metadata: `{ meshes, materials, bones, nodeCount }`
 * @param onError - Callback when model fails to load. Receives Error object
 *
 * @example
 * ```tsx
 * <Model
 *   url="/models/sword.glb"
 *   position={[0, 0, 0]}
 *   rotation={[0, Math.PI/2, 0]}
 *   scale={0.5}
 *   meshVisibility={{ "Blade": true, "Handle": false }}
 *   onLoad={(info) => console.log('Loaded:', info)}
 * />
 * ```
 */
export declare function Model({ url, position, rotation, scale, meshVisibility, materialColors, materialTextures, materialTextureLogging, onLoad, onTexturesLoaded, onError: _onError, }: ModelProps): JSX_2.Element;

export declare namespace Model {
    var preload: (url: string) => void;
}

/**
 * Metadata information about a loaded model
 */
export declare interface ModelInfo {
    /** Names of all mesh objects in the model */
    meshes: string[];
    /** Names of all materials used by the model */
    materials: string[];
    /** Names of all bones (for skinned/rigged meshes) */
    bones: string[];
    /** Total number of nodes in the scene graph */
    nodeCount: number;
}

/**
 * Props for Model component
 *
 * @example
 * ```tsx
 * <Model
 *   url="/models/sword.glb"
 *   position={[0, 0, 0]}
 *   rotation={[0, Math.PI/2, 0]}
 *   scale={0.5}
 * />
 * ```
 */
export declare interface ModelProps {
    /** URL or path to GLB/GLTF model file */
    url: string;
    /** Model position in 3D space [x, y, z]. Default: [0, 0, 0] */
    position?: [number, number, number];
    /** Model rotation in radians [x, y, z]. Default: [0, 0, 0] */
    rotation?: [number, number, number];
    /** Uniform scale (number) or per-axis scale [x, y, z]. Default: 1 */
    scale?: number | [number, number, number];
    /** Mesh visibility as key-value pairs { meshName: visible }. Example: { "Hairgirl1": true, "Hairgirl2": false } */
    meshVisibility?: Record<string, boolean>;
    /** Material colors as key-value pairs { materialName: color }. Example: { "Hair_girl_1": "#ff0000" } */
    materialColors?: Record<string, string | [number, number, number]>;
    /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
    materialTextures?: Record<string, MaterialTextures | string>;
    /** Enable verbose material texture logs for this model instance. Default: false */
    materialTextureLogging?: boolean;
    /** Callback when model finishes loading with metadata */
    onLoad?: (info: ModelInfo) => void;
    /** Callback when model fails to load */
    onError?: (error: Error) => void;
    /** Callback when textures have finished loading and applying */
    onTexturesLoaded?: () => void;
}

/**
 * MorphableModel - 3D model with morph targets for shape customization
 *
 * @remarks
 * This component:
 * - Loads GLB/GLTF models with morph targets (blend shapes)
 * - Dynamically discovers available morph targets from the model
 * - Applies morph target values in real-time
 * - Provides imperative API via ref for programmatic control
 *
 * Morph targets are commonly used for:
 * - Character customization (muscular, thin, fat)
 * - Facial expressions (smile, frown, blink)
 * - Clothing fit adjustments
 *
 * @param ref - React ref for imperative API access
 * @param url - URL or path to GLB/GLTF model file with morph targets. Example: `"/models/character.glb"`
 * @param position - Model position in 3D space as [x, y, z]. Example: `[0, -1, 0]`. Default: `[0, 0, 0]`
 * @param rotation - Model rotation in radians as [x, y, z]. Example: `[0, Math.PI, 0]`. Default: `[0, 0, 0]`
 * @param scale - Uniform scale (number) or per-axis scale [x, y, z]. Examples: `0.5` or `[1, 2, 1]`. Default: `1`
 * @param morphTargets - Morph target values as key-value pairs where value is 0-1. Example: `{ muscular: 0.5, thin: 0.2 }`
 * @param meshVisibility - Mesh visibility as key-value pairs. Example: `{ "Hairgirl1": true, "Hairgirl2": false }`
 * @param materialColors - Material colors as key-value pairs. Example: `{ "Hair_girl_1": "#ff0000" }`
 * @param materialTextures - Material texture maps. Example: `{ "Metal": { map: "/tex.webp", normalMap: "/normal.webp" } }`
 * @param materialTextureLogging - Enable verbose material texture logs for this model instance. Default: `false`
 * @param onMorphTargetsFound - Callback when morph targets are discovered from the model. Receives array of morph target names: `["muscular", "thin", "fat"]`
 * @param onLoad - Callback when model finishes loading. Receives ModelInfo object with metadata: `{ meshes, materials, bones, nodeCount }`
 * @param onError - Callback when model fails to load. Receives Error object
 *
 * @example
 * ```tsx
 * const modelRef = useRef<MorphableModelHandle>(null);
 * const [morphs, setMorphs] = useState({ muscular: 0.5, thin: 0.2 });
 *
 * <MorphableModel
 *   ref={modelRef}
 *   url="/models/character.glb"
 *   morphTargets={morphs}
 *   meshVisibility={{ "Hairgirl1": true, "Hairgirl2": false }}
 *   onMorphTargetsFound={(names) => console.log('Available:', names)}
 *   position={[0, -1, 0]}
 * />
 *
 * // Control programmatically
 * modelRef.current?.setMorphTarget('muscular', 0.8);
 * ```
 */
export declare const MorphableModel: ForwardRefExoticComponent<MorphableModelProps & RefAttributes<MorphableModelHandle>>;

/**
 * Imperative handle for MorphableModel (accessed via ref)
 *
 * @example
 * ```tsx
 * ref.current?.setMorphTarget('muscular', 0.8);
 * const names = ref.current?.getMorphTargetNames();
 * ```
 */
export declare interface MorphableModelHandle {
    /**
     * Set a morph target value
     * @param name - Morph target name
     * @param value - Value between 0 and 1
     */
    setMorphTarget: (name: string, value: number) => void;
    /** Get array of all available morph target names */
    getMorphTargetNames: () => string[];
    /** Get current values of all morph targets */
    getMorphTargetValues: () => Record<string, number>;
    /**
     * Set mesh visibility
     * @param name - Mesh name
     * @param visible - True to show, false to hide
     */
    setMeshVisibility: (name: string, visible: boolean) => void;
    /** Get array of all mesh names */
    getMeshNames: () => string[];
    /**
     * Set material color
     * @param name - Material name
     * @param color - Hex color string (e.g., "#ff0000") or RGB array [r, g, b] where values are 0-1
     */
    setMaterialColor: (name: string, color: string | [number, number, number]) => void;
    /** Get array of all material names */
    getMaterialNames: () => string[];
    /**
     * Get current color of a material
     * @param name - Material name
     * @returns Hex color string or null
     */
    getMaterialColor: (name: string) => string | null;
    /**
     * Set textures for a material
     * @param name - Material name
     * @param textures - Texture configuration or single map URL
     */
    setMaterialTextures: (name: string, textures: MaterialTextures | string) => void;
    /**
     * Clear all textures from a material
     * @param name - Material name
     */
    clearMaterialTextures: (name: string) => void;
}

/**
 * Props for MorphableModel component
 *
 * @example
 * ```tsx
 * <MorphableModel
 *   url="/character.glb"
 *   morphTargets={{ muscular: 0.5, thin: 0.2 }}
 *   onMorphTargetsFound={(names) => console.log(names)}
 * />
 * ```
 */
export declare interface MorphableModelProps extends ModelProps {
    /** Morph target values as key-value pairs { targetName: value } where value is 0-1 */
    morphTargets?: Record<string, number>;
    /** Mesh visibility as key-value pairs { meshName: visible }. Example: { "Hairgirl1": true, "Hairgirl2": false } */
    meshVisibility?: Record<string, boolean>;
    /** Material colors as key-value pairs { materialName: color }. Example: { "Hair_girl_1": "#ff0000" } */
    materialColors?: Record<string, string | [number, number, number]>;
    /** Material textures as key-value pairs { materialName: textures }. Example: { "Metal": { map: "/tex.webp" } } */
    materialTextures?: Record<string, MaterialTextures | string>;
    /** Enable verbose material texture logs for this model instance. Default: false */
    materialTextureLogging?: boolean;
    /** Callback when morph targets are discovered from the model */
    onMorphTargetsFound?: (names: string[]) => void;
}

/**
 * Point light configuration - omnidirectional light (like a light bulb)
 *
 * @example
 * ```tsx
 * { type: 'point', position: [0, 5, 0], intensity: 20, color: '#ffaa00', castShadow: true, shadowMapSize: 2048 }
 * ```
 */
declare interface PointLightConfig extends BaseLightConfig {
    type: 'point';
    /** Light position [x, y, z]. Default: [0, 5, 0] */
    position?: [number, number, number];
    /** Light distance. Default: 0 (infinite) */
    distance?: number;
    /** Light decay. Default: 2 */
    decay?: number;
    /** Enable shadow casting. Default: false */
    castShadow?: boolean;
    /** Shadow map size in px (square). Default: 2048 */
    shadowMapSize?: number;
}

export declare function preloadModel(url: string): void;

/**
 * Preload standard (non-KTX2) textures into the global cache.
 * Call this as early as possible (e.g. when inventory data loads) to ensure
 * textures are ready before the model is mounted.
 * KTX2 textures require a WebGL renderer — preload them via usePreloadTextures hook instead.
 */
export declare function preloadTextures(textures: Record<string, MaterialTextures_2 | string>): void;

/**
 * WebGL renderer settings for light response and color mapping.
 * Useful for physically based lighting tests.
 *
 * @remarks
 * All fields can be provided together in one `renderer` object.
 */
export declare interface RendererConfig {
    /** Toggle physically-correct light attenuation model */
    physicallyCorrectLights?: boolean;
    /** Output color space. Default: 'srgb' */
    outputColorSpace?: 'srgb' | 'linear';
    /** Tone mapping operator. Default: 'ACESFilmicToneMapping' */
    toneMapping?: ToneMappingMode;
    /** Tone mapping exposure. Default: 1 */
    toneMappingExposure?: number;
}

/**
 * Scene3D - Main 3D scene container with built-in canvas, lighting, and controls
 *
 * @remarks
 * This component wraps React Three Fiber's Canvas and provides:
 * - OrbitControls for camera rotation (preserves state between model changes)
 * - Configurable multi-light system (spot, point, directional, hemisphere, ambient)
 * - Optional background (image URL or hex color like "#1a1a2e")
 * - Optional contact shadows under models
 * - Shadow support
 *
 * @param children - React children to render inside the 3D scene
 * @param camera - Camera configuration object. Example: `{ position: [0, 2, 5], fov: 45 }`
 * @param camera.position - Camera position as [x, y, z]. Example: `[0, 2, 5]`. Default: `[0, 2, 5]`
 * @param camera.fov - Field of view in degrees. Example: `45`. Default: `45`
 * @param camera.roll - Camera roll angle around viewing direction in degrees. Example: `45`. Default: `0`
 * @param controls - OrbitControls configuration object. Example: `{ enablePan: false, minDistance: 2, maxDistance: 10 }`
 * @param controls.enabled - Enable/disable all controls. Default: `true`
 * @param controls.enablePan - Enable camera panning with middle mouse. Default: `true`
 * @param controls.enableZoom - Enable camera zoom with scroll wheel. Default: `true`
 * @param controls.enableRotate - Enable camera rotation with left mouse. Default: `true`
 * @param controls.target - Orbit target point [x, y, z]. Camera looks at this point. Default: `[0, 0, 0]`
 * @param controls.minDistance - Minimum zoom distance. Example: `2`
 * @param controls.maxDistance - Maximum zoom distance. Example: `10`
 * @param controls.minPolarAngle - Minimum vertical rotation angle in radians. Example: `Math.PI / 4`
 * @param controls.maxPolarAngle - Maximum vertical rotation angle in radians. Example: `Math.PI / 1.8`
 * @param controls.autoRotate - Auto-rotate camera around the center. Default: `false`
 * @param controls.autoRotateSpeed - Auto-rotation speed. Default: `2`
 * @param background - Background: image URL (e.g., `"/bg.jpg"`) or hex color (e.g., `"#1a1a2e"`)
 * @param shadows - Enable shadow rendering. Default: `true`
 * @param lights - Array of light configurations. Supports spot, point, directional, hemisphere, and ambient lights. Shadow-casting lights support `shadowMapSize` (default: `2048`). Default: `[{ type: 'ambient', intensity: 0.5 }, { type: 'spot', position: [5, 10, 5], intensity: 50, castShadow: true }]`
 * @param environment - Optional HDRI environment config. Works together with `lights` (combined lighting), not as a replacement.
 * @param renderer - Optional renderer tuning for tone mapping, exposure, output color space and physically-correct lights. All options can be set together in one object.
 * @param contactShadows - Contact shadows configuration. Can be `true` for default settings or object with custom settings. Example: `{ position: [0, -1, 0], opacity: 0.5, blur: 2 }`
 * @param contactShadows.position - Shadow position as [x, y, z]. Example: `[0, -1, 0]`. Default: `[0, -1, 0]`
 * @param contactShadows.opacity - Shadow opacity (0-1). Example: `0.5`. Default: `0.5`
 * @param contactShadows.blur - Shadow blur amount. Example: `2`. Default: `2`
 * @param showLoadingOverlay - Show loading overlay while assets are loading. Default: `true`
 * @param style - Container style object. Example: `{ width: 400, height: 500 }`
 * @param className - Container CSS class name
 *
 * @example
 * Basic setup with default lighting:
 * ```tsx
 * <Scene3D
 *   camera={{ position: [0, 2, 5], fov: 45 }}
 *   background="#1a1a2e"
 *   shadows
 *   style={{ width: 400, height: 500 }}
 * >
 *   <AnimatedModel url="/model.glb" position={[0, -1, 0]} />
 * </Scene3D>
 * ```
 *
 * @example
 * Multi-light setup for better illumination:
 * ```tsx
 * <Scene3D
 *   camera={{ position: [0, 2, 5], fov: 45 }}
 *   lights={[
 *     { type: 'spot', position: [5, 10, 5], intensity: 50, castShadow: true, shadowMapSize: 2048 },
 *     { type: 'spot', position: [-5, 10, -5], intensity: 30, castShadow: false },
 *     { type: 'point', position: [0, 5, 0], intensity: 20 },
 *     { type: 'ambient', intensity: 0.3 }
 *   ]}
 * >
 *   <AnimatedModel url="/model.glb" position={[0, -1, 0]} />
 * </Scene3D>
 * ```
 *
 * @example
 * Using different light types:
 * ```tsx
 * <Scene3D
 *   lights={[
 *     { type: 'directional', position: [10, 20, 10], intensity: 40, castShadow: true },
 *     { type: 'hemisphere', skyColor: '#87CEEB', groundColor: '#362312', intensity: 0.5 },
 *     { type: 'ambient', intensity: 0.2 }
 *   ]}
 * >
 *   <Model url="/model.glb" />
 * </Scene3D>
 * ```
 */
export declare function Scene3D({ children, camera, controls, background, shadows, lights, environment, renderer, contactShadows, showLoadingOverlay, style, className, }: Scene3DProps): JSX_2.Element;

/**
 * Props for Scene3D component
 *
 * @example
 * ```tsx
 * <Scene3D
 *   camera={{ position: [0, 2, 5], fov: 45 }}
 *   controls={{ enablePan: false, minDistance: 2 }}
 *   background="#1a1a2e"
 *   shadows
 *   lights={[
 *     { type: 'spot', position: [5, 10, 5], intensity: 50, castShadow: true },
 *     { type: 'ambient', intensity: 0.3 }
 *   ]}
 * >
 *   {children}
 * </Scene3D>
 * ```
 */
export declare interface Scene3DProps {
    /** React children to render inside the 3D scene */
    children: React.ReactNode;
    /** Camera configuration */
    camera?: {
        /** Camera position [x, y, z]. Default: [0, 2, 5] */
        position?: [number, number, number];
        /** Field of view in degrees. Default: 45 */
        fov?: number;
        /** Camera roll angle around view direction in degrees. Default: 0 */
        roll?: number;
    };
    /** OrbitControls configuration for camera rotation */
    controls?: {
        /** Orbit target point [x, y, z]. Camera will look at this point. Default: [0, 0, 0] */
        target?: [number, number, number];
        /** Enable/disable all controls. Default: true */
        enabled?: boolean;
        /** Enable camera panning (middle mouse). Default: true */
        enablePan?: boolean;
        /** Enable camera zoom (scroll wheel). Default: true */
        enableZoom?: boolean;
        /** Enable camera rotation (left mouse). Default: true */
        enableRotate?: boolean;
        /** Minimum zoom distance */
        minDistance?: number;
        /** Maximum zoom distance */
        maxDistance?: number;
        /** Minimum vertical rotation angle (radians) */
        minPolarAngle?: number;
        /** Maximum vertical rotation angle (radians) */
        maxPolarAngle?: number;
        /** Auto-rotate camera around the center. Default: false */
        autoRotate?: boolean;
        /** Auto-rotation speed. Default: 2 */
        autoRotateSpeed?: number;
    };
    /** Background: image URL ("/bg.jpg") or hex color ("#1a1a2e") */
    background?: string;
    /** Enable shadow rendering. Default: true */
    shadows?: boolean;
    /** Array of light configurations for multi-light setup */
    lights?: LightConfigUnion[];
    /**
     * Environment (HDRI) configuration for realistic lighting and reflections.
     * Can be combined with `lights` for mixed lighting setups.
     */
    environment?: EnvironmentConfig;
    /** Optional renderer tuning (physically-correct lights, tone mapping, exposure, output color space). */
    renderer?: RendererConfig;
    /** Contact shadows configuration (ground shadows under models) */
    contactShadows?: boolean | {
        /** Shadow position [x, y, z]. Default: [0, -1, 0] */
        position?: [number, number, number];
        /** Shadow opacity 0-1. Default: 0.5 */
        opacity?: number;
        /** Shadow blur amount. Default: 2 */
        blur?: number;
    };
    /** Show full-scene loading overlay while models/textures are loading. Default: true */
    showLoadingOverlay?: boolean;
    /** Container style (e.g., { width: 400, height: 500 }) */
    style?: React.CSSProperties;
    /** Container CSS class name */
    className?: string;
}

/**
 * Spot light configuration - focused light in a cone (like a flashlight)
 *
 * @example
 * ```tsx
 * { type: 'spot', position: [5, 10, 5], intensity: 50, castShadow: true, shadowMapSize: 2048 }
 * ```
 */
declare interface SpotLightConfig extends BaseLightConfig {
    type: 'spot';
    /** Light position [x, y, z]. Default: [5, 10, 5] */
    position?: [number, number, number];
    /** Enable shadow casting. Default: true */
    castShadow?: boolean;
    /** Shadow map size in px (square). Default: 2048 */
    shadowMapSize?: number;
    /** Cone angle in radians. Default: Math.PI / 6 */
    angle?: number;
    /** Penumbra (soft edges) 0-1. Default: 0.5 */
    penumbra?: number;
    /** Light decay. Default: 2 */
    decay?: number;
    /** Light distance. Default: 0 (infinite) */
    distance?: number;
}

export declare type ToneMappingMode = 'NoToneMapping' | 'LinearToneMapping' | 'ReinhardToneMapping' | 'CineonToneMapping' | 'ACESFilmicToneMapping';

export declare function useAnimationController(animations: THREE.AnimationClip[], scene: THREE.Object3D, options?: UseAnimationControllerOptions): {
    playAnimation: (name: string, opts?: {
        loop?: boolean;
        crossFadeDuration?: number;
        restoreDefault?: boolean;
    }) => void;
    stopAnimation: () => void;
    playAnimationLayers: (layers: AnimatedModelAnimationLayerInput[]) => void;
    stopAnimationLayers: () => void;
    getAnimationNames: () => string[];
    actions: {
        [x: string]: THREE.AnimationAction | null;
    };
};

declare interface UseAnimationControllerOptions {
    defaultAnimation?: string;
}

export declare function useClonedModel(url: string, options?: UseClonedModelOptions): {
    scene: THREE.Object3D<THREE.Object3DEventMap>;
    animations: THREE.AnimationClip[];
};

declare interface UseClonedModelOptions {
    onLoad?: (info: ModelInfo) => void;
    onError?: (error: Error) => void;
}

/**
 * Animates eye bones to follow the mouse cursor.
 *
 * @param scene - The THREE.Object3D scene subtree containing the eye bones
 * @param eyeNames - Names of eye bone objects to animate. Pass an empty array to disable.
 *
 * @example
 * ```tsx
 * useEyeAnimation(scene, ['Eye_L', 'Eye_R']);
 * ```
 */
export declare const useEyeAnimation: (scene: THREE.Object3D, eyeNames?: readonly string[]) => void;

/**
 * Hook for managing material colors in a 3D scene
 *
 * @param scene - The THREE.Object3D scene containing meshes with materials
 * @param initialColors - Initial color values for materials { materialName: "#hexcolor" or [r, g, b] }
 * @returns Methods to control material colors
 */
export declare function useMaterialColor(scene: THREE.Object3D, initialColors?: Record<string, string | [number, number, number]>): {
    setMaterialColor: (materialName: string, color: string | [number, number, number]) => void;
    getMaterialNames: () => string[];
    getMaterialColor: (materialName: string) => string | null;
    getAllMaterialColors: () => Record<string, string>;
};

/**
 * Hook for managing material textures in a 3D scene
 *
 * @param scene - The THREE.Object3D scene containing meshes with materials
 * @param textures - Initial texture maps for materials { materialName: textureConfig }
 * @param options - Hook runtime options
 * @returns Methods to control material textures
 */
export declare function useMaterialTexture(scene: THREE.Object3D, textures?: Record<string, MaterialTextures_2 | string>, options?: UseMaterialTextureOptions): {
    setMaterialTextures: (materialName: string, textureConfig: MaterialTextures_2 | string) => void;
    getMaterialNames: () => string[];
    clearMaterialTextures: (materialName: string) => void;
};

/**
 * Runtime options for useMaterialTexture hook.
 */
declare interface UseMaterialTextureOptions {
    /**
     * Enable verbose texture lifecycle logs (disabled by default).
     */
    enableLogging?: boolean;
    /**
     * Callback fired when all textures for the material have finished downloading and applying.
     */
    onTexturesLoaded?: () => void;
}

/**
 * Hook for managing mesh visibility in a 3D scene
 *
 * @param scene - The THREE.Object3D scene containing meshes
 * @param visibility - Reactive visibility state for meshes. Updates are applied every frame.
 * @returns Methods to control mesh visibility
 */
export declare function useMeshVisibility(scene: THREE.Object3D, visibility?: Record<string, boolean>): {
    setMeshVisibility: (name: string, visible: boolean) => void;
    getMeshNames: () => string[];
    getMeshVisibility: () => Record<string, boolean>;
};

export declare function useMorphTargets(scene: THREE.Object3D, initialValues?: Record<string, number>): {
    setMorphTarget: (name: string, value: number) => void;
    getMorphTargetNames: () => string[];
    getMorphTargetValues: () => {
        [x: string]: number;
    };
};

export { }
