A map in the Key Value Store.

KVMap is modelled after JavaScript's Map object, except that keys and values must be of type ArrayBuffer and no guarantees on iteration order are provided.

interface KvMap {
    size: number;
    clear(): void;
    delete(key: ArrayBuffer): void;
    forEach(
        callback: (value: ArrayBuffer, key: ArrayBuffer, kvmap: KvMap) => void,
    ): void;
    get(key: ArrayBuffer): undefined | ArrayBuffer;
    getVersionOfPreviousWrite(key: ArrayBuffer): undefined | number;
    has(key: ArrayBuffer): boolean;
    set(key: ArrayBuffer, value: ArrayBuffer): KvMap;
}

Properties

size: number

Methods

  • Returns void

  • Parameters

    • key: ArrayBuffer

    Returns void

  • Parameters

    • callback: (value: ArrayBuffer, key: ArrayBuffer, kvmap: KvMap) => void

    Returns void

  • Parameters

    • key: ArrayBuffer

    Returns undefined | ArrayBuffer

  • Parameters

    • key: ArrayBuffer

    Returns undefined | number

  • Parameters

    • key: ArrayBuffer

    Returns boolean

  • Parameters

    • key: ArrayBuffer
    • value: ArrayBuffer

    Returns KvMap