# StateApi

Canonical page: https://www.adaptabletools.com/docs/reference/stateapi

Adaptable State: the initial state, the full state, the persisted user state, and each module&#39;s section.

```ts title="TypeScript"
export interface StateApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [applyInitialState(newInitialState)](https://www.adaptabletools.com/docs/reference/stateapi.md#applyinitialstate) | `Promise<void>` | Merges Initial State into the **current** user state (Revision / Override / KeepUserDefined),<br/>without clearing persistence. Same merge as startup, applied at runtime.<br/><br/>When `newInitialState` is provided it also updates `AdaptableOptions.initialState`.<br/>Omitting it re-applies the current Initial State onto current user state. |
| [copyAllStateToClipboard()](https://www.adaptabletools.com/docs/reference/stateapi.md#copyallstatetoclipboard) | `void` | Copies all Adaptable state to clipboard |
| [copyUserStateToClipboard()](https://www.adaptabletools.com/docs/reference/stateapi.md#copyuserstatetoclipboard) | `void` | Copies User State sections of Adaptable State to clipboard |
| [dispatchStateReadyAction(module)](https://www.adaptabletools.com/docs/reference/stateapi.md#dispatchstatereadyaction) | `void` | Sent by each Module when it is Ready |
| [getAdaptableFilterState()](https://www.adaptabletools.com/docs/reference/stateapi.md#getadaptablefilterstate) | [`AdaptableFilterState`](https://www.adaptabletools.com/docs/reference/adaptablefilterstate.md) | Gets filter-related sections of Adaptable State |
| [getAdaptableSortState()](https://www.adaptabletools.com/docs/reference/stateapi.md#getadaptablesortstate) | [`AdaptableSortState`](https://www.adaptabletools.com/docs/reference/adaptablesortstate.md) | Gets sort-related sections of Adaptable State |
| [getAlertState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getalertstate) | [`AlertState`](https://www.adaptabletools.com/docs/reference/alertstate.md) | Returns Alert section of Adaptable State |
| [getAllState()](https://www.adaptabletools.com/docs/reference/stateapi.md#getallstate) | [`AdaptableState`](https://www.adaptabletools.com/docs/reference/adaptablestate.md) | Retrieves ALL state which is currently stored by Adaptable (both persistent and transient/internal) |
| [getApplicationState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getapplicationstate) | [`ApplicationState`](https://www.adaptabletools.com/docs/reference/applicationstate.md) | Returns Application section of Adaptable State |
| [getCalculatedColumnState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getcalculatedcolumnstate) | [`CalculatedColumnState`](https://www.adaptabletools.com/docs/reference/calculatedcolumnstate.md) | Returns Calculated Column section of Adaptable State |
| [getChartingState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getchartingstate) | [`ChartingState`](https://www.adaptabletools.com/docs/reference/chartingstate.md) | Returns Charting section of Adaptable State |
| [getCustomSortState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getcustomsortstate) | [`CustomSortState`](https://www.adaptabletools.com/docs/reference/customsortstate.md) | Returns Custom Sort section of Adaptable State |
| [getDashboardState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getdashboardstate) | [`DashboardState`](https://www.adaptabletools.com/docs/reference/dashboardstate.md) | Returns Dashboard section of Adaptable State |
| [getDescriptionForModule(adaptableModule)](https://www.adaptabletools.com/docs/reference/stateapi.md#getdescriptionformodule) | `string` | Retrieves a brief description of an AdapTable Module |
| [getExportState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getexportstate) | [`ExportState`](https://www.adaptabletools.com/docs/reference/exportstate.md) | Returns Export section of Adaptable State |
| [getFlashingCellState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getflashingcellstate) | [`FlashingCellState`](https://www.adaptabletools.com/docs/reference/flashingcellstate.md) | Returns Flashing Cell section of Adaptable State |
| [getFormatColumnState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getformatcolumnstate) | [`FormatColumnState`](https://www.adaptabletools.com/docs/reference/formatcolumnstate.md) | Returns Format Column section of Adaptable State |
| [getFreeTextColumnState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getfreetextcolumnstate) | [`FreeTextColumnState`](https://www.adaptabletools.com/docs/reference/freetextcolumnstate.md) | Returns FreeText Column section of Adaptable State |
| [getHelpPageForModule(adaptableModule)](https://www.adaptabletools.com/docs/reference/stateapi.md#gethelppageformodule) | `string` | Retrieves the help page for an AdapTable Module |
| [getInitialState()](https://www.adaptabletools.com/docs/reference/stateapi.md#getinitialstate) | [`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md)` \| any` | Returns the Initial Adaptable State |
| [getLayoutState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getlayoutstate) | [`LayoutState`](https://www.adaptabletools.com/docs/reference/layoutstate.md) | Returns Layout section of Adaptable State |
| [getNamedQueryState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getnamedquerystate) | [`NamedQueryState`](https://www.adaptabletools.com/docs/reference/namedquerystate.md) | Returns Query section of Adaptable State |
| [getNoteState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getnotestate) | [`NoteState`](https://www.adaptabletools.com/docs/reference/notestate.md) | Returns Note section of Adaptable State |
| [getPersistentState()](https://www.adaptabletools.com/docs/reference/stateapi.md#getpersistentstate) | [`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md) | Retrieves the persistent state in Adaptable, i.e. state that is passed to the `StateOptions.persistState()` function. |
| [getPlusMinusState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getplusminusstate) | [`PlusMinusState`](https://www.adaptabletools.com/docs/reference/plusminusstate.md) | Returns Plus Minus section of Adaptable State |
| [getQuickSearchState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getquicksearchstate) | [`QuickSearchState`](https://www.adaptabletools.com/docs/reference/quicksearchstate.md) | Returns Quick Search section of Adaptable State |
| [getShortcutState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getshortcutstate) | [`ShortcutState`](https://www.adaptabletools.com/docs/reference/shortcutstate.md) | Returns Shortcut section of Adaptable State |
| [getStatusBarState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getstatusbarstate) | [`StatusBarState`](https://www.adaptabletools.com/docs/reference/statusbarstate.md) | Returns StatusBar section of Adaptable State |
| [getStyledColumnState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getstyledcolumnstate) | [`StyledColumnState`](https://www.adaptabletools.com/docs/reference/styledcolumnstate.md) | Returns StyledColumn section of Adaptable State |
| [getThemeState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getthemestate) | [`ThemeState`](https://www.adaptabletools.com/docs/reference/themestate.md) | Returns Theme section of Adaptable State |
| [getToolPanelState(returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#gettoolpanelstate) | [`ToolPanelState`](https://www.adaptabletools.com/docs/reference/toolpanelstate.md) | Returns Tool Panel section of Adaptable State |
| [getUserStateByStateKey(stateKey, returnJson)](https://www.adaptabletools.com/docs/reference/stateapi.md#getuserstatebystatekey) | [`BaseState`](https://www.adaptabletools.com/docs/reference/basestate.md)` \| string` | Returns given section of Adaptable State (as JSON or object) |
| [incrementUserStateRevision(stateKey)](https://www.adaptabletools.com/docs/reference/stateapi.md#incrementuserstaterevision) | `void` | Adds &#39;1&#39; to current revision number of State element |
| [loadUserState(state)](https://www.adaptabletools.com/docs/reference/stateapi.md#loaduserstate) | `Promise<void>` | Loads supplied user state, replacing (NOT merging) existing User(persisted) State. |
| [persistAdaptableState()](https://www.adaptabletools.com/docs/reference/stateapi.md#persistadaptablestate) | `Promise<`[`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md)`>` | Persists the current Adaptable State to storage.<br/><br/>This method first calls StateOption.saveState() to prepare the state<br/>and then StateOptions.persistState() to save it to the configured storage. |
| [reloadInitialState(newInitialState)](https://www.adaptabletools.com/docs/reference/stateapi.md#reloadinitialstate) | `Promise<void>` | Reloads existing (or supplied) Initial State; clears persistent state by calling `StateOptions.clearState` |
| [remergePersistedState()](https://www.adaptabletools.com/docs/reference/stateapi.md#remergepersistedstate) | `Promise<void>` | Re-runs the startup merge using **persisted** user state from `StateOptions.loadState`<br/>and the current `AdaptableOptions.initialState`. Does not clear persistence.<br/><br/>Use when remote/local storage may have changed (or Initial State in options was updated)<br/>and you want to re-sync without a full wipe (`reloadInitialState`).<br/><br/>Unsaved in-memory-only changes are discarded in favour of what `loadState` returns. |
| [setAdaptableStateKey(adaptableStateKey, config)](https://www.adaptabletools.com/docs/reference/stateapi.md#setadaptablestatekey) | `Promise<void>` | Changes key used for persisting AdaptableState into localStorage; optionally provides an initialState to load |

## Method Details

### applyInitialState

Merges Initial State into the **current** user state (Revision / Override / KeepUserDefined),
without clearing persistence. Same merge as startup, applied at runtime.

When `newInitialState` is provided it also updates `AdaptableOptions.initialState`.
Omitting it re-applies the current Initial State onto current user state.

```ts title="TypeScript"
applyInitialState(newInitialState?: InitialState): Promise<void>;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| newInitialState | [`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md) | optional Initial State to merge (defaults to current Initial State) |

###### Returns

`Promise<void>`

### copyAllStateToClipboard

Copies all Adaptable state to clipboard

```ts title="TypeScript"
copyAllStateToClipboard(): void;
```

###### Returns

`void`

### copyUserStateToClipboard

Copies User State sections of Adaptable State to clipboard

```ts title="TypeScript"
copyUserStateToClipboard(): void;
```

###### Returns

`void`

### dispatchStateReadyAction

Sent by each Module when it is Ready

```ts title="TypeScript"
dispatchStateReadyAction(module: AdaptableModule): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| module | [`AdaptableModule`](https://www.adaptabletools.com/docs/reference/adaptablemodule.md) | Module which is Ready |

###### Returns

`void`

### getAdaptableFilterState

Gets filter-related sections of Adaptable State

```ts title="TypeScript"
getAdaptableFilterState(): AdaptableFilterState;
```

###### Returns

 Filter-related sections of Adaptable State

[`AdaptableFilterState`](https://www.adaptabletools.com/docs/reference/adaptablefilterstate.md)

### getAdaptableSortState

Gets sort-related sections of Adaptable State

```ts title="TypeScript"
getAdaptableSortState(): AdaptableSortState;
```

###### Returns

 Sort-related sections of Adaptable State

[`AdaptableSortState`](https://www.adaptabletools.com/docs/reference/adaptablesortstate.md)

### getAlertState

Returns Alert section of Adaptable State

```ts title="TypeScript"
getAlertState(returnJson?: boolean): AlertState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Alert section of Adaptable State

[`AlertState`](https://www.adaptabletools.com/docs/reference/alertstate.md)

### getAllState

Retrieves ALL state which is currently stored by Adaptable (both persistent and transient/internal)

```ts title="TypeScript"
getAllState(): AdaptableState;
```

###### Returns

 ALL state which is currently stored by Adaptable (both persistent and transient/internal)

[`AdaptableState`](https://www.adaptabletools.com/docs/reference/adaptablestate.md)

### getApplicationState

Returns Application section of Adaptable State

```ts title="TypeScript"
getApplicationState(returnJson?: boolean): ApplicationState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Application section of Adaptable State

[`ApplicationState`](https://www.adaptabletools.com/docs/reference/applicationstate.md)

### getCalculatedColumnState

Returns Calculated Column section of Adaptable State

```ts title="TypeScript"
getCalculatedColumnState(returnJson?: boolean): CalculatedColumnState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Calculated Column section of Adaptable State

[`CalculatedColumnState`](https://www.adaptabletools.com/docs/reference/calculatedcolumnstate.md)

### getChartingState

Returns Charting section of Adaptable State

```ts title="TypeScript"
getChartingState(returnJson?: boolean): ChartingState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Charting section of Adaptable State

[`ChartingState`](https://www.adaptabletools.com/docs/reference/chartingstate.md)

### getCustomSortState

Returns Custom Sort section of Adaptable State

```ts title="TypeScript"
getCustomSortState(returnJson?: boolean): CustomSortState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Custom Sort section of Adaptable State

[`CustomSortState`](https://www.adaptabletools.com/docs/reference/customsortstate.md)

### getDashboardState

Returns Dashboard section of Adaptable State

```ts title="TypeScript"
getDashboardState(returnJson?: boolean): DashboardState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Dashboard section of Adaptable State

[`DashboardState`](https://www.adaptabletools.com/docs/reference/dashboardstate.md)

### getDescriptionForModule

Retrieves a brief description of an AdapTable Module

```ts title="TypeScript"
getDescriptionForModule(adaptableModule: AdaptableModule): string;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| adaptableModule | [`AdaptableModule`](https://www.adaptabletools.com/docs/reference/adaptablemodule.md) | Adaptable Module to get description for |

###### Returns

 A brief description of an AdapTable Module

`string`

### getExportState

Returns Export section of Adaptable State

```ts title="TypeScript"
getExportState(returnJson?: boolean): ExportState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Export section of Adaptable State

[`ExportState`](https://www.adaptabletools.com/docs/reference/exportstate.md)

### getFlashingCellState

Returns Flashing Cell section of Adaptable State

```ts title="TypeScript"
getFlashingCellState(returnJson?: boolean): FlashingCellState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Flashing Cell section of Adaptable State

[`FlashingCellState`](https://www.adaptabletools.com/docs/reference/flashingcellstate.md)

### getFormatColumnState

Returns Format Column section of Adaptable State

```ts title="TypeScript"
getFormatColumnState(returnJson?: boolean): FormatColumnState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Format Column section of Adaptable State

[`FormatColumnState`](https://www.adaptabletools.com/docs/reference/formatcolumnstate.md)

### getFreeTextColumnState

Returns FreeText Column section of Adaptable State

```ts title="TypeScript"
getFreeTextColumnState(returnJson?: boolean): FreeTextColumnState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 FreeText Column section of Adaptable State

[`FreeTextColumnState`](https://www.adaptabletools.com/docs/reference/freetextcolumnstate.md)

### getHelpPageForModule

Retrieves the help page for an AdapTable Module

```ts title="TypeScript"
getHelpPageForModule(adaptableModule: AdaptableModule): string;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| adaptableModule | [`AdaptableModule`](https://www.adaptabletools.com/docs/reference/adaptablemodule.md) | Adaptable Module to get help page for |

###### Returns

 The help page for an AdapTable Module

`string`

### getInitialState

Returns the Initial Adaptable State

```ts title="TypeScript"
getInitialState(): InitialState | any;
```

###### Returns

 The Initial Adaptable State

[`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md)` | any`

### getLayoutState

Returns Layout section of Adaptable State

```ts title="TypeScript"
getLayoutState(returnJson?: boolean): LayoutState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Layout section of Adaptable State

[`LayoutState`](https://www.adaptabletools.com/docs/reference/layoutstate.md)

### getNamedQueryState

Returns Query section of Adaptable State

```ts title="TypeScript"
getNamedQueryState(returnJson?: boolean): NamedQueryState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Query section of Adaptable State

[`NamedQueryState`](https://www.adaptabletools.com/docs/reference/namedquerystate.md)

### getNoteState

Returns Note section of Adaptable State

```ts title="TypeScript"
getNoteState(returnJson?: boolean): NoteState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Note section of Adaptable State

[`NoteState`](https://www.adaptabletools.com/docs/reference/notestate.md)

### getPersistentState

Retrieves the persistent state in Adaptable, i.e. state that is passed to the `StateOptions.persistState()` function.

```ts title="TypeScript"
getPersistentState(): AdaptablePersistentState;
```

###### Returns

 The persistent state in Adaptable, i.e. state that is passed to the `StateOptions.persistState()` function

[`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md)

### getPlusMinusState

Returns Plus Minus section of Adaptable State

```ts title="TypeScript"
getPlusMinusState(returnJson?: boolean): PlusMinusState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Plus Minus section of Adaptable State

[`PlusMinusState`](https://www.adaptabletools.com/docs/reference/plusminusstate.md)

### getQuickSearchState

Returns Quick Search section of Adaptable State

```ts title="TypeScript"
getQuickSearchState(returnJson?: boolean): QuickSearchState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Quick Search section of Adaptable State

[`QuickSearchState`](https://www.adaptabletools.com/docs/reference/quicksearchstate.md)

### getShortcutState

Returns Shortcut section of Adaptable State

```ts title="TypeScript"
getShortcutState(returnJson?: boolean): ShortcutState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Shortcut section of Adaptable State

[`ShortcutState`](https://www.adaptabletools.com/docs/reference/shortcutstate.md)

### getStatusBarState

Returns StatusBar section of Adaptable State

```ts title="TypeScript"
getStatusBarState(returnJson?: boolean): StatusBarState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 StatusBar section of Adaptable State

[`StatusBarState`](https://www.adaptabletools.com/docs/reference/statusbarstate.md)

### getStyledColumnState

Returns StyledColumn section of Adaptable State

```ts title="TypeScript"
getStyledColumnState(returnJson?: boolean): StyledColumnState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 StyledColumn section of Adaptable State

[`StyledColumnState`](https://www.adaptabletools.com/docs/reference/styledcolumnstate.md)

### getThemeState

Returns Theme section of Adaptable State

```ts title="TypeScript"
getThemeState(returnJson?: boolean): ThemeState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Theme section of Adaptable State

[`ThemeState`](https://www.adaptabletools.com/docs/reference/themestate.md)

### getToolPanelState

Returns Tool Panel section of Adaptable State

```ts title="TypeScript"
getToolPanelState(returnJson?: boolean): ToolPanelState;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| returnJson | `boolean` | return as JSON rather than object |

###### Returns

 Tool Panel section of Adaptable State

[`ToolPanelState`](https://www.adaptabletools.com/docs/reference/toolpanelstate.md)

### getUserStateByStateKey

Returns given section of Adaptable State (as JSON or object)

```ts title="TypeScript"
getUserStateByStateKey(stateKey: AdaptableStateKey, returnJson?: boolean): BaseState | string;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| stateKey | `AdaptableStateKey` | section of State to return |
| returnJson | `boolean` | whether to return section as JSON or object |

###### Returns

 Given section of Adaptable State (as JSON or object)

[`BaseState`](https://www.adaptabletools.com/docs/reference/basestate.md)` | string`

### incrementUserStateRevision

Adds &#39;1&#39; to current revision number of State element

```ts title="TypeScript"
incrementUserStateRevision(stateKey: AdaptableStateKey): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| stateKey | `AdaptableStateKey` | Adaptable State Key to update |

###### Returns

`void`

### loadUserState

Loads supplied user state, replacing (NOT merging) existing User(persisted) State.

```ts title="TypeScript"
loadUserState(state: InitialState): Promise<void>;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| state | [`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md) | User state to load. Replaces the persisted state. It is not merged with it |

###### Returns

`Promise<void>`

### persistAdaptableState

Persists the current Adaptable State to storage.

This method first calls StateOption.saveState() to prepare the state
and then StateOptions.persistState() to save it to the configured storage.

```ts title="TypeScript"
persistAdaptableState(): Promise<AdaptablePersistentState>;
```

###### Returns

 A promise that resolves to the persisted state

`Promise<`[`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md)`>`

### reloadInitialState

Reloads existing (or supplied) Initial State; clears persistent state by calling `StateOptions.clearState`

```ts title="TypeScript"
reloadInitialState(newInitialState?: InitialState): Promise<void>;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| newInitialState | [`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md) | optional new InitialState to load |

###### Returns

`Promise<void>`

### remergePersistedState

Re-runs the startup merge using **persisted** user state from `StateOptions.loadState`
and the current `AdaptableOptions.initialState`. Does not clear persistence.

Use when remote/local storage may have changed (or Initial State in options was updated)
and you want to re-sync without a full wipe (`reloadInitialState`).

Unsaved in-memory-only changes are discarded in favour of what `loadState` returns.

```ts title="TypeScript"
remergePersistedState(): Promise<void>;
```

###### Returns

`Promise<void>`

### setAdaptableStateKey

Changes key used for persisting AdaptableState into localStorage; optionally provides an initialState to load

```ts title="TypeScript"
setAdaptableStateKey(adaptableStateKey: string, config?: {
        initialState?: InitialState;
        flushCurrentState?: boolean;
        progressIndicatorLabel?: string;
    }): Promise<void>;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| adaptableStateKey | `string` | key for persisting the AdaptableState into localStorage |
| config | `\{ initialState?: `[`InitialState`](https://www.adaptabletools.com/docs/reference/initialstate.md)`; flushCurrentState?: boolean; progressIndicatorLabel?: string; \}` |   |

###### Returns

`Promise<void>`
