Skip to content

storage

Declare storage.maxBytes. Binary objects are private to the plugin and local to the device, persisting across View and app restarts. read returns null for an absent key. Writes are subject to the declared quota and host limits.

Usage guide: services. API index.

Signatures, parameters and return types are generated from the SDK. Optional members are not available in every host and context.

Source

Supported hosts: Lite

List stored objects, optionally filtered by key prefix.

list(prefix?: string): Promise<Array<{
key: string;
size: number;
}>>;
Parameter Type Required
prefix string No

Returns: Promise<Array<{ key: string; size: number; }>>.

Supported hosts: Lite

Read object bytes, or null for an absent key.

read(key: string): Promise<Uint8Array | null>;
Parameter Type Required
key string Yes

Returns: Promise<Uint8Array &#124; null>.

Supported hosts: Lite

Write an object within the plugin’s storage quota.

write(key: string, value: Uint8Array): Promise<void>;
Parameter Type Required
key string Yes
value Uint8Array Yes

Returns: Promise<void>.

Supported hosts: Lite

Delete a private stored object.

delete(key: string): Promise<void>;
Parameter Type Required
key string Yes

Returns: Promise<void>.