Interface StorageInterface

The backend storage interfaced used by StorageManager.

interface StorageInterface {
    load(key: StorageKey): Promise<Uint8Array<ArrayBufferLike>>;
    loadRange(
        key: StorageKey,
    ): Promise<{ data: Uint8Array<ArrayBufferLike>; key: StorageKey }[]>;
    remove(key: StorageKey): Promise<void>;
    removeRange(key: StorageKey): Promise<void>;
    save(key: StorageKey, data: Uint8Array): Promise<void>;
}

Methods

  • Load the bytes at a given key.

    Parameters

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Load all values and keys that are prefixed by the given key.

    Parameters

    Returns Promise<{ data: Uint8Array<ArrayBufferLike>; key: StorageKey }[]>

  • Remove all values that are prefixed by the given key.

    Parameters

    Returns Promise<void>

  • Save the given data to the provided key.

    Parameters

    Returns Promise<void>