isaacscript-common 6.22.3 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/classes/DefaultMap.d.ts +3 -3
  2. package/dist/classes/DefaultMap.d.ts.map +1 -1
  3. package/dist/classes/DefaultMap.lua +37 -0
  4. package/dist/features/customStage/exports.lua +2 -2
  5. package/dist/features/disableInputs.d.ts +1 -1
  6. package/dist/features/disableInputs.d.ts.map +1 -1
  7. package/dist/features/runInNFrames.lua +1 -6
  8. package/dist/features/runNextRoom.lua +1 -6
  9. package/dist/features/saveDataManager/exports.d.ts +13 -8
  10. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  11. package/dist/features/saveDataManager/exports.lua +12 -7
  12. package/dist/features/saveDataManager/maps.d.ts +2 -2
  13. package/dist/features/saveDataManager/maps.d.ts.map +1 -1
  14. package/dist/features/taintedLazarusPlayers.lua +1 -6
  15. package/dist/functions/deepCopy.lua +1 -1
  16. package/dist/functions/isaacAPIClass.d.ts +1 -1
  17. package/dist/functions/isaacAPIClass.d.ts.map +1 -1
  18. package/dist/functions/level.lua +2 -2
  19. package/dist/functions/levelGrid.d.ts +3 -1
  20. package/dist/functions/levelGrid.d.ts.map +1 -1
  21. package/dist/functions/levelGrid.lua +15 -10
  22. package/dist/functions/minimap.lua +3 -3
  23. package/dist/functions/rooms.d.ts +1 -1
  24. package/dist/functions/rooms.d.ts.map +1 -1
  25. package/dist/functions/rooms.lua +4 -4
  26. package/dist/interfaces/SaveData.d.ts +43 -4
  27. package/dist/interfaces/SaveData.d.ts.map +1 -1
  28. package/dist/interfaces/SaveData.lua +66 -0
  29. package/dist/types/index.d.ts +0 -1
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/package.json +2 -2
  32. package/src/classes/DefaultMap.ts +36 -7
  33. package/src/features/customStage/exports.ts +2 -2
  34. package/src/features/disableInputs.ts +3 -9
  35. package/src/features/runInNFrames.ts +1 -1
  36. package/src/features/runNextRoom.ts +1 -1
  37. package/src/features/saveDataManager/exports.ts +28 -10
  38. package/src/features/saveDataManager/save.ts +2 -1
  39. package/src/features/taintedLazarusPlayers.ts +2 -2
  40. package/src/functions/deepCopy.ts +1 -1
  41. package/src/functions/entities.ts +2 -2
  42. package/src/functions/isaacAPIClass.ts +0 -1
  43. package/src/functions/level.ts +2 -2
  44. package/src/functions/levelGrid.ts +16 -12
  45. package/src/functions/minimap.ts +3 -3
  46. package/src/functions/rooms.ts +4 -4
  47. package/src/interfaces/SaveData.ts +257 -5
  48. package/src/types/index.ts +0 -1
  49. package/src/types/indexTypeDoc.ts +0 -1
  50. package/dist/classes/indexTypeDoc.d.ts +0 -3
  51. package/dist/classes/indexTypeDoc.d.ts.map +0 -1
  52. package/dist/classes/indexTypeDoc.lua +0 -4
  53. package/dist/core/indexTypeDoc.d.ts +0 -5
  54. package/dist/core/indexTypeDoc.d.ts.map +0 -1
  55. package/dist/core/indexTypeDoc.lua +0 -6
  56. package/dist/enums/indexTypeDoc.d.ts +0 -9
  57. package/dist/enums/indexTypeDoc.d.ts.map +0 -1
  58. package/dist/enums/indexTypeDoc.lua +0 -10
  59. package/dist/features/indexTypeDoc.d.ts +0 -30
  60. package/dist/features/indexTypeDoc.d.ts.map +0 -1
  61. package/dist/features/indexTypeDoc.lua +0 -31
  62. package/dist/functions/indexTypeDoc.d.ts +0 -99
  63. package/dist/functions/indexTypeDoc.d.ts.map +0 -1
  64. package/dist/functions/indexTypeDoc.lua +0 -100
  65. package/dist/indexTypeDoc.d.ts +0 -10
  66. package/dist/indexTypeDoc.d.ts.map +0 -1
  67. package/dist/indexTypeDoc.lua +0 -11
  68. package/dist/interfaces/indexTypeDoc.d.ts +0 -11
  69. package/dist/interfaces/indexTypeDoc.d.ts.map +0 -1
  70. package/dist/interfaces/indexTypeDoc.lua +0 -2
  71. package/dist/maps/indexTypeDoc.d.ts +0 -5
  72. package/dist/maps/indexTypeDoc.d.ts.map +0 -1
  73. package/dist/maps/indexTypeDoc.lua +0 -6
  74. package/dist/objects/indexTypeDoc.d.ts +0 -2
  75. package/dist/objects/indexTypeDoc.d.ts.map +0 -1
  76. package/dist/objects/indexTypeDoc.lua +0 -3
  77. package/dist/types/IsaacAPIClass.d.ts +0 -5
  78. package/dist/types/IsaacAPIClass.d.ts.map +0 -1
  79. package/dist/types/IsaacAPIClass.lua +0 -2
  80. package/dist/types/indexTypeDoc.d.ts +0 -12
  81. package/dist/types/indexTypeDoc.d.ts.map +0 -1
  82. package/dist/types/indexTypeDoc.lua +0 -3
  83. package/src/types/IsaacAPIClass.ts +0 -3
