Skip to main content

Serialization

Functions

copyIsaacAPIClass

copyIsaacAPIClass<T>(isaacAPIClass): T

Helper function to generically copy an Isaac API class without knowing what specific type of class it is. (This is used by the save data manager.)

For the list of supported classes, see the CopyableIsaacAPIClassType enum.

Type parameters

NameType
Textends CopyableIsaacAPIClass

Parameters

NameType
isaacAPIClassT

Returns

T

Defined in

packages/isaacscript-common/src/functions/serialization.ts:21


deserializeIsaacAPIClass

deserializeIsaacAPIClass<SerializedT>(serializedIsaacAPIClass): IsaacAPIClassTypeToType[SerializedT["__kind"]]

Helper function to generically deserialize an Isaac API class without knowing what specific type of class it is. (This is used by the save data manager when reading data from the "save#.dat" file.)

For the list of supported classes, see the CopyableIsaacAPIClassType enum.

Type parameters

NameType
SerializedTextends SerializedIsaacAPIClass

Parameters

NameType
serializedIsaacAPIClassSerializedT

Returns

IsaacAPIClassTypeToType[SerializedT["__kind"]]

Defined in

packages/isaacscript-common/src/functions/serialization.ts:66


isCopyableIsaacAPIClass

isCopyableIsaacAPIClass(object): object is CopyableIsaacAPIClass

Helper function to generically check if a given object is a copyable Isaac API class. (This is used by the save data manager when determining what is safe to copy.)

For the list of supported classes, see the CopyableIsaacAPIClassType enum.

Parameters

NameType
objectunknown

Returns

object is CopyableIsaacAPIClass

Defined in

packages/isaacscript-common/src/functions/serialization.ts:128


isSerializedIsaacAPIClass

isSerializedIsaacAPIClass(object): object is SerializedIsaacAPIClass

Helper function to generically check if a given Lua table is a serialized Isaac API class. (This is used by the save data manager when reading data from the "save#.dat" file.)

For the list of supported classes, see the CopyableIsaacAPIClassType enum.

Parameters

NameType
objectunknown

Returns

object is SerializedIsaacAPIClass

Defined in

packages/isaacscript-common/src/functions/serialization.ts:142


serializeIsaacAPIClass

serializeIsaacAPIClass<T>(isaacAPIClass): IsaacAPIClassTypeToSerializedType[T["__kind"]]

Helper function to generically serialize an Isaac API class without knowing what specific type of class it is. (This is used by the save data manager when writing data to the "save#.dat" file.)

For the list of supported classes, see the CopyableIsaacAPIClassType enum.

Type parameters

NameType
Textends CopyableIsaacAPIClass

Parameters

NameType
isaacAPIClassT

Returns

IsaacAPIClassTypeToSerializedType[T["__kind"]]

Defined in

packages/isaacscript-common/src/functions/serialization.ts:160