CachedAssetsManager
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
enka: EnkaClient
Returns CachedAssetsManager
Properties
_cacheUpdater
readonly_contentsSrc
_githubCache
_isFetching
readonly_langs
List of supported languages
cacheDirectoryPath
Path of directory where genshin cache data is stored
readonlydefaultCacheDirectoryPath
Default path of genshin cache data directory
readonlyenka
The client that instantiated this
Methods
_downloadCacheZip
Download the zip file, which contains genshin cache data, from https://raw.githubusercontent.com/yuko1101/enka-network-api/main/cache.zip
Parameters
options: { ghproxy?: boolean } = {}
Returns Promise<void>
_validateCache
Parameters
showLog: boolean = true
Returns boolean
whether the cache is valid or not
activateAutoCacheUpdater
Parameters
options: Partial<AutoCacheUpdaterOptions> = {}
Returns void
cacheDirectorySetup
Create the necessary folders and files, and if the directory cacheDirectoryPath did not exist, move the cache files from the default path.
Returns Promise<void>
checkForUpdates
Parameters
useRawGenshinData: boolean = false
Whether to fetch from gitlab repo (https://gitlab.com/Dimbreath/AnimeGameData) instead of downloading cache.zip
Returns Promise<boolean>
Whether the game data update is available or not.
deactivateAutoCacheUpdater
Disables the updater activated by activateAutoCacheUpdater
Returns void
fetchAllContents
Parameters
options: Partial<FetchContentsOptions> = {}
Returns Promise<void>
fetchLanguageData
Obtains a text map for a specific language.
Parameters
lang: LanguageCode
Returns Promise<{}>
getGenshinCacheData
Parameters
name: string
without extensions (.json)
Returns JsonReader
getJSONDataPath
Parameters
name: string
without extensions (.json)
Returns string
excel bin file path
getLanguageData
Parameters
lang: LanguageCode
optionaldirectory: string
Returns {}
text map for a specific language
[key string]: string
getLanguageDataPath
Parameters
lang: LanguageCode
optionaldirectory: string
Returns string
text map file path for a specific language
getObjectKeysManager
Returns ObjectKeysManager
ObjectKeysManager of this
hasAllContents
Returns boolean
whether all genshin cache data files exist.
refreshAllData
Clean memory of cache data. Then reload data that was loaded before the clean if
reload
is true. Ifreload
is false, load each file as needed.Parameters
reload: boolean = false
Returns void
removeUnusedTextData
Remove all unused text map entries
Parameters
data: {}
langsData: LanguageMap
showLog: boolean = true
Returns LanguageMap
updateContents
Parameters
options: Partial<UpdateContentsOptions> = {}
Returns Promise<void>
true if there were any updates, false if there were no updates.
List of the names of the files this library uses