forked from Blazored/SessionStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIStorageProvider.cs
More file actions
26 lines (24 loc) · 1.19 KB
/
Copy pathIStorageProvider.cs
File metadata and controls
26 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Blazored.SessionStorage;
internal interface IStorageProvider
{
void Clear();
ValueTask ClearAsync(CancellationToken cancellationToken = default);
bool ContainKey(string key);
ValueTask<bool> ContainKeyAsync(string key, CancellationToken cancellationToken = default);
string GetItem(string key);
ValueTask<string> GetItemAsync(string key, CancellationToken cancellationToken = default);
string Key(int index);
ValueTask<string> KeyAsync(int index, CancellationToken cancellationToken = default);
IEnumerable<string> Keys();
ValueTask<IEnumerable<string>> KeysAsync(CancellationToken cancellationToken = default);
int Length();
ValueTask<int> LengthAsync(CancellationToken cancellationToken = default);
void RemoveItem(string key);
ValueTask RemoveItemAsync(string key, CancellationToken cancellationToken = default);
ValueTask RemoveItemsAsync(IEnumerable<string> keys, CancellationToken cancellationToken = default);
void SetItem(string key, string data);
ValueTask SetItemAsync(string key, string data, CancellationToken cancellationToken = default);
}