/** * Custom hook to generate a sanitized react useId for use in DOM selectors. * * React's `useId()` may return IDs containing colons (e.g., `:r1:`), which are valid in HTML * but **not valid CSS identifiers**. This can cause issues when using `querySelector` or when * libraries like `nwsapi` attempt to parse selectors, especially in test environments like jest * with jsdom. * * This hook replaces colons with a safe, reversible encoding (`«` and `»`) to ensure the ID * remains unique and usable in CSS selectors. The characters are chosen to be the same as in the * react 19.2+ implementation. * * Background: * - React previously used colons in generated IDs to avoid collisions. * - This caused parsing errors in selector engines like `nwsapi` when used in test environments. * - React addressed this in [facebook/react#32001](https://github.com/facebook/react/pull/32001) in React 19.2+. * * This hook provides a workaround for environments still using older React versions or needing * compatibility with selector engines that strictly enforce CSS syntax. * * @returns A sanitized ID string safe for use in `querySelector` and CSS selectors. * @public */ export declare function useId(): string;