@@ -2,7 +2,7 @@
2
2
  * A function that creates the default value for your `DefaultMap`. For example, if it was a
3
3
  * `DefaultMap` containing maps, the factory function would be: `() => new Map()`
4
4
  */
5
- export declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs: Args) => V;
5
+ export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
6
6
  /**
7
7
  * `DefaultMap` is a data structure that makes working with default values easier.
8
8
  *
@@ -95,12 +95,12 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
95
95
  * If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
96
96
  * it will set a default value for the provided key, and then return the default value.
97
97
  */
98
- getAndSetDefault(key: Key, ...extraArgs: Args): Value;
98
+ getAndSetDefault(key: Key, ...args: Args): Value;
99
99
  /**
100
100
  * Returns the default value to be used for a new key. (If a factory function was provided during
101
101
  * instantiation, this will execute the factory function.)
102
102
  */
103
- getDefaultValue(...extraArgs: Args): Value;
103
+ getDefaultValue(...args: Args): Value;
104
104
  /**
105
105
  * Helper method for cloning the map. Returns either the default value or a reference to the
106
106
  * factory function.
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,eAAe,CAAC,CAAC,EAAE,IAAI,SAAS,OAAO,EAAE,IA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,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,mBAAmB,CAA2C;IAEtE;;;OAGG;gBAED,6BAA6B,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,EACnE,gBAAgB,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAqB3C;;;OAGG;IACH,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAWhD;;;OAGG;IACH,eAAe,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAYrC;;;OAGG;IACH,iBAAiB,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC;CAW1D"}
@@ -3,6 +3,7 @@ local __TS__Class = ____lualib.__TS__Class
3
3
  local Map = ____lualib.Map
4
4
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
5
5
  local __TS__TypeOf = ____lualib.__TS__TypeOf
6
+ local __TS__New = ____lualib.__TS__New
6
7
  local ____exports = {}
7
8
  local ____types = require("functions.types")
8
9
  local isFunction = ____types.isFunction
@@ -131,4 +132,40 @@ function DefaultMap.prototype.getConstructorArg(self)
131
132
  end
132
133
  error("A DefaultMap was incorrectly instantiated.")
133
134
  end
135
+ local function test(self)
136
+ local myDefaultMapBoolean = __TS__New(____exports.DefaultMap, false)
137
+ local myDefaultMapBooleanFactory = __TS__New(
138
+ ____exports.DefaultMap,
139
+ function() return false end
140
+ )
141
+ local myDefaultMapBooleanWithoutParams = __TS__New(____exports.DefaultMap, false)
142
+ local myDefaultMapNumber = __TS__New(____exports.DefaultMap, 123)
143
+ local myDefaultMapNumberFactory = __TS__New(
144
+ ____exports.DefaultMap,
145
+ function() return 123 end
146
+ )
147
+ local myDefaultMapNumberWithoutParams = __TS__New(____exports.DefaultMap, 123)
148
+ local myDefaultMapString = __TS__New(____exports.DefaultMap, "foo")
149
+ local myDefaultMapStringFactory = __TS__New(
150
+ ____exports.DefaultMap,
151
+ function() return "foo" end
152
+ )
153
+ local myDefaultMapStringWithoutParams = __TS__New(____exports.DefaultMap, "foo")
154
+ local myDefaultMapArray = __TS__New(
155
+ ____exports.DefaultMap,
156
+ function() return {} end
157
+ )
158
+ local myDefaultMapArrayWithoutParams = __TS__New(
159
+ ____exports.DefaultMap,
160
+ function() return {} end
161
+ )
162
+ local myDefaultMapMap = __TS__New(
163
+ ____exports.DefaultMap,
164
+ function() return __TS__New(Map) end
165
+ )
166
+ local myDefaultMapMapWithoutParams = __TS__New(
167
+ ____exports.DefaultMap,
168
+ function() return __TS__New(Map) end
169
+ )
170
+ end
134
171
  return ____exports
@@ -19,7 +19,7 @@ local ____rng = require("functions.rng")
19
19
  local newRNG = ____rng.newRNG
20
20
  local ____rooms = require("functions.rooms")
21
21
  local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
22
- local getRoomsInGrid = ____rooms.getRoomsInGrid
22
+ local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
23
23
  local ____stage = require("functions.stage")
24
24
  local setStage = ____stage.setStage
25
25
  local ____customStageUtils = require("features.customStage.customStageUtils")
@@ -32,7 +32,7 @@ local customStagesMap = ____v.customStagesMap
32
32
  function setStageRoomsData(self, customStage, rng, verbose)
33
33
  local level = game:GetLevel()
34
34
  local startingRoomGridIndex = level:GetStartingRoomIndex()
35
- for ____, room in ipairs(getRoomsInGrid(nil)) do
35
+ for ____, room in ipairs(getRoomsInsideGrid(nil)) do
36
36
  do
37
37
  if room.SafeGridIndex == startingRoomGridIndex then
38
38
  goto __continue7
@@ -39,7 +39,7 @@ export declare function enableAllInputsExceptFor(key: string, blacklist: Set<But
39
39
  * that multiple mod features can work in tandem.
40
40
  * @param whitelist A set of ButtonActions to allow.
41
41
  */
42
- export declare function disableAllInputsExceptFor(key: string, whitelist: Set<ButtonAction>): void;
42
+ export declare function disableAllInputsExceptFor(key: string, whitelist: Set<ButtonAction> | ReadonlySet<ButtonAction>): void;
43
43
  /**
44
44
  * Helper function to disable only the inputs used for moving the character (or moving the cursor in
45
45
  * the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under
@@ -1 +1 @@
1
- {"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAuBtC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAoBhD;AA+CD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAC3B,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD"}
1
+ {"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAiBtC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAoBhD;AA+CD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD"}
@@ -60,12 +60,7 @@ end
60
60
  local FEATURE_NAME = "runInNFrames"
61
61
  v = {run = {queuedGameFunctionTuples = {}, queuedRenderFunctionTuples = {}, intervalGameFunctionTuples = {}, intervalRenderFunctionTuples = {}}}
62
62
  function ____exports.runInNFramesInit(self, mod)
63
- saveDataManager(
64
- nil,
65
- FEATURE_NAME,
66
- v,
67
- function() return false end
68
- )
63
+ saveDataManager(nil, FEATURE_NAME, v, false)
69
64
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
70
65
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
71
66
  end
@@ -17,12 +17,7 @@ end
17
17
  local FEATURE_NAME = "runNextRoom"
18
18
  v = {run = {queuedFunctions = {}}}
19
19
  function ____exports.runNextRoomInit(self, mod)
20
- saveDataManager(
21
- nil,
22
- FEATURE_NAME,
23
- v,
24
- function() return false end
25
- )
20
+ saveDataManager(nil, FEATURE_NAME, v, false)
26
21
  mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
27
22
  end
28
23
  --- Supply a function to run on the next `POST_NEW_ROOM` callback.
@@ -79,15 +79,20 @@ import { SaveData } from "../../interfaces/SaveData";
79
79
  * manager. The save data manager will throw an error if the key is already registered.
80
80
  * @param v An object that corresponds to the `SaveData` interface. The object is conventionally
81
81
  * called "v" for brevity. ("v" is short for "local variables").
82
- * @param conditionalFunc An optional function to run upon saving this key to disk. For example,
83
- * this allows features to only save data to disk if the feature is enabled.
84
- * Specify a value of `() => false` to completely disable saving this feature
85
- * to disk. Disabling saving to disk is useful if you are using data that is
86
- * not serializable. Alternatively, it could be useful if you want to use the
87
- * save data manager to automatically reset variables on run/level/room, but
88
- * not clutter the the "save#.dat" file with unnecessary keys.
82
+ * @param conditionalFunc Optional. A function to run to check if this save data should be written
83
+ * to disk. Default is `() => true`, meaning that this save data will always
84
+ * be written to disk. Use a conditional function for the situations when the
85
+ * local variables are for a feature that the end-user can disable. (If the
86
+ * feature is disabled, then there would be no point in writing any of the
87
+ * variables to the "save#.dat" file.) You can also specify `false` to this
88
+ * argument in order to completely disable saving data. (Specifying `false`
89
+ * will allow you to use non-serializable objects in your save data, such as
90
+ * `EntityPtr`.
89
91
  */
