Home Reference Source Test Repository
public class | source

Storage

chrome.storage Promise interface.

See:

Test:

Static Method Summary

Static Public Methods
public static

Clear all values in local storage.

public static

localGet(keys: string[] | string): Promise<Object<string, any>>

Get multiple values from local storage.

public static

Get single value from local storage.

public static

Remove multiple values from local storage.

public static

localSet(items: Object<string, any>): Promise

Set multiple values into local storage.

public static

localSetValue(key: string, value: any): Promise

Set single value into local storage.

public static

Clear all values in sync storage.

public static

syncGet(keys: string[] | string): Promise<Object<string, any>>

Get multiple values from sync storage.

public static

Get single value from sync storage.

public static

Remove multiple values from sync storage.

public static

syncSet(items: Object<string, any>): Promise

Set multiple values into sync storage.

public static

syncSetValue(key: string, value: any): Promise

Set single value into sync storage.

Static Public Methods

public static localClear(): Promise source

Clear all values in local storage.

Return:

Promise

Test:

public static localGet(keys: string[] | string): Promise<Object<string, any>> source

Get multiple values from local storage.

Params:

NameTypeAttributeDescription
keys string[] | string

Keys in storage.

Return:

Promise<Object<string, any>>

Map of loaded values from storage.

Test:

public static localGetValue(key: string): Promise<any> source

Get single value from local storage.

Params:

NameTypeAttributeDescription
key string

Key in storage.

Return:

Promise<any>

Loaded value from storage, or undefined for missing key.

Test:

public static localRemove(keys: string): Promise source

Remove multiple values from local storage.

Params:

NameTypeAttributeDescription
keys string

Removed keys.

Return:

Promise

Test:

public static localSet(items: Object<string, any>): Promise source

Set multiple values into local storage.

Params:

NameTypeAttributeDescription
items Object<string, any>

Map of saving values.

Return:

Promise

Test:

public static localSetValue(key: string, value: any): Promise source

Set single value into local storage.

Params:

NameTypeAttributeDescription
key string

Key for saved value.

value any

Saved value.

Return:

Promise

Test:

public static syncClear(): Promise source

Clear all values in sync storage.

Return:

Promise

Test:

public static syncGet(keys: string[] | string): Promise<Object<string, any>> source

Get multiple values from sync storage.

Params:

NameTypeAttributeDescription
keys string[] | string

Keys in storage.

Return:

Promise<Object<string, any>>

Map of loaded values from storage.

Test:

public static syncGetValue(key: string): Promise<any> source

Get single value from sync storage.

Params:

NameTypeAttributeDescription
key string

Key in storage.

Return:

Promise<any>

Loaded value from storage, or undefined for missing key.

Test:

public static syncRemove(keys: string[] | string): Promise source

Remove multiple values from sync storage.

Params:

NameTypeAttributeDescription
keys string[] | string

Removed keys.

Return:

Promise

Test:

public static syncSet(items: Object<string, any>): Promise source

Set multiple values into sync storage.

Params:

NameTypeAttributeDescription
items Object<string, any>

Map of saving values.

Return:

Promise

Test:

public static syncSetValue(key: string, value: any): Promise source

Set single value into sync storage.

Params:

NameTypeAttributeDescription
key string

Key for saved value.

value any

Saved value.

Return:

Promise

Test: