Skip to content

Interface: Storage ​

Defined in: types/desktop-engine.d.ts:4630

Keys and values (strings), like in browsers; the items are also properties (storage.name = 'x', Object.keys(storage)). Up to 5 MB each (keys and values together, counted in UTF-16 code units): over that, setItem throws a QuotaExceededError DOMException.

Indexable ​

ts
[name: string]: any

Properties ​

length ​

ts
readonly length: number;

Defined in: types/desktop-engine.d.ts:4632

The number of items

Methods ​

clear() ​

ts
clear(): void;

Defined in: types/desktop-engine.d.ts:4634

Removes every item

Returns ​

void


getItem() ​

ts
getItem(key): string | null;

Defined in: types/desktop-engine.d.ts:4636

The value, null when there's no such key

Parameters ​

ParameterType
keystring

Returns ​

string | null


key() ​

ts
key(index): string | null;

Defined in: types/desktop-engine.d.ts:4638

The key at the index, in the order they were added; null past the end

Parameters ​

ParameterType
indexnumber

Returns ​

string | null


removeItem() ​

ts
removeItem(key): void;

Defined in: types/desktop-engine.d.ts:4639

Parameters ​

ParameterType
keystring

Returns ​

void


setItem() ​

ts
setItem(key, value): void;

Defined in: types/desktop-engine.d.ts:4641

Stores the value as a string

Parameters ​

ParameterType
keystring
valuestring

Returns ​

void

The SDK is released under the Apache License 2.0