90
- export declare function saveDataManager(key: string, v: SaveData, conditionalFunc?: () => boolean): void;
92
+ export declare function saveDataManager<Persistent, Run, Level>(key: string, // This is the overload for the standard case with serializable data.
93
+ v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
94
+ export declare function saveDataManager(key: string, // This is the overload for the case when saving data is disabled.
95
+ v: SaveData, conditionalFunc: false): void;
91
96
  /**
92
97
  * The save data manager will automatically load variables from disk at the appropriate times (i.e.
93
98
  * when a new run is started). Use this function to explicitly force the save data manager to load
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,IAAI,CAiBN"}
@@ -99,13 +99,15 @@ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MA
99
99
  -- manager. The save data manager will throw an error if the key is already registered.
100
100
  -- @param v An object that corresponds to the `SaveData` interface. The object is conventionally
101
101
  -- called "v" for brevity. ("v" is short for "local variables").
102
- -- @param conditionalFunc An optional function to run upon saving this key to disk. For example,
103
- -- this allows features to only save data to disk if the feature is enabled.
104
- -- Specify a value of `() => false` to completely disable saving this feature
105
- -- to disk. Disabling saving to disk is useful if you are using data that is
106
- -- not serializable. Alternatively, it could be useful if you want to use the
107
- -- save data manager to automatically reset variables on run/level/room, but
108
- -- not clutter the the "save#.dat" file with unnecessary keys.
102
+ -- @param conditionalFunc Optional. A function to run to check if this save data should be written
103
+ -- to disk. Default is `() => true`, meaning that this save data will always
104
+ -- be written to disk. Use a conditional function for the situations when the
105
+ -- local variables are for a feature that the end-user can disable. (If the
106
+ -- feature is disabled, then there would be no point in writing any of the
107
+ -- variables to the "save#.dat" file.) You can also specify `false` to this
108
+ -- argument in order to completely disable saving data. (Specifying `false`
109
+ -- will allow you to use non-serializable objects in your save data, such as
110
+ -- `EntityPtr`.
109
111
  function ____exports.saveDataManager(self, key, v, conditionalFunc)
110
112
  errorIfFeaturesNotInitialized(nil, SAVE_DATA_MANAGER_FEATURE_NAME)
111
113
  if not isString(nil, key) then
@@ -115,6 +117,9 @@ function ____exports.saveDataManager(self, key, v, conditionalFunc)
115
117
  error((("The " .. SAVE_DATA_MANAGER_FEATURE_NAME) .. " is already managing save data for a key of: ") .. key)
116
118
  end
117
119
  saveDataMap[key] = v
120
+ if conditionalFunc == false then
121
+ conditionalFunc = function() return false end
122
+ end
118
123
  local saveDataKeys = __TS__ObjectKeys(v)
119
124
  if #saveDataKeys == 1 and saveDataKeys[1] == "room" then
120
125
  conditionalFunc = function() return false end
@@ -5,7 +5,7 @@ import { SaveData } from "../../interfaces/SaveData";
5
5
  * Maps for the master map so that we can access the variables via the in-game console when
6
6
  * debugging. (TSTL Maps don't expose the map keys as normal keys.)
7
7
  */
8
- export declare const saveDataMap: LuaMap<string, SaveData>;
9
- export declare const saveDataDefaultsMap: LuaMap<string, SaveData>;
8
+ export declare const saveDataMap: LuaMap<string, SaveData<unknown, unknown, unknown>>;
9
+ export declare const saveDataDefaultsMap: LuaMap<string, SaveData<unknown, unknown, unknown>>;
10
10
  export declare const saveDataConditionalFuncMap: LuaMap<string, () => boolean>;
11
11
  //# sourceMappingURL=maps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,0BAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,0BAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC"}
1
+ {"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,qDAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC"}
@@ -50,12 +50,7 @@ v = {run = {
50
50
  subPlayerMap = __TS__New(Map)
51
51
  }}
52
52
  function ____exports.taintedLazarusPlayersInit(self, mod)
53
- saveDataManager(
54
- nil,
55
- FEATURE_NAME,
56
- v,
57
- function() return false end
58
- )
53
+ saveDataManager(nil, FEATURE_NAME, v, false)
59
54
  mod:AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit)
