# Interface SpatialNavigationManager

interface SpatialNavigationManager {
add(component): void;
clear(): void;
focus(component): void;
getCandidates(): UiComponent[];
getCurrent(): null | UiComponent;
move(direction): void;
pause(): void;
refocus(): void;
remove(component): void;
resume(): void;
start(): void;
stop(): void;
}

#####
Index

### Methods

add
clear
focus
getCandidates
getCurrent
move
pause
refocus
remove
resume
start
stop

## Methods

### add

- add(component): void

- Adds a new component to the focusable components list if it meets the focusability criteria.

  #### Parameters

  - component: UiComponent

  #### Returns void

### clear

- clear(): void

- Clears the list of focusable components.

  #### Returns void

### focus

- focus(component): void

- Sets focus on a specific component if it is focusable, or finds a focusable child within it to focus on.

  #### Parameters

  - component: UiComponent

  #### Returns void

### getCandidates

- getCandidates(): UiComponent[]

- Retrieves the list of focusable components within the player.

  #### Returns UiComponent[]

### getCurrent

- getCurrent(): null | UiComponent

- Retrieves the currently focused component.

  #### Returns null | UiComponent

### move

- move(direction): void

- Navigates to the next focusable component based on the specified direction.

  #### Parameters

  - direction: Direction

  #### Returns void

### pause

- pause(): void

- Temporarily disables the Spatial Navigation functionality without removing the event listeners.

  #### Returns void

### refocus

- refocus(): void

- Focuses on the last focused component.

  #### Returns void

### remove

- remove(component): void

- Removes a specified component from the focusable components list.

  #### Parameters

  - component: UiComponent

  #### Returns void

### resume

- resume(): void

- Re-enables the Spatial Navigation functionality after it has been paused.

  #### Returns void

### start

- start(): void

- Starts the Spatial Navigation system by adding keydown event listeners to the player.

  #### Returns void

### stop

- stop(): void

- Stops the Spatial Navigation by removing the keydown event listener from the player and updating the internal state.

  #### Returns void