Interface DataPackageCache

An interface for managing a data package cache.

interface DataPackageCache {
    cachePackages?(gamePackages: Record<string, GamePackage>): Promise<void>;
    getPackage(game: string, checksum?: string): Promise<GamePackage | null>;
}
Index
  • Called after fetching the data package with the all the game packages that were fetched, so that they can be cached.

    Parameters

    • gamePackages: Record<string, GamePackage>

      An object where the keys are game names and the values are game packages.

    Returns Promise<void>

    A promise which should resolve only once all writes to the cache have been completed. The library will wait to continue until the promise is resolved.