UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

38 lines 2.21 kB
import type { CopyableIsaacAPIClass, IsaacAPIClassTypeToSerializedType, IsaacAPIClassTypeToType, SerializedIsaacAPIClass } from "../objects/isaacAPIClassTypeToFunctions"; /** * 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. */ export declare function copyIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaacAPIClass: T): T; /** * 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. */ export declare function deserializeIsaacAPIClass<SerializedT extends SerializedIsaacAPIClass>(serializedIsaacAPIClass: SerializedT): IsaacAPIClassTypeToType[SerializedT["__kind"]]; /** * 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. */ export declare function isCopyableIsaacAPIClass(object: unknown): object is CopyableIsaacAPIClass; /** * 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. */ export declare function isSerializedIsaacAPIClass(object: unknown): object is SerializedIsaacAPIClass; /** * 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. */ export declare function serializeIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaacAPIClass: T): IsaacAPIClassTypeToSerializedType[T["__kind"]]; //# sourceMappingURL=serialization.d.ts.map