Class SharedStorage
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
Experimental The
SharedStorage interface of the {{domxref("Shared Storage API", "Shared Storage API", "", "nocode")}} represents the shared storage for a particular origin, defining methods to write data to the shared storage.
[Value("SharedStorage")]
public class SharedStorage
- Inheritance
-
SharedStorage
- Inherited Members
-
Constructors
SharedStorage()
Properties
this[int]
public string this[int i] { get; set; }
Parameters
i int
Property Value
- string
Worklet
[Value("worklet")]
public SharedStorageWorklet Worklet { get; }
Property Value
- SharedStorageWorklet
Methods
Append(string, string, SharedStorageModifierMethodOptions)
NOTE
Experimental The
append() method of the
SharedStorage interface appends a string to the value of an existing key-value pair in the current origin's shared storage.
[Value("append")]
public Task<dynamic> Append(string key, string value, SharedStorageModifierMethodOptions options = null)
Parameters
key string
value string
options SharedStorageModifierMethodOptions
Returns
- Task<dynamic>
A Promise that fulfills with undefined.
BatchUpdate(List<SharedStorageModifierMethod>, SharedStorageModifierMethodOptions)
[Value("batchUpdate")]
public Task<dynamic> BatchUpdate(List<SharedStorageModifierMethod> methods, SharedStorageModifierMethodOptions options = null)
Parameters
methods List<SharedStorageModifierMethod>
options SharedStorageModifierMethodOptions
Returns
- Task<dynamic>
Clear(SharedStorageModifierMethodOptions)
NOTE
Experimental The
clear() method of the
SharedStorage interface clears the current origin's shared storage, removing all data from it.
[Value("clear")]
public Task<dynamic> Clear(SharedStorageModifierMethodOptions options = null)
Parameters
options SharedStorageModifierMethodOptions
Returns
- Task<dynamic>
A Promise that fulfills with undefined.
CreateWorklet(string, SharedStorageWorkletOptions)
[Value("createWorklet")]
public Task<SharedStorageWorklet> CreateWorklet(string moduleURL, SharedStorageWorkletOptions options = null)
Parameters
moduleURL string
options SharedStorageWorkletOptions
Returns
- Task<SharedStorageWorklet>
Delete(string, SharedStorageModifierMethodOptions)
NOTE
Experimental The
delete() method of the
SharedStorage interface deletes an existing key-value pair from the current origin's shared storage.
[Value("delete")]
public Task<dynamic> Delete(string key, SharedStorageModifierMethodOptions options = null)
Parameters
key string
options SharedStorageModifierMethodOptions
Returns
- Task<dynamic>
A Promise that fulfills with undefined.
Get(string)
[Value("get")]
public Task<string> Get(string key)
Parameters
key string
Returns
- Task<string>
Length()
[Value("length")]
public Task<ulong> Length()
Returns
- Task<ulong>
RemainingBudget()
[Value("remainingBudget")]
public Task<Number> RemainingBudget()
Returns
- Task<Number>
Run(string, SharedStorageRunOperationMethodOptions)
[Value("run")]
public Task<dynamic> Run(string name, SharedStorageRunOperationMethodOptions options = null)
Parameters
name string
options SharedStorageRunOperationMethodOptions
Returns
- Task<dynamic>
[Value("selectURL")]
public Task<Union142> SelectURL(string name, List<SharedStorageUrlWithMetadata> urls, SharedStorageRunOperationMethodOptions options = null)
Parameters
name string
urls List<SharedStorageUrlWithMetadata>
options SharedStorageRunOperationMethodOptions
Returns
- Task<Union142>
Set(string, string, SharedStorageSetMethodOptions)
NOTE
Experimental The
set() method of the
SharedStorage interface either stores a new key-value pair in the current origin's shared storage or updates an existing one.
[Value("set")]
public Task<dynamic> Set(string key, string value, SharedStorageSetMethodOptions options = null)
Parameters
key string
value string
options SharedStorageSetMethodOptions
Returns
- Task<dynamic>
A Promise that fulfills with undefined.