type Direction = 'top' | 'right' | 'bottom' | 'left'; type Callback = (this: HTMLElement, direction: Direction, e: MouseEvent) => void; /** * 监听鼠标在元素上移入和移出的方向 * @param {HTMLElement} element 监听元素 * @param {Callback} onEnter 鼠标进入回调 * @param {Callback} onLeave 鼠标离开回调 * * 这个函数提供了以下功能: * 可以检测鼠标从元素的四个边缘(上、右、下、左)进入和离开的情况 * 支持自定义回调函数处理进入和离开事件 * 返回清理函数以便移除事件监听器 */ declare function detectMouseDirection(element: HTMLElement, onEnter: Callback, onLeave: Callback): () => void; export { detectMouseDirection as default };