60
55
  end
61
56
  --- Helper function to get the other version of Tainted Lazarus.
@@ -210,7 +210,7 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
210
210
  local constructorArg = ____isDefaultMap_result_0
211
211
  if serializationType == SerializationType.SERIALIZE and not isPrimitive(nil, constructorArg) then
212
212
  if insideMap then
213
- error("Failed to deep copy a DefaultMap because it was instantiated with a factory function and was also inside of another map. You cannot use a nested DefaultMap in this way because factory functions are not serializable. (In other words, there is no way to copy the function that you are using for the DefaultMap into the \"save#.dat\" file.) Instead, refactor your data structure so that the DefaultMap is not nested.")
213
+ error("Failed to deep copy a DefaultMap because it was instantiated with a factory function and was also inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#failed-to-deep-copy-a-defaultmap")
214
214
  else
215
215
  return deepCopyMap(
216
216
  nil,
@@ -17,7 +17,7 @@
17
17
  /// <reference types="isaac-typescript-definitions" />
18
18
  /// <reference types="isaac-typescript-definitions" />
19
19
  /// <reference types="isaac-typescript-definitions" />
20
- import { IsaacAPIClass } from "../types/IsaacAPIClass";
20
+ /// <reference types="isaac-typescript-definitions" />
21
21
  /**
22
22
  * Helper function to get the name of a class from the Isaac API. This is contained within the
23
23
  * "__type" metatable key.
@@ -1 +1 @@
1
- {"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkBxE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;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,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,gBAAgB,CAExE;AAED,0EAA0E;AAC1E,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,aAAa,CAElE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAKT"}
@@ -9,13 +9,13 @@ local ____levelGrid = require("functions.levelGrid")
9
9
  local isDoorSlotValidAtGridIndexForRedRoom = ____levelGrid.isDoorSlotValidAtGridIndexForRedRoom
10
10
  local ____rooms = require("functions.rooms")
11
11
  local getNumRooms = ____rooms.getNumRooms
12
- local getRoomsInGrid = ____rooms.getRoomsInGrid
12
+ local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
13
13
  function ____exports.fillLevelWithRedRooms(self)
14
14
  local level = game:GetLevel()
15
15
  local numRoomsInGrid
16
16
  repeat
17
17
  do
18
- local roomsInGrid = getRoomsInGrid(nil)
18
+ local roomsInGrid = getRoomsInsideGrid(nil)
19
19
  numRoomsInGrid = #roomsInGrid
20
20
  for ____, roomDescriptor in ipairs(roomsInGrid) do
21
21
  for ____, doorSlot in ipairs(getEnumValues(nil, DoorSlot)) do
@@ -120,8 +120,10 @@ export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
120
120
  * Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
121
121
  *
122
122
  * For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
123
+ *
124
+ * @param roomGridIndex Optional. Default is the current room index.
123
125
  */
124
- export declare function isRoomGridIndexInBounds(roomGridIndex: int): boolean;
126
+ export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
125
127
  /**
126
128
  * Helper function to generate a new room on the floor at a valid dead end attached to a normal
127
129
  * room.
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA6BtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAerE;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,GAAG,EAAE,CAG7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAErC,CAAC,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,CAAC,GACvE,SAAS,CAOZ;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,GAClB,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CA+CjD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,KAAK,CACnD;IAAC,qBAAqB,EAAE,GAAG;IAAE,QAAQ,EAAE,QAAQ;IAAE,gBAAgB,EAAE,GAAG;CAAC,CACxE,CAsBA;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,EAAE,CAWzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CA+BxE;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,SAAS,EAAE,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EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,IAAI,GAAG,GAAG,SAAS,CA6CzC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAKtE"}
@@ -40,7 +40,7 @@ local getRoomGridIndex = ____roomData.getRoomGridIndex
40
40
  local getRoomShape = ____roomData.getRoomShape
41
41
  local ____rooms = require("functions.rooms")
42
42
  local getRooms = ____rooms.getRooms
43
- local getRoomsInGrid = ____rooms.getRoomsInGrid
43
+ local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
44
44
  local ____roomShape = require("functions.roomShape")
45
45
  local getGridIndexDelta = ____roomShape.getGridIndexDelta
46
46
  --- Helper function to get the room grid indexes that are adjacent to a given room grid index.
@@ -57,7 +57,7 @@ local getGridIndexDelta = ____roomShape.getGridIndexDelta
57
57
  -- @param roomGridIndex Optional. Default is the current room index.
58
58
  function ____exports.getAdjacentRoomGridIndexes(self, roomGridIndex)
59
59
  local roomGridIndexToUse = roomGridIndex == nil and getRoomGridIndex(nil) or roomGridIndex
60
- if not ____exports.isRoomGridIndexInBounds(nil, roomGridIndexToUse) then
60
+ if not ____exports.isRoomInsideGrid(nil, roomGridIndexToUse) then
61
61
  return {}
62
62
  end
63
63
  local adjacentRoomGridIndexes = __TS__ArrayMap(
@@ -66,7 +66,7 @@ function ____exports.getAdjacentRoomGridIndexes(self, roomGridIndex)
66
66
  )
67
67
  return __TS__ArrayFilter(
68
68
  adjacentRoomGridIndexes,
69
- function(____, adjacentRoomGridIndex) return ____exports.isRoomGridIndexInBounds(nil, adjacentRoomGridIndex) end
69
+ function(____, adjacentRoomGridIndex) return ____exports.isRoomInsideGrid(nil, adjacentRoomGridIndex) end
70
70
  )
71
71
  end
72
72
  --- Helper function to iterate through the possible doors for a room and see if any of them would be
@@ -76,7 +76,7 @@ end
76
76
  -- @returns A array of tuples of `DoorSlot` and room grid index.
77
77
  function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
78
78
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
79
- if not ____exports.isRoomGridIndexInBounds(nil, roomDescriptor.SafeGridIndex) then
79
+ if not ____exports.isRoomInsideGrid(nil, roomDescriptor.SafeGridIndex) then
80
80
  return {}
81
81
  end
82
82
  local roomData = roomDescriptor.Data
@@ -110,7 +110,7 @@ end
110
110
  --
111
111
  -- @returns A array of tuples of adjacent room grid index, `DoorSlot`, and new room grid index.
112
112
  function ____exports.getNewRoomCandidatesForLevel(self)
113
- local rooms = getRoomsInGrid(nil)
113
+ local rooms = getRoomsInsideGrid(nil)
114
114
  local normalRooms = __TS__ArrayFilter(
115
115
  rooms,
116
116
  function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and room.Data.Subtype ~= DownpourRoomSubType.MIRROR and room.Data.Subtype ~= MinesRoomSubType.MINESHAFT_ENTRANCE end
@@ -149,7 +149,7 @@ function ____exports.getRoomShapeNeighborGridIndexes(self, safeRoomGridIndex, ro
149
149
  local doorSlot = ____value[1]
150
150
  local delta = ____value[2]
151
151
  local roomGridIndex = safeRoomGridIndex + delta
152
- if ____exports.isRoomGridIndexInBounds(nil, roomGridIndex) then
152
+ if ____exports.isRoomInsideGrid(nil, roomGridIndex) then
153
153
  neighborGridIndexes:set(doorSlot, roomGridIndex)
154
154
  end
155
155
  end
@@ -180,7 +180,12 @@ end
180
180
  --- Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
181
181
  --
182
182
  -- For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
183
- function ____exports.isRoomGridIndexInBounds(self, roomGridIndex)
183
+ --
184
+ -- @param roomGridIndex Optional. Default is the current room index.
185
+ function ____exports.isRoomInsideGrid(self, roomGridIndex)
186
+ if roomGridIndex == nil then
187
+ roomGridIndex = getRoomGridIndex(nil)
188
+ end
184
189
  return roomGridIndex >= 0 and roomGridIndex <= MAX_LEVEL_GRID_INDEX
185
190
  end
186
191
  --- Helper function to check if a room exists at the given room grid index. (A room will exist if it
@@ -229,7 +234,7 @@ end
229
234
  -- indexes for N room types.
230
235
  function ____exports.getRoomGridIndexesForType(self, ...)
231
236
  local roomTypesSet = __TS__New(Set, {...})
232
- local rooms = getRoomsInGrid(nil)
237
+ local rooms = getRoomsInsideGrid(nil)
233
238
  local matchingRooms = __TS__ArrayFilter(
234
239
  rooms,
235
240
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypesSet:has(roomDescriptor.Data.Type) end
@@ -249,7 +254,7 @@ end
249
254
  -- @returns A map of `DoorSlot` to the corresponding room grid index.
250
255
  function ____exports.getRoomNeighbors(self, roomGridIndex)
251
256
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
252
- if not ____exports.isRoomGridIndexInBounds(nil, roomDescriptor.SafeGridIndex) then
257
+ if not ____exports.isRoomInsideGrid(nil, roomDescriptor.SafeGridIndex) then
253
258
  return __TS__New(Map)
254
259
  end
255
260
  local roomData = roomDescriptor.Data
@@ -285,7 +290,7 @@ function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGr
285
290
  return false
286
291
  end
287
292
  local redRoomGridIndex = roomGridIndex + delta
288
- return not ____exports.roomExists(nil, redRoomGridIndex) and ____exports.isRoomGridIndexInBounds(nil, redRoomGridIndex)
293
+ return not ____exports.roomExists(nil, redRoomGridIndex) and ____exports.isRoomInsideGrid(nil, redRoomGridIndex)
289
294
  end
290
295
  --- Helper function to detect if the provided room was created by the Red Key item. Under the hood,
291
296
  -- this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
@@ -10,7 +10,7 @@ local game = ____cachedClasses.game
10
10
  local ____roomData = require("functions.roomData")
11
11
  local getRoomDescriptor = ____roomData.getRoomDescriptor
12
12
  local ____rooms = require("functions.rooms")
13
- local getRoomsInGrid = ____rooms.getRoomsInGrid
13
+ local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
14
14
  --- Helper function to set a particular room's minimap display flags (e.g. whether or not it is
15
15
  -- visible and so on).
16
16
  --
@@ -26,7 +26,7 @@ end
26
26
  -- the changes will be immediately visible.
27
27
  function ____exports.clearFloorDisplayFlags(self)
28
28
  local level = game:GetLevel()
29
- for ____, room in ipairs(getRoomsInGrid(nil)) do
29
+ for ____, room in ipairs(getRoomsInsideGrid(nil)) do
30
30
  room.DisplayFlags = DisplayFlagZero
31
31
  end
32
32
  level:UpdateVisibility()
@@ -35,7 +35,7 @@ end
35
35
  -- that is indexed by the room's safe grid index.
36
36
  function ____exports.getFloorDisplayFlags(self)
37
37
  local displayFlagsMap = __TS__New(Map)
38
- local roomsInGrid = getRoomsInGrid(nil)
38
+ local roomsInGrid = getRoomsInsideGrid(nil)
39
39
  for ____, roomDescriptor in ipairs(roomsInGrid) do
40
40
  displayFlagsMap:set(roomDescriptor.SafeGridIndex, roomDescriptor.DisplayFlags)
41
41
  end
@@ -79,7 +79,7 @@ export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDe
79
79
  * extra-dimensional rooms are automatically be generated. Default
80
80
  * is false.
81
81
  */
82
- export declare function getRoomsInGrid(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
82
+ export declare function getRoomsInsideGrid(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
83
83
  /**
84
84
  * Helper function to get the room descriptor for every room on the level in a specific dimension.
85
85
  * This will not include any off-grid rooms, such as the Devil Room.
@@ -1 +1 @@
1
- {"version":3,"file":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AI,OAAO,CAUjC;AAED,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAWhE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -97,7 +97,7 @@ end
97
97
  -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
98
98
  -- extra-dimensional rooms are automatically be generated. Default
99
99
  -- is false.
100
- function ____exports.getRoomsInGrid(self, includeExtraDimensionalRooms)
100
+ function ____exports.getRoomsInsideGrid(self, includeExtraDimensionalRooms)
101
101
  if includeExtraDimensionalRooms == nil then
102
102
  includeExtraDimensionalRooms = false
103
103
  end
@@ -146,7 +146,7 @@ end
146
146
  --- Helper function to get the number of rooms that are currently on the floor layout. This does not
147
147
  -- include off-grid rooms, like the Devil Room.
148
148
  function ____exports.getNumRooms(self)
149
- local rooms = ____exports.getRoomsInGrid(nil)
149
+ local rooms = ____exports.getRoomsInsideGrid(nil)
150
150
  return #rooms
151
151
  end
152
152
  --- Helper function to get the room data for a specific room type and variant combination. This is
@@ -210,7 +210,7 @@ function ____exports.getRooms(self, includeExtraDimensionalRooms)
210
210
  if includeExtraDimensionalRooms == nil then
211
211
  includeExtraDimensionalRooms = false
212
212
  end
213
- local roomsInGrid = ____exports.getRoomsInGrid(nil, includeExtraDimensionalRooms)
213
+ local roomsInGrid = ____exports.getRoomsInsideGrid(nil, includeExtraDimensionalRooms)
214
214
  local roomsOutsideGrid = ____exports.getRoomsOutsideGrid(nil)
215
215
  local ____array_0 = __TS__SparseArrayNew(table.unpack(roomsInGrid))
216
216
  __TS__SparseArrayPush(
@@ -356,7 +356,7 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
356
356
  ____temp_1 = __TS__New(Set, onlyCheckRoomTypes)
357
357
  end
358
358
  local roomTypeWhitelist = ____temp_1
359
- local rooms = ____exports.getRoomsInGrid(nil)
359
+ local rooms = ____exports.getRoomsInsideGrid(nil)
360
360
  local matchingRooms = roomTypeWhitelist == nil and rooms or __TS__ArrayFilter(
361
361
  rooms,
362
362
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
@@ -1,3 +1,8 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /// <reference types="isaac-typescript-definitions" />
3
+ /// <reference types="isaac-typescript-definitions" />
4
+ /// <reference types="isaac-typescript-definitions" />
5
+ /// <reference types="isaac-typescript-definitions" />
1
6
  /**
2
7
  * This is the format of the object that you give to the save data manager. It will contains all of
3
8
  * the variables for the particular mod feature.
@@ -11,6 +16,8 @@
11
16
  * - `boolean`
12
17
  * - `number`
13
18
  * - `string`
19
+ * - `undefined` (will be skipped over when saving)
20
+ * - `null` (will be skipped over when saving)
14
21
  * - `Map` / `DefaultMap`
15
22
  * - `Set`
16
23
  * - serializable Isaac API classes (such as `Color`)
@@ -21,10 +28,42 @@
21
28
  * properties. This means that the TypeScript compiler will not be able to validate that you are
22
29
  * passing in serializable data.)
23
30
  */
24
- export interface SaveData {
25
- persistent?: Record<string, unknown>;
26
- run?: Record<string, unknown>;
27
- level?: Record<string, unknown>;
31
+ export interface SaveData<Persistent = unknown, Run = unknown, Level = unknown> {
32
+ persistent?: Serializable<Persistent>;
33
+ run?: Serializable<Run>;
34
+ level?: Serializable<Level>;
28
35
  room?: Record<string, unknown>;
29
36
  }
37
+ /**
38
+ * A type that represents valid serializable data fed to the save data manager.
39
+ *
40
+ * Custom errors are thrown when an Isaac API class or a nested custom class is detected.
41
+ *
42
+ * The recursive nature of this type is based on the `Immutable` type:
43
+ * https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
44
+ */
45
+ declare type Serializable<T> = T extends SerializablePrimitive ? T : T extends SerializableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : SerializableObject<T>;
46
+ /**
47
+ * This is mostly copied from the `Serializable` type. The difference is that we want to disallow
48
+ * classes with methods.
49
+ */
50
+ declare type SerializableInsideArrayOrMap<T> = T extends SerializablePrimitive ? T : T extends SerializableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : T extends HasMethods<T> ? ErrorCustomClassNotSerializable : T extends Function ? FunctionIsNotSerializable : SerializableObject<T>;
51
+ declare type SerializablePrimitive = boolean | string | number | undefined | null;
52
+ declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
53
+ declare type SerializableReadonlyArray<T> = ReadonlyArray<SerializableInsideArrayOrMap<T>>;
54
+ declare type SerializableMap<K, V> = Map<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
55
+ declare type SerializableReadonlyMap<K, V> = ReadonlyMap<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
56
+ declare type SerializableSet<T> = Set<SerializableInsideArrayOrMap<T>>;
57
+ declare type SerializableReadonlySet<T> = ReadonlySet<SerializableInsideArrayOrMap<T>>;
58
+ declare type SerializableObject<T> = {
59
+ [K in keyof T]: Serializable<T[K]>;
60
+ };
61
+ declare type SerializableIsaacAPIClass = Color | KColor | RNG | Vector;
62
+ declare type HasMethods<T> = {} extends {
63
+ [K in keyof T as T[K] extends Function ? K : never]-?: 1;
64
+ } ? never : T;
65
+ declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
66
+ declare type ErrorIsaacAPIClassIsNotSerializable = "Error: Isaac API classes (such as e.g. `Entity` or `RoomConfig`) are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#isaac-api-classes-are-not-serializable";
67
+ declare type ErrorCustomClassNotSerializable = "Error: Custom classes with one or more methods are not serializable when inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#custom-classes-are-not-serializable";
68
+ export {};
30
69
  //# sourceMappingURL=SaveData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveData.d.ts","sourceRoot":"","sources":["../../src/interfaces/SaveData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM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