import { Observable } from '@legendapp/state'; import { MaybeEventTarget } from '../../types.mjs'; import '@usels/core'; interface UseFocusWithinReturn { /** Whether focus is within the container or any descendants (read-only) */ focused$: Observable; } /** * Framework-agnostic tracker for whether focus is within a target element or * any of its descendants. * * Uses `focusin`/`focusout` events with `el.matches(':focus-within')` to * reliably detect focus state. This approach delegates the check to the * browser's CSS engine, correctly handling edge cases like iframes and * Shadow DOM boundaries where `relatedTarget` would be `null`. */ declare function createFocusWithin(target: MaybeEventTarget): UseFocusWithinReturn; export { type UseFocusWithinReturn, createFocusWithin };