@clayui/shared
Version:
ClayShared component
22 lines (21 loc) • 879 B
TypeScript
/**
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
export declare type Interaction = 'keyboard' | 'pointer' | 'virtual';
declare function isFocusVisible(): boolean;
declare function getInteraction(): Interaction;
/**
* Detects what type of interaction the user is doing with the page, using the
* keyboard, pointer or using screen reader. This works like a singleton even
* if it is declared more than once.
*
* This is inspired by the implementation:
* https://github.com/adobe/react-spectrum/blob/d10f20a3f4ca7ffa807fcaceb944274da825a7b9/packages/%40react-aria/interactions/src/useFocusVisible.ts
*/
export declare function useInteractionFocus(): {
getInteraction: typeof getInteraction;
isFocusVisible: typeof isFocusVisible;
};
export declare function useFocusVisible(): boolean;
export {};