import { Object3D } from "three";
import { Behaviour } from "./Component.js";
import { EventList } from "./EventList.js";
/**
 * Component that receives and responds to spatial events, like entering or exiting a trigger zone.
 * Used in conjunction with {@link SpatialTrigger} to create interactive spatial events.
 *
 * Place this on objects that should react when entering trigger zones. The receiver checks
 * against all active SpatialTriggers each frame and fires events when intersections change.
 *
 * Events can be connected via {@link EventList} in the editor or listened to in code.
 *
 * @example Listen to trigger events
 * ```ts
 * export class DoorTrigger extends Behaviour {
 *   @serializable(SpatialTriggerReceiver)
 *   receiver?: SpatialTriggerReceiver;
 *
 *   start() {
 *     this.receiver?.onEnter?.addEventListener(() => {
 *       console.log("Player entered door zone");
 *     });
 *   }
 * }
 * ```
 *
 * @summary Receives spatial trigger events
 * @category Interactivity
 * @group Components
 * @see {@link SpatialTrigger} for defining trigger zones
 * @see {@link EventList} for event handling
 * @link https://engine.needle.tools/samples/spatial-triggers/
 */
export declare class SpatialTriggerReceiver extends Behaviour {
    /**
     * Bitmask determining which triggers this receiver responds to
     * Only triggers with matching masks will interact with this receiver
     */
    triggerMask: number;
    /** Event invoked when this object enters a trigger zone */
    onEnter?: EventList<any>;
    /** Event invoked continuously while this object is inside a trigger zone */
    onStay?: EventList<any>;
    /** Event invoked when this object exits a trigger zone */
    onExit?: EventList<any>;
    /**
     * Initializes the receiver and logs debug info if enabled
     * @internal
     */
    start(): void;
    /**
     * Checks for intersections with spatial triggers and fires appropriate events
     * Handles enter, stay, and exit events for all relevant triggers
     * @internal
     */
    update(): void;
    /** Array of triggers currently intersecting with this receiver */
    readonly currentIntersected: SpatialTrigger[];
    /** Array of triggers that intersected with this receiver in the previous frame */
    readonly lastIntersected: SpatialTrigger[];
    /**
     * Handles trigger enter events.
     * @param trigger The spatial trigger that was entered
     */
    onEnterTrigger(trigger: SpatialTrigger): void;
    /**
     * Handles trigger exit events.
     * @param trigger The spatial trigger that was exited
     */
    onExitTrigger(trigger: SpatialTrigger): void;
    /**
     * Handles trigger stay events.
     * @param trigger The spatial trigger that the receiver is staying in
     */
    onStayTrigger(trigger: SpatialTrigger): void;
}
/**
 * A spatial trigger component that detects objects within a box-shaped area.
 * Used to trigger events when objects enter, stay in, or exit the defined area.
 *
 * The trigger area is defined by the GameObject's bounding box (uses {@link BoxHelperComponent}).
 * Objects with {@link SpatialTriggerReceiver} components are tested against this area.
 *
 * **Mask system:** Both trigger and receiver have a `triggerMask` - they only interact
 * when their masks have overlapping bits set. This allows selective triggering.
 *
 * **Debug:** Use `?debugspatialtrigger` URL parameter to visualize trigger zones.
 *
 * @example Create a pickup zone
 * ```ts
 * // On the pickup zone object
 * const trigger = pickupZone.addComponent(SpatialTrigger);
 * trigger.triggerMask = 1; // Layer 1 for pickups
 *
 * // On the player
 * const receiver = player.addComponent(SpatialTriggerReceiver);
 * receiver.triggerMask = 1; // Match the pickup layer
 * ```
 *
 * @summary Define a trigger zone that detects entering objects
 * @category Interactivity
 * @group Components
 * @see {@link SpatialTriggerReceiver} for objects that respond to triggers
 * @see {@link BoxHelperComponent} for the underlying box used to define the trigger area
 * @link https://engine.needle.tools/samples/spatial-triggers/
 */
export declare class SpatialTrigger extends Behaviour {
    /** Global registry of all active spatial triggers in the scene */
    static triggers: SpatialTrigger[];
    /**
     * Bitmask determining which receivers this trigger affects.
     * Only receivers with matching masks will be triggered.
     */
    triggerMask?: number;
    /** Box helper component used to visualize and calculate the trigger area */
    private boxHelper?;
    /**
     * Initializes the trigger and logs debug info if enabled
     */
    start(): void;
    /**
     * Registers this trigger in the global registry and sets up debug visualization if enabled
     */
    onEnable(): void;
    /**
     * Removes this trigger from the global registry when disabled
     */
    onDisable(): void;
    /**
     * Tests if an object is inside this trigger's box
     * @param obj The object to test against this trigger
     * @returns True if the object is inside the trigger box
     */
    test(obj: Object3D): boolean;
    /**
     * Raises the onEnter event on any SpatialTriggerReceiver components attached to this trigger's GameObject
     * @param rec The receiver that entered this trigger
     */
    raiseOnEnterEvent(rec: SpatialTriggerReceiver): void;
    /**
     * Raises the onStay event on any SpatialTriggerReceiver components attached to this trigger's GameObject
     * @param rec The receiver that is staying in this trigger
     */
    raiseOnStayEvent(rec: SpatialTriggerReceiver): void;
    /**
     * Raises the onExit event on any SpatialTriggerReceiver components attached to this trigger's GameObject
     * @param rec The receiver that exited this trigger
     */
    raiseOnExitEvent(rec: SpatialTriggerReceiver): void;
}
