import { MouseDevice, MouseInputState } from "../../interfaces/input.d.ts"; /** * Callback type for mouse device connection events */ export type MouseDeviceCallback = (device: MouseDevice) => void; /** * Callback type for mouse input events */ export type MouseInputCallback = (device: MouseDevice, state: MouseInputState) => void; /** * Responsible for tracking mouse state and notifying subscribers of changes. */ export declare class MouseInputPlugin { private _targetElement; private _mouseDevice; private _buttonState; private _axesState; private _position; private _wheelState; private _onDeviceConnected?; private _onInputChanged?; /** * Create a new MouseInputPlugin * * @param targetElement - DOM element to attach mouse listeners to (defaults to document.body) */ constructor(targetElement?: HTMLElement); /** * Register a callback for device connected events * * @param callback */ onDeviceConnected(callback: MouseDeviceCallback): void; /** * Register a callback for input changed events * * @param callback */ onInputChanged(callback: MouseInputCallback): void; /** * Get the current mouse state */ getState(): MouseInputState; /** * Get the mouse device */ getDevice(): MouseDevice; /** * Tears down the mouse resource access and cleans up event listeners */ $teardown(): Promise; /** * Set up pointer and wheel event listeners. We use pointer events instead of mouse events * because BabylonJS calls preventDefault() on pointerdown, which suppresses the * corresponding mousedown/mouseup per the Pointer Events spec. */ private _setupMouseEvents; /** * Handle pointer down events (mouse buttons) */ private _handlePointerDown; /** * Handle pointer up events (mouse buttons) */ private _handlePointerUp; /** * Handle pointer move events (mouse position) */ private _handlePointerMove; /** * Handle mouse wheel events */ private _handleMouseWheel; /** * Notify subscribers of device connected event */ private _notifyDeviceConnected; /** * Notify subscribers of input changed event */ private _notifyInputChanged; }