Class AsyncMapTransaction<T>

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

asyncDone: Promise<unknown> = ...
store: T

Methods

  • Internal

    Gets a cache resource If info is set and the resource doesn't exist, it will be created

    Parameters

    • id: number
    • Optionalinfo: { size: number }

    Returns undefined | Resource<number>

  • Internal

    Run a asynchronous operation from a sync context. Not magic and subject to (race) conditions.

    Parameters

    • promise: Promise<unknown>

    Returns void

  • Retrieves data.

    Parameters

    • id: number

      The key to look under for data.

    • Optionaloffset: number
    • Optionalend: number

    Returns Promise<undefined | Uint8Array<ArrayBufferLike>>

  • Retrieves data. Throws an error if an error occurs or if the key does not exist.

    Parameters

    • id: number

      The key to look under for data.

    • Optionaloffset: number
    • Optionalend: number

    Returns undefined | Uint8Array<ArrayBufferLike>

    The data stored under the key, or undefined if not present.

  • Adds the data to the store under an id. Overwrites any existing data.

    Parameters

    • id: number

      The key to add the data under.

    • data: Uint8Array

      The data to add to the store.

    • offset: number = 0

    Returns Promise<void>

  • Adds the data to the store under and id.

    Parameters

    • id: number

      The key to add the data under.

    • data: Uint8Array

      The data to add to the store.

    • offset: number

    Returns void