Class

RSCache

RSCache(cacheRootDir, progressFunc)

Creates a RSCache reader
Constructor

# new RSCache(cacheRootDir, progressFunc)

Parameters:
Name Type Description
cacheRootDir string
progressFunc function Progress function callback. Passes 1 parameter which is the amount of progress from the last step (not total progress)

View Source RSCache.js, line 27

Methods

# close()

Closes the cache and cleans up the web worker pool

View Source RSCache.js, line 189

# async getAllDefs(indexId, archiveId, options)

Helper method to map getAllFiles results to definitions
Parameters:
Name Type Description
indexId Number | IndexType Can be a number or IndexType
archiveId Number Can be a number but also can be a ConfigType if IndexType is CONFIG
options options

View Source RSCache.js, line 137

Definition

# async getAllFiles(indexId, archiveId, options)

Gets all of the files from an archive and loads their definitions if possible.
Parameters:
Name Type Description
indexId Number | IndexType Can be a number or IndexType
archiveId Number Can be a number but also can be a ConfigType if IndexType is CONFIG
options options

View Source RSCache.js, line 87

Array<File>

# async getDef(indexId, archiveId, fileId, options)

Helper method to map getFile results to its definition
Parameters:
Name Type Default Description
indexId Number | IndexType Can be a number or IndexType
archiveId Number Can be a number but also can be a ConfigType if IndexType is CONFIG
fileId Number 0 Id of the definition to get from the archive
options options

View Source RSCache.js, line 154

Definition

# async getFile(indexId, archiveId, fileId, options)

Gets a single file from an archive and load its definition if possible.
Parameters:
Name Type Default Description
indexId Number | IndexType Can be a number or IndexType
archiveId Number Can be a number but also can be a ConfigType if IndexType is CONFIG
fileId Number 0 Id of the file to get from the archive
options options

View Source RSCache.js, line 126

# getIndex(index)

Get a cache Index file.
Parameters:
Name Type Description
index Number | IndexType

View Source RSCache.js, line 54

# async getItem(id, options)

Helper method to get an Item definition
Parameters:
Name Type Description
id Number Item Id
options options

View Source RSCache.js, line 174

ItemDefinition

# async getNPC(id, options)

Helper method to get a NPC definition
Parameters:
Name Type Description
id Number NPC Id
options options

View Source RSCache.js, line 164

# async getObject(id, options)

Helper method to get an Object definition
Parameters:
Name Type Description
id Number Object Id
options options

View Source RSCache.js, line 184

ObjectDefinition