Interface DataPackageCache
interface DataPackageCache {
cachePackages?(gamePackages: Record<string, GamePackage>): Promise<void>;
getPackage(game: string, checksum?: string): Promise<GamePackage | null>;
}
cachePackages?(gamePackages: Record<string, GamePackage>): Promise<void>;
getPackage(game: string, checksum?: string): Promise<GamePackage | null>;
}
Methods
OptionalcachePackages
-
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.
- gamePackages: Record<string, GamePackage>
getPackage
-
Should return a GamePackage if available, otherwise null.
Parameters
- game: string
Optionalchecksum: string
Returns Promise<GamePackage | null>
An interface for managing a data package cache.