import { AcDbEntity, AcDbObjectId } from '@mlightcad/data-model'; import { Ref } from 'vue'; export interface UseHoverResult { hovered: Ref; entity: Ref; id: Ref; mouse: Ref<{ x: number; y: number; }>; } /** * Composable: useHover * * Tracks which CAD entity is currently hovered in the active view. * * This composable automatically listens to `hover` and `unhover` events * from the `AcApDocManager.instance.curView.events` system in the CAD viewer. * It exposes reactive state containing: * * - The currently hovered entity (`entity`) * - The hovered entity’s object ID (`id`) * - The mouse position when hovering (`mouse`) * - A boolean indicating if an entity is hovered (`hovered`) * * When the component using this composable unmounts, * all event listeners are automatically cleaned up. * * --- * @example * ```ts * import { useHover } from '@/composables/useHover' * import { computed } from 'vue' * import { colorName, entityName } from '@/locale' * * export default { * setup() { * const { hovered, entity, mouse } = useHover() * * // Example: compute entity info for display * const info = computed(() => { * if (!entity.value) return null * return { * type: entityName(entity.value), * color: colorName(entity.value.color.toString()), * layer: entity.value.layer, * lineType: entity.value.lineType * } * }) * * // Example: compute tooltip position * const tooltipStyle = computed(() => ({ * left: `${mouse.value.x + 10}px`, * top: `${mouse.value.y + 10}px` * })) * * return { hovered, info, tooltipStyle } * } * } * ``` * * --- * @returns {{ * hovered: import('vue').Ref; * entity: import('vue').Ref; * id: import('vue').Ref; * mouse: import('vue').Ref<{ x: number; y: number }>; * }} * Reactive state tracking the current hover context. */ export declare function useHover(): UseHoverResult; //# sourceMappingURL=useHover.d.ts.map