Skip to content

SaveData

Defined in: packages/isaacscript-common/src/interfaces/SaveData.ts:29

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

Persistent = unknown

Run = unknown

Level = unknown

optional persistent?: Serializable<Persistent>

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

optional run?: Serializable<Run>

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

optional level?: Serializable<Level>

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

optional room?: Record<string, unknown>

Defined in: packages/isaacscript-common/src/interfaces/SaveData.ts:37