<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>



```kotlin
public interface GlanceStateDefinition<T>
```


Configuration definition for `GlanceState`. This defines where the data is stored and how the
underlying data store is created. Use a unique `GlanceStateDefinition` to get a `GlanceState`,
once defined, the data should be updated using the state directly, this definition should not
change.


## Functions



<h2 id="getlocation-context-filekey">getLocation</h2>

```kotlin
public fun getLocation(context: Context, fileKey: String): File
```


This file indicates the location of the persisted data.

#### Parameters

| | |
| --- | --- |
| context | The context used to create the file directory |
| fileKey | The unique string key used to name and identify the data file corresponding to a remote UI. Each remote UI has a unique UI key, used to key the data for that UI. |





<hr class="docs-overload-divider">


<h2 id="getdatastore-context-filekey">getDataStore</h2>

```kotlin
public suspend fun getDataStore(context: Context, fileKey: String): DataStore<T>
```


Creates the underlying data store.

#### Parameters

| | |
| --- | --- |
| context | The context used to create locate the file directory |
| fileKey | The unique string key used to name and identify the data file corresponding to a remote UI. Each remote UI has a unique UI key, used to key the data for that UI. |