import { CssLocator, CssLocatorInitializer } from './CssLocator'; import { LocatorComplexity } from './LocatorComplexity'; import type { LocatorRelativePosition } from './LocatorRelativePosition'; /** * The only two {@link LocatorRelativePosition} values `AccessibleRoleLocator` * resolution actually honors — `'Root'` escapes to the document root, * anything else (the `'Descendant'` default) scopes to the preceding chain * (or the interactor's own root when there is none). `'Same'`/`'Child'` have * no accname-search equivalent (`'Same'` means "compound onto the same * element," which conflicts with "search for a new element by name"; `'Child'` * would need result filtering `queryAllByRole`/`getByRole` don't offer) — this * narrower type makes passing them a compile error instead of a silent * fallback to `'Descendant'` behavior. */ export type AccessibleRoleLocatorRelativePosition = Extract; export interface AccessibleRoleLocatorInitializer { name?: string; relative?: AccessibleRoleLocatorRelativePosition; } /** * A locator that resolves by ARIA role plus the COMPUTED accessible name (the * accname algorithm: `aria-labelledby` id-refs, an associated `