> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage.md).

# IVariableStorage

Interface in [Yarn](https://docs.yarnspinner.dev/2.3/api/csharp/yarn.md)

## Summary

Provides a mechanism for storing and retrieving instances of the `Yarn.Value` class.

```csharp
public interface IVariableStorage
```

## Methods

| Name                                                                                                                                  | Description                                |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [Clear()](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage/yarn.ivariablestorage.clear.md)                      | Removes all variables from storage.        |
| [SetValue(string,bool)](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage/yarn.ivariablestorage.setvalue-3.md)   | Stores a `bool` in this VariableStorage.   |
| [SetValue(string,float)](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage/yarn.ivariablestorage.setvalue-2.md)  | Stores a `float` in this VariableStorage.  |
| [SetValue(string,string)](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage/yarn.ivariablestorage.setvalue-1.md) | Stores a `string` in this VariableStorage. |
| [TryGetValue(string,T)](https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.ivariablestorage/yarn.ivariablestorage.trygetvalue.md)  | Retrieves a value of type `T` by name.     |
