Skip to main content

SaveData

This is the format of the object that you give to the save data manager. It will contains all of the variables for the particular mod feature.

Depending on which object keys you use, the variables will automatically be reset at certain times and automatically saved to disk.

Each sub-object of save data has a string as a key and arbitrary data as a value. However, the data has to be serializable. Specifically, this means that you can only use the following types:

  • boolean
  • number
  • string
  • undefined (will be skipped over when saving)
  • null (will be skipped over when saving)
  • Map / DefaultMap
  • Set
  • serializable Isaac API classes (such as Color)
  • TSTL classes (i.e. classes that you made yourself)
  • sub-objects or a LuaMap that contains the above values

Type parameters

NameType
Persistentunknown
Rununknown
Levelunknown

Properties

persistent

Optional persistent: Serializable<Persistent>

Defined in

packages/isaacscript-common/src/interfaces/SaveData.ts:33


run

Optional run: Serializable<Run>

Defined in

packages/isaacscript-common/src/interfaces/SaveData.ts:34


level

Optional level: Serializable<Level>

Defined in

packages/isaacscript-common/src/interfaces/SaveData.ts:35


room

Optional room: Record<string, unknown>

Defined in

packages/isaacscript-common/src/interfaces/SaveData.ts:36