// Type definitions for spotlight type Omit = Pick>; type Merge = Omit> & N; /** * Translates keyCodes into 5-way direction descriptions (e.g. `'down'` ) */ export function getDirection(keyCode: number): string | false; /** * Provides 5-way navigation and focus support * ``` import Spotlight from '@enact/Spotlight'; // get the currently focused component const current = Spotlight.getCurrent(); // focus an element by CSS selector Spotlight.focus('.my-custom-class'); // is `current` focusable? const isFocused = Spotlight.isSpottable(current); ``` */ export declare const Spotlight: { /** * Initializes Spotlight. This is generally handled by . */ initialize(containerDefaults: object): void; /** * Terminates Spotlight. This is generally handled by . */ terminate(): void; /** * Sets the config for spotlight or the specified containerID */ set(containerIdOrConfig: string | object, config?: object): void; /** * Adds the config for a new container. The container ID may be passed in the configuration object. If no container ID is supplied, a new container ID will be generated. */ add(containerIdOrConfig: string | object, config?: object): string; /** * Removes a container from Spotlight */ remove(containerId: string): boolean; /** * Disables the selector rules of the specified container */ disableSelector(containerId: string): boolean; /** * Enables the selector rules of the specified container */ enableSelector(containerId: string): boolean; /** * Pauses Spotlight */ pause(): void; /** * Resumes Spotlight */ resume(): void; /** * Focuses the specified component ID, container ID, element selector, or the default container. * * If Spotlight is in pointer mode, focus is not changed but `elem` will be set as the last focused element of its spotlight containers. */ focus(elem?: string | React.ReactNode, options?: object): boolean; /** * Moves focus to the next spottable control in the direction specified. Optionally, a source element selector may be supplied as the starting point. */ move(direction: string, selector: string | void): boolean; /** * Sets or clears the default container that will receive focus. */ setDefaultContainer(containerId?: string): void; /** * Gets the currently active container. */ getActiveContainer(): string; /** * Sets the currently active container. * * Note: If the current container is restricted to 'self-only' and `containerId` is not contained within the current container then the active container will not be updated. */ setActiveContainer(containerId?: string): void; /** * Get the name of the instance. */ getPausedInstance(): string; /** * Gets the current pointer mode */ getPointerMode(): boolean; /** * Sets the current pointer mode */ setPointerMode(pointerMode: boolean): void; /** * Gets the muted mode value of a spottable element. */ isMuted(elem: object): boolean; /** * Determines whether Spotlight is currently paused. */ isPaused(): boolean; /** * Determines whether an element is spottable. */ isSpottable(elem: object): boolean; /** * Returns the currently spotted control. */ getCurrent(): React.ReactNode; /** * Returns a list of spottable elements wrapped by the supplied container. */ getSpottableDescendants(containerId: string): React.ReactNode[]; }; export default Spotlight;