# Class HistoryController

This component is instantiated automatically by the framework on the root if the SearchInterface.
When the SearchInterface.options.enableHistory option is set to true, this component is instantiated.
It's only job is to apply changes in the QueryStateModel to the hash in the URL, and vice versa.
This component does not hold the state of the interface, it only represent it in the URL.

## Index

### Methods

- debugInfo
- disable
- enable
- setHashValues

### Properties

- disabled
- logger
- ID

### Constructors

- constructor

## Methods

### debugInfo

- debugInfo(): any

- Inherited from BaseComponent.debugInfo

  - Defined in ui/Base/BaseComponent.ts :41

  Return the debug info about this component.

  #### Returns any

### disable

- disable(): void

- Inherited from BaseComponent.disable

  - Defined in ui/Base/BaseComponent.ts :52

  Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

  #### Returns void

### enable

- enable(): void

- Inherited from BaseComponent.enable

  - Defined in ui/Base/BaseComponent.ts :61

  Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

  #### Returns void

### setHashValues

- setHashValues(values: Record<string, any>): void

- - Defined in controllers/HistoryController.ts :102

  Set the given map of key value in the hash of the URL

  #### Parameters

  - ##### values: Record<string, any>

  #### Returns void

## Properties

### disabled

disabled: boolean

Inherited from BaseComponent.disabled

- Defined in ui/Base/BaseComponent.ts :23

A disabled component will not participate in the query, or listen to ComponentEvents.

type

  {boolean}

### logger

logger: Logger

Inherited from BaseComponent.logger

- Defined in ui/Base/BaseComponent.ts :18

Allows component to log in the dev console.

### Static ID

ID: string

Inherited from BaseComponent.ID

- Defined in ui/Base/BaseComponent.ts :28

The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton

## Constructors

### constructor

- new HistoryController(element: HTMLElement, window: Window, queryStateModel: QueryStateModel, queryController: QueryController, usageAnalytics?: IAnalyticsClient): HistoryController

- - Defined in controllers/HistoryController.ts :34

  Create a new HistoryController

  #### Parameters

  - ##### element: HTMLElement

  - ##### window: Window

  - ##### queryStateModel: QueryStateModel

  - ##### queryController: QueryController

  - ##### Optional usageAnalytics: IAnalyticsClient

    Deprecated. Since the October 2019 Release (v2.7219), the class retrieves and uses the {@link AnalyticsClient} from the `queryController` constructor parameter.

  #### Returns HistoryController

### Hierarchy

- RootComponent

### Implements

- IHistoryManager