using System;
using System.Collections.Generic;
namespace Blazored.SessionStorage;
public interface ISyncSessionStorageService
{
///
/// Clears all data from session storage.
///
void Clear();
///
/// Retrieve the specified data from session storage as a .
///
/// A value specifying the name of the session storage slot to use
/// The data from the specified as a
T GetItem(string key);
///
/// Retrieve the specified data from session storage as a .
///
/// A value specifying the name of the storage slot to use
/// The data associated with the specified as a
string GetItemAsString(string key);
///
/// Return the name of the key at the specified .
///
///
/// The name of the key at the specified
string Key(int index);
///
/// Get the keys of all items stored in session storage.
///
/// The keys of all items stored in session storage
IEnumerable Keys();
///
/// Checks if the exists in session storage, but does not check its value.
///
/// A value specifying the name of the storage slot to use
/// Boolean indicating if the specified exists
bool ContainKey(string key);
///
/// The number of items stored in session storage.
///
/// The number of items stored in session storage
int Length();
///
/// Remove the data with the specified .
///
/// A value specifying the name of the storage slot to use
void RemoveItem(string key);
///
/// Removes a collection of .
///
/// A IEnumerable collection of strings specifying the name of the storage slot to remove
void RemoveItems(IEnumerable keys);
///
/// Sets or updates the in session storage with the specified .
///
/// A value specifying the name of the storage slot to use
/// The data to be saved
void SetItem(string key, T data);
///
/// Sets or updates the in session storage with the specified . Does not serialize the value before storing.
///
/// A value specifying the name of the storage slot to use
/// The string to be saved
///
void SetItemAsString(string key, string data);
event EventHandler Changing;
event EventHandler Changed;
}