isaacscript-common 14.0.0 → 14.1.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 (556) hide show
  1. package/dist/index.d.ts +1111 -83
  2. package/dist/isaacscript-common.lua +9948 -7327
  3. package/dist/src/callbacks/customRevive.lua +10 -1
  4. package/dist/src/callbacks/postDoorRender.lua +2 -2
  5. package/dist/src/callbacks/postEffectStateChanged.lua +3 -3
  6. package/dist/src/callbacks/postFamiliarStateChanged.lua +3 -3
  7. package/dist/src/callbacks/postFlip.lua +1 -1
  8. package/dist/src/callbacks/postGridEntity.lua +2 -2
  9. package/dist/src/callbacks/postNPCStateChanged.lua +3 -3
  10. package/dist/src/callbacks/postPickupStateChanged.lua +3 -3
  11. package/dist/src/callbacks/postPlayerCollectible.d.ts.map +1 -1
  12. package/dist/src/callbacks/postPlayerCollectible.lua +5 -9
  13. package/dist/src/callbacks/reorderedCallbacks.lua +7 -7
  14. package/dist/src/callbacks/subscriptions/postGridEntityBroken.d.ts +1 -1
  15. package/dist/src/callbacks/subscriptions/postGridEntityBroken.d.ts.map +1 -1
  16. package/dist/src/callbacks/subscriptions/postGridEntityBroken.lua +3 -3
  17. package/dist/src/callbacks/subscriptions/postGridEntityInit.d.ts +1 -1
  18. package/dist/src/callbacks/subscriptions/postGridEntityInit.d.ts.map +1 -1
  19. package/dist/src/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  20. package/dist/src/callbacks/subscriptions/postGridEntityRemove.d.ts +3 -3
  21. package/dist/src/callbacks/subscriptions/postGridEntityRemove.d.ts.map +1 -1
  22. package/dist/src/callbacks/subscriptions/postGridEntityRemove.lua +4 -4
  23. package/dist/src/callbacks/subscriptions/postGridEntityRender.d.ts +1 -1
  24. package/dist/src/callbacks/subscriptions/postGridEntityRender.d.ts.map +1 -1
  25. package/dist/src/callbacks/subscriptions/postGridEntityRender.lua +3 -3
  26. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.d.ts +1 -1
  27. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.d.ts.map +1 -1
  28. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.lua +3 -3
  29. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.d.ts +1 -1
  30. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.d.ts.map +1 -1
  31. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  32. package/dist/src/callbacks/subscriptions/postRockRender.d.ts +1 -1
  33. package/dist/src/callbacks/subscriptions/postRockRender.d.ts.map +1 -1
  34. package/dist/src/callbacks/subscriptions/postRockRender.lua +3 -3
  35. package/dist/src/callbacks/subscriptions/postRockUpdate.d.ts +1 -1
  36. package/dist/src/callbacks/subscriptions/postRockUpdate.d.ts.map +1 -1
  37. package/dist/src/callbacks/subscriptions/postRockUpdate.lua +3 -3
  38. package/dist/src/callbacks/subscriptions/postSpikesRender.d.ts +1 -1
  39. package/dist/src/callbacks/subscriptions/postSpikesRender.d.ts.map +1 -1
  40. package/dist/src/callbacks/subscriptions/postSpikesRender.lua +3 -3
  41. package/dist/src/callbacks/subscriptions/postSpikesUpdate.d.ts +1 -1
  42. package/dist/src/callbacks/subscriptions/postSpikesUpdate.d.ts.map +1 -1
  43. package/dist/src/callbacks/subscriptions/postSpikesUpdate.lua +3 -3
  44. package/dist/src/callbacks/subscriptions/postTNTRender.d.ts +1 -1
  45. package/dist/src/callbacks/subscriptions/postTNTRender.d.ts.map +1 -1
  46. package/dist/src/callbacks/subscriptions/postTNTRender.lua +3 -3
  47. package/dist/src/callbacks/subscriptions/postTNTUpdate.d.ts +1 -1
  48. package/dist/src/callbacks/subscriptions/postTNTUpdate.d.ts.map +1 -1
  49. package/dist/src/callbacks/subscriptions/postTNTUpdate.lua +3 -3
  50. package/dist/src/callbacks.d.ts +106 -0
  51. package/dist/src/callbacks.d.ts.map +1 -0
  52. package/dist/src/callbacks.lua +176 -0
  53. package/dist/src/classes/DefaultMap.d.ts.map +1 -1
  54. package/dist/src/classes/ModFeature.d.ts +11 -0
  55. package/dist/src/classes/ModFeature.d.ts.map +1 -0
  56. package/dist/src/classes/ModFeature.lua +13 -0
  57. package/dist/src/classes/ModUpgraded.d.ts +41 -7
  58. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  59. package/dist/src/classes/ModUpgraded.lua +75 -60
  60. package/dist/src/classes/callbacks/PostAmbushFinished.d.ts +1 -1
  61. package/dist/src/classes/callbacks/PostAmbushFinished.d.ts.map +1 -1
  62. package/dist/src/classes/callbacks/PostAmbushFinished.lua +1 -1
  63. package/dist/src/classes/callbacks/PostAmbushStarted.d.ts +1 -1
  64. package/dist/src/classes/callbacks/PostAmbushStarted.d.ts.map +1 -1
  65. package/dist/src/classes/callbacks/PostAmbushStarted.lua +1 -1
  66. package/dist/src/classes/callbacks/PostBombExploded.d.ts +1 -1
  67. package/dist/src/classes/callbacks/PostBombExploded.d.ts.map +1 -1
  68. package/dist/src/classes/callbacks/PostBombExploded.lua +1 -1
  69. package/dist/src/classes/callbacks/PostBombInitLate.d.ts +1 -1
  70. package/dist/src/classes/callbacks/PostBombInitLate.d.ts.map +1 -1
  71. package/dist/src/classes/callbacks/PostBombInitLate.lua +1 -1
  72. package/dist/src/classes/callbacks/PostBoneSwing.d.ts +3 -4
  73. package/dist/src/classes/callbacks/PostBoneSwing.d.ts.map +1 -1
  74. package/dist/src/classes/callbacks/PostBoneSwing.lua +1 -1
  75. package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts +3 -3
  76. package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
  77. package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +1 -1
  78. package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts +1 -1
  79. package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -1
  80. package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +1 -1
  81. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts +5 -6
  82. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
  83. package/dist/src/classes/callbacks/PostCursedTeleport.lua +1 -1
  84. package/dist/src/classes/callbacks/PostCustomRevive.d.ts +6 -0
  85. package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -0
  86. package/dist/src/classes/callbacks/PostCustomRevive.lua +17 -0
  87. package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts +15 -0
  88. package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -0
  89. package/dist/src/classes/callbacks/PostDiceRoomActivated.lua +44 -0
  90. package/dist/src/classes/callbacks/PostDoorRender.d.ts +7 -0
  91. package/dist/src/classes/callbacks/PostDoorRender.d.ts.map +1 -0
  92. package/dist/src/classes/callbacks/PostDoorRender.lua +24 -0
  93. package/dist/src/classes/callbacks/PostDoorUpdate.d.ts +7 -0
  94. package/dist/src/classes/callbacks/PostDoorUpdate.d.ts.map +1 -0
  95. package/dist/src/classes/callbacks/PostDoorUpdate.lua +24 -0
  96. package/dist/src/classes/callbacks/PostEffectInitLate.d.ts +12 -0
  97. package/dist/src/classes/callbacks/PostEffectInitLate.d.ts.map +1 -0
  98. package/dist/src/classes/callbacks/PostEffectInitLate.lua +27 -0
  99. package/dist/src/classes/callbacks/PostEffectStateChanged.d.ts +13 -0
  100. package/dist/src/classes/callbacks/PostEffectStateChanged.d.ts.map +1 -0
  101. package/dist/src/classes/callbacks/PostEffectStateChanged.lua +33 -0
  102. package/dist/src/classes/callbacks/PostEsauJr.d.ts +6 -0
  103. package/dist/src/classes/callbacks/PostEsauJr.d.ts.map +1 -0
  104. package/dist/src/classes/callbacks/PostEsauJr.lua +17 -0
  105. package/dist/src/classes/callbacks/PostFamiliarInitLate.d.ts +12 -0
  106. package/dist/src/classes/callbacks/PostFamiliarInitLate.d.ts.map +1 -0
  107. package/dist/src/classes/callbacks/PostFamiliarInitLate.lua +27 -0
  108. package/dist/src/classes/callbacks/PostFamiliarStateChanged.d.ts +13 -0
  109. package/dist/src/classes/callbacks/PostFamiliarStateChanged.d.ts.map +1 -0
  110. package/dist/src/classes/callbacks/PostFamiliarStateChanged.lua +33 -0
  111. package/dist/src/classes/callbacks/PostFirstEsauJr.d.ts +6 -0
  112. package/dist/src/classes/callbacks/PostFirstEsauJr.d.ts.map +1 -0
  113. package/dist/src/classes/callbacks/PostFirstEsauJr.lua +17 -0
  114. package/dist/src/classes/callbacks/PostFirstFlip.d.ts +6 -0
  115. package/dist/src/classes/callbacks/PostFirstFlip.d.ts.map +1 -0
  116. package/dist/src/classes/callbacks/PostFirstFlip.lua +17 -0
  117. package/dist/src/classes/callbacks/PostFlip.d.ts +6 -0
  118. package/dist/src/classes/callbacks/PostFlip.d.ts.map +1 -0
  119. package/dist/src/classes/callbacks/PostFlip.lua +17 -0
  120. package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts +6 -0
  121. package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts.map +1 -0
  122. package/dist/src/classes/callbacks/PostGameStartedReordered.lua +17 -0
  123. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts +6 -0
  124. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts.map +1 -0
  125. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.lua +17 -0
  126. package/dist/src/classes/callbacks/PostGreedModeWave.d.ts +12 -0
  127. package/dist/src/classes/callbacks/PostGreedModeWave.d.ts.map +1 -0
  128. package/dist/src/classes/callbacks/PostGreedModeWave.lua +34 -0
  129. package/dist/src/classes/callbacks/PostGridEntityBroken.d.ts +6 -0
  130. package/dist/src/classes/callbacks/PostGridEntityBroken.d.ts.map +1 -0
  131. package/dist/src/classes/callbacks/PostGridEntityBroken.lua +17 -0
  132. package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts +9 -0
  133. package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -0
  134. package/dist/src/classes/callbacks/PostGridEntityCollision.lua +36 -0
  135. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.d.ts +6 -0
  136. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.d.ts.map +1 -0
  137. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.lua +17 -0
  138. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts +9 -0
  139. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -0
  140. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.lua +31 -0
  141. package/dist/src/classes/callbacks/PostGridEntityCustomInit.d.ts +6 -0
  142. package/dist/src/classes/callbacks/PostGridEntityCustomInit.d.ts.map +1 -0
  143. package/dist/src/classes/callbacks/PostGridEntityCustomInit.lua +17 -0
  144. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts +9 -0
  145. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts.map +1 -0
  146. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.lua +25 -0
  147. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.d.ts +6 -0
  148. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.d.ts.map +1 -0
  149. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.lua +17 -0
  150. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.d.ts +6 -0
  151. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.d.ts.map +1 -0
  152. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.lua +17 -0
  153. package/dist/src/classes/callbacks/PostGridEntityInit.d.ts +6 -0
  154. package/dist/src/classes/callbacks/PostGridEntityInit.d.ts.map +1 -0
  155. package/dist/src/classes/callbacks/PostGridEntityInit.lua +17 -0
  156. package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts +9 -0
  157. package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts.map +1 -0
  158. package/dist/src/classes/callbacks/PostGridEntityRemove.lua +28 -0
  159. package/dist/src/classes/callbacks/PostGridEntityStateChanged.d.ts +6 -0
  160. package/dist/src/classes/callbacks/PostGridEntityStateChanged.d.ts.map +1 -0
  161. package/dist/src/classes/callbacks/PostGridEntityStateChanged.lua +17 -0
  162. package/dist/src/classes/callbacks/PostGridEntityUpdate.d.ts +6 -0
  163. package/dist/src/classes/callbacks/PostGridEntityUpdate.d.ts.map +1 -0
  164. package/dist/src/classes/callbacks/PostGridEntityUpdate.lua +17 -0
  165. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts +14 -0
  166. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -0
  167. package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +35 -0
  168. package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts +1 -1
  169. package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts.map +1 -1
  170. package/dist/src/classes/callbacks/PostKnifeInitLate.lua +1 -1
  171. package/dist/src/classes/callbacks/PostNewLevelReordered.d.ts +6 -0
  172. package/dist/src/classes/callbacks/PostNewLevelReordered.d.ts.map +1 -0
  173. package/dist/src/classes/callbacks/PostNewLevelReordered.lua +17 -0
  174. package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts +6 -7
  175. package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts.map +1 -1
  176. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +1 -1
  177. package/dist/src/classes/callbacks/PostNewRoomReordered.d.ts +6 -0
  178. package/dist/src/classes/callbacks/PostNewRoomReordered.d.ts.map +1 -0
  179. package/dist/src/classes/callbacks/PostNewRoomReordered.lua +17 -0
  180. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.d.ts +6 -0
  181. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.d.ts.map +1 -0
  182. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.lua +17 -0
  183. package/dist/src/classes/callbacks/PostPitRender.d.ts +1 -1
  184. package/dist/src/classes/callbacks/PostPitRender.d.ts.map +1 -1
  185. package/dist/src/classes/callbacks/PostPitRender.lua +1 -1
  186. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts +15 -0
  187. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -0
  188. package/dist/src/classes/callbacks/PostPlayerFatalDamage.lua +87 -0
  189. package/dist/src/classes/callbacks/PostPlayerRenderReordered.d.ts +6 -0
  190. package/dist/src/classes/callbacks/PostPlayerRenderReordered.d.ts.map +1 -0
  191. package/dist/src/classes/callbacks/PostPlayerRenderReordered.lua +17 -0
  192. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.d.ts +6 -0
  193. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.d.ts.map +1 -0
  194. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.lua +17 -0
  195. package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts +2 -2
  196. package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -1
  197. package/dist/src/classes/callbacks/PostRoomClearChanged.lua +1 -1
  198. package/dist/src/classes/callbacks/PostSpikesRender.d.ts +1 -1
  199. package/dist/src/classes/callbacks/PostSpikesRender.d.ts.map +1 -1
  200. package/dist/src/classes/callbacks/PostSpikesRender.lua +1 -1
  201. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts +7 -0
  202. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts.map +1 -0
  203. package/dist/src/classes/callbacks/PreBerserkDeath.lua +36 -0
  204. package/dist/src/classes/callbacks/PreCustomRevive.d.ts +6 -0
  205. package/dist/src/classes/callbacks/PreCustomRevive.d.ts.map +1 -0
  206. package/dist/src/classes/callbacks/PreCustomRevive.lua +17 -0
  207. package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts +3 -3
  208. package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts.map +1 -1
  209. package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts +2 -2
  210. package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts.map +1 -1
  211. package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts +2 -2
  212. package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts.map +1 -1
  213. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.d.ts +10 -0
  214. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.d.ts.map +1 -0
  215. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.lua +20 -0
  216. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.d.ts +11 -0
  217. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.d.ts.map +1 -0
  218. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.lua +19 -0
  219. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.d.ts +11 -0
  220. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.d.ts.map +1 -0
  221. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.lua +19 -0
  222. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.d.ts +11 -0
  223. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.d.ts.map +1 -0
  224. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.lua +24 -0
  225. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.d.ts +10 -0
  226. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.d.ts.map +1 -0
  227. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.lua +19 -0
  228. package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts +2 -2
  229. package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts.map +1 -1
  230. package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts +2 -2
  231. package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts.map +1 -1
  232. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +4 -4
  233. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -1
  234. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts +11 -0
  235. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts.map +1 -0
  236. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.lua +19 -0
  237. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts +2 -2
  238. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts.map +1 -1
  239. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +134 -0
  240. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -0
  241. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +220 -0
  242. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +39 -0
  243. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -0
  244. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +140 -0
  245. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts +19 -0
  246. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -0
  247. package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +52 -0
  248. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts +16 -0
  249. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -0
  250. package/dist/src/classes/features/callbackLogic/FlipDetection.lua +58 -0
  251. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +27 -0
  252. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -0
  253. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +108 -0
  254. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts +19 -0
  255. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -0
  256. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +69 -0
  257. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts +46 -0
  258. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts.map +1 -0
  259. package/dist/src/classes/features/callbackLogic/GridEntityDetection.lua +126 -0
  260. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts +24 -0
  261. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -0
  262. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.lua +72 -0
  263. package/dist/src/classes/features/other/RunInNFrames.d.ts +123 -0
  264. package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -0
  265. package/dist/src/classes/features/other/RunInNFrames.lua +109 -0
  266. package/dist/src/classes/private/CustomCallback.d.ts +5 -11
  267. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
  268. package/dist/src/classes/private/CustomCallback.lua +27 -17
  269. package/dist/src/classes/private/Feature.d.ts +19 -0
  270. package/dist/src/classes/private/Feature.d.ts.map +1 -0
  271. package/dist/src/classes/private/Feature.lua +16 -0
  272. package/dist/src/core/upgradeMod.d.ts +18 -1
  273. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  274. package/dist/src/core/upgradeMod.lua +41 -22
  275. package/dist/src/decorators.d.ts +9 -0
  276. package/dist/src/decorators.d.ts.map +1 -0
  277. package/dist/src/decorators.lua +12 -0
  278. package/dist/src/enums/ISCFeature.d.ts +12 -0
  279. package/dist/src/enums/ISCFeature.d.ts.map +1 -0
  280. package/dist/src/enums/ISCFeature.lua +12 -0
  281. package/dist/src/enums/ModCallbackCustom2.d.ts +41 -5
  282. package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -1
  283. package/dist/src/enums/ModCallbackCustom2.lua +77 -5
  284. package/dist/src/features/customGridEntity.d.ts.map +1 -1
  285. package/dist/src/features/customGridEntity.lua +6 -8
  286. package/dist/src/features/customTrapdoor/touched.lua +1 -1
  287. package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
  288. package/dist/src/features/deployJSONRoom.lua +6 -8
  289. package/dist/src/features/saveDataManager/constants.d.ts +1 -1
  290. package/dist/src/features/saveDataManager/constants.d.ts.map +1 -1
  291. package/dist/src/features/saveDataManager/exports.d.ts +5 -0
  292. package/dist/src/features/saveDataManager/exports.d.ts.map +1 -1
  293. package/dist/src/features/saveDataManager/exports.lua +16 -0
  294. package/dist/src/features/saveDataManager/main.d.ts +5 -2
  295. package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
  296. package/dist/src/features/saveDataManager/save.lua +2 -3
  297. package/dist/src/features.d.ts +34 -0
  298. package/dist/src/features.d.ts.map +1 -0
  299. package/dist/src/features.lua +68 -0
  300. package/dist/src/functions/characters.lua +3 -3
  301. package/dist/src/functions/charge.d.ts +30 -8
  302. package/dist/src/functions/charge.d.ts.map +1 -1
  303. package/dist/src/functions/charge.lua +38 -2
  304. package/dist/src/functions/chargeBar.d.ts +6 -0
  305. package/dist/src/functions/chargeBar.d.ts.map +1 -1
  306. package/dist/src/functions/chargeBar.lua +6 -0
  307. package/dist/src/functions/decorators.d.ts +19 -0
  308. package/dist/src/functions/decorators.d.ts.map +1 -0
  309. package/dist/src/functions/decorators.lua +32 -0
  310. package/dist/src/functions/flying.lua +4 -4
  311. package/dist/src/functions/gridEntities.lua +5 -5
  312. package/dist/src/functions/gridEntitiesSpecific.lua +12 -12
  313. package/dist/src/functions/itemPool.lua +2 -2
  314. package/dist/src/functions/playerHealth.lua +6 -6
  315. package/dist/src/functions/playerIndex.lua +2 -2
  316. package/dist/src/functions/players.d.ts +14 -3
  317. package/dist/src/functions/players.d.ts.map +1 -1
  318. package/dist/src/functions/players.lua +35 -16
  319. package/dist/src/functions/pocketItems.lua +1 -1
  320. package/dist/src/functions/rooms.d.ts +1 -1
  321. package/dist/src/functions/rooms.d.ts.map +1 -1
  322. package/dist/src/functions/rooms.lua +1 -1
  323. package/dist/src/functions/run.d.ts +5 -0
  324. package/dist/src/functions/run.d.ts.map +1 -1
  325. package/dist/src/functions/run.lua +6 -0
  326. package/dist/src/functions/table.d.ts +2 -0
  327. package/dist/src/functions/table.d.ts.map +1 -1
  328. package/dist/src/functions/table.lua +7 -0
  329. package/dist/src/functions/trinkets.lua +1 -1
  330. package/dist/src/functions/tstlClass.d.ts +21 -9
  331. package/dist/src/functions/tstlClass.d.ts.map +1 -1
  332. package/dist/src/functions/tstlClass.lua +49 -24
  333. package/dist/src/functions/utils.d.ts +37 -0
  334. package/dist/src/functions/utils.d.ts.map +1 -1
  335. package/dist/src/functions/utils.lua +36 -0
  336. package/dist/src/index.d.ts +12 -1
  337. package/dist/src/index.d.ts.map +1 -1
  338. package/dist/src/index.lua +17 -1
  339. package/dist/src/interfaces/SaveData.d.ts.map +1 -1
  340. package/dist/src/interfaces/{private/TSTLClassMetatable.d.ts → TSTLClassMetatable.d.ts} +0 -0
  341. package/dist/src/interfaces/TSTLClassMetatable.d.ts.map +1 -0
  342. package/dist/src/interfaces/{private/TSTLClassMetatable.lua → TSTLClassMetatable.lua} +0 -0
  343. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
  344. package/dist/src/interfaces/private/AddCallbackParametersCustom.lua +3 -0
  345. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +148 -2
  346. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -1
  347. package/dist/src/interfaces/private/AddCallbackParametersCustom2.lua +3 -0
  348. package/dist/src/maps/characterNameToTypeMap.lua +12 -12
  349. package/dist/src/objects/characterDamageMultipliers.lua +6 -6
  350. package/dist/src/objects/characterNames.lua +6 -6
  351. package/dist/src/objects/playerNamePNGFileNames.lua +6 -6
  352. package/dist/src/objects/playerPortraitPNGFileNames.lua +6 -6
  353. package/dist/src/sets/charactersThatStartWithAnActiveItemSet.lua +1 -1
  354. package/dist/src/sets/charactersWithFreeDevilDealsSet.d.ts.map +1 -1
  355. package/dist/src/sets/charactersWithFreeDevilDealsSet.lua +1 -1
  356. package/dist/src/sets/charactersWithNoRedHeartsSet.lua +3 -3
  357. package/dist/src/sets/charactersWithNoSoulHeartsSet.lua +2 -2
  358. package/dist/src/sets/lostStyleCharactersSet.lua +4 -4
  359. package/dist/src/types/AllButFirst.d.ts +5 -0
  360. package/dist/src/types/AllButFirst.d.ts.map +1 -0
  361. package/dist/src/types/AllButFirst.lua +2 -0
  362. package/dist/src/types/AllButLast.d.ts +2 -0
  363. package/dist/src/types/AllButLast.d.ts.map +1 -0
  364. package/dist/src/types/AllButLast.lua +2 -0
  365. package/dist/src/types/Constructor.d.ts +2 -0
  366. package/dist/src/types/Constructor.d.ts.map +1 -0
  367. package/dist/src/types/Constructor.lua +2 -0
  368. package/dist/src/types/FunctionTuple.d.ts +5 -0
  369. package/dist/src/types/FunctionTuple.d.ts.map +1 -0
  370. package/dist/src/types/FunctionTuple.lua +2 -0
  371. package/dist/src/types/HasAllEnumKeys.d.ts +26 -0
  372. package/dist/src/types/HasAllEnumKeys.d.ts.map +1 -0
  373. package/dist/src/types/HasAllEnumKeys.lua +2 -0
  374. package/dist/src/types/LowercaseKeys.d.ts +3 -0
  375. package/dist/src/types/LowercaseKeys.d.ts.map +1 -0
  376. package/dist/src/types/LowercaseKeys.lua +2 -0
  377. package/dist/src/types/StartsWithLowercase.d.ts +2 -0
  378. package/dist/src/types/StartsWithLowercase.d.ts.map +1 -0
  379. package/dist/src/types/StartsWithLowercase.lua +2 -0
  380. package/dist/src/types/StartsWithUppercase.d.ts +2 -0
  381. package/dist/src/types/StartsWithUppercase.d.ts.map +1 -0
  382. package/dist/src/types/StartsWithUppercase.lua +2 -0
  383. package/dist/src/types/UnionToIntersection.d.ts +3 -0
  384. package/dist/src/types/UnionToIntersection.d.ts.map +1 -0
  385. package/dist/src/types/UnionToIntersection.lua +2 -0
  386. package/dist/src/types/UppercaseKeys.d.ts +3 -0
  387. package/dist/src/types/UppercaseKeys.d.ts.map +1 -0
  388. package/dist/src/types/UppercaseKeys.lua +2 -0
  389. package/dist/src/types/private/CallbackTuple.d.ts +4 -4
  390. package/dist/src/types/private/CallbackTuple.d.ts.map +1 -1
  391. package/dist/src/types/private/MatchingCallbackCustom.d.ts +3 -1
  392. package/dist/src/types/private/MatchingCallbackCustom.d.ts.map +1 -1
  393. package/package.json +2 -2
  394. package/src/callbacks/customRevive.ts +13 -1
  395. package/src/callbacks/postDoorRender.ts +2 -2
  396. package/src/callbacks/postEffectStateChanged.ts +3 -6
  397. package/src/callbacks/postFamiliarStateChanged.ts +3 -3
  398. package/src/callbacks/postFlip.ts +2 -2
  399. package/src/callbacks/postGridEntity.ts +3 -7
  400. package/src/callbacks/postNPCStateChanged.ts +3 -3
  401. package/src/callbacks/postPickupStateChanged.ts +3 -6
  402. package/src/callbacks/postPlayerCollectible.ts +8 -12
  403. package/src/callbacks/reorderedCallbacks.ts +6 -6
  404. package/src/callbacks/subscriptions/postGridEntityBroken.ts +4 -7
  405. package/src/callbacks/subscriptions/postGridEntityCollision.ts +4 -4
  406. package/src/callbacks/subscriptions/postGridEntityInit.ts +4 -7
  407. package/src/callbacks/subscriptions/postGridEntityRemove.ts +10 -9
  408. package/src/callbacks/subscriptions/postGridEntityRender.ts +4 -7
  409. package/src/callbacks/subscriptions/postGridEntityStateChanged.ts +4 -7
  410. package/src/callbacks/subscriptions/postGridEntityUpdate.ts +4 -7
  411. package/src/callbacks/subscriptions/postRockRender.ts +6 -7
  412. package/src/callbacks/subscriptions/postRockUpdate.ts +6 -7
  413. package/src/callbacks/subscriptions/postSpikesRender.ts +4 -7
  414. package/src/callbacks/subscriptions/postSpikesUpdate.ts +4 -7
  415. package/src/callbacks/subscriptions/postTNTRender.ts +4 -7
  416. package/src/callbacks/subscriptions/postTNTUpdate.ts +4 -7
  417. package/src/callbacks.ts +134 -0
  418. package/src/classes/DefaultMap.ts +3 -3
  419. package/src/classes/ModFeature.ts +14 -0
  420. package/src/classes/ModUpgraded.ts +150 -81
  421. package/src/classes/callbacks/PostAmbushFinished.ts +3 -3
  422. package/src/classes/callbacks/PostAmbushStarted.ts +3 -3
  423. package/src/classes/callbacks/PostBombExploded.ts +2 -2
  424. package/src/classes/callbacks/PostBombInitLate.ts +3 -3
  425. package/src/classes/callbacks/PostBoneSwing.ts +8 -5
  426. package/src/classes/callbacks/PostCollectibleEmpty.ts +5 -5
  427. package/src/classes/callbacks/PostCollectibleInitFirst.ts +3 -3
  428. package/src/classes/callbacks/PostCursedTeleport.ts +10 -7
  429. package/src/classes/callbacks/PostCustomRevive.ts +11 -0
  430. package/src/classes/callbacks/PostDiceRoomActivated.ts +68 -0
  431. package/src/classes/callbacks/PostDoorRender.ts +19 -0
  432. package/src/classes/callbacks/PostDoorUpdate.ts +19 -0
  433. package/src/classes/callbacks/PostEffectInitLate.ts +28 -0
  434. package/src/classes/callbacks/PostEffectStateChanged.ts +35 -0
  435. package/src/classes/callbacks/PostEsauJr.ts +11 -0
  436. package/src/classes/callbacks/PostFamiliarInitLate.ts +28 -0
  437. package/src/classes/callbacks/PostFamiliarStateChanged.ts +35 -0
  438. package/src/classes/callbacks/PostFirstEsauJr.ts +11 -0
  439. package/src/classes/callbacks/PostFirstFlip.ts +11 -0
  440. package/src/classes/callbacks/PostFlip.ts +11 -0
  441. package/src/classes/callbacks/PostGameStartedReordered.ts +11 -0
  442. package/src/classes/callbacks/PostGameStartedReorderedLast.ts +11 -0
  443. package/src/classes/callbacks/PostGreedModeWave.ts +37 -0
  444. package/src/classes/callbacks/PostGridEntityBroken.ts +11 -0
  445. package/src/classes/callbacks/PostGridEntityCollision.ts +65 -0
  446. package/src/classes/callbacks/PostGridEntityCustomBroken.ts +11 -0
  447. package/src/classes/callbacks/PostGridEntityCustomCollision.ts +53 -0
  448. package/src/classes/callbacks/PostGridEntityCustomInit.ts +11 -0
  449. package/src/classes/callbacks/PostGridEntityCustomRemove.ts +32 -0
  450. package/src/classes/callbacks/PostGridEntityCustomStateChanged.ts +11 -0
  451. package/src/classes/callbacks/PostGridEntityCustomUpdate.ts +11 -0
  452. package/src/classes/callbacks/PostGridEntityInit.ts +11 -0
  453. package/src/classes/callbacks/PostGridEntityRemove.ts +39 -0
  454. package/src/classes/callbacks/PostGridEntityStateChanged.ts +11 -0
  455. package/src/classes/callbacks/PostGridEntityUpdate.ts +11 -0
  456. package/src/classes/callbacks/PostHolyMantleRemoved.ts +45 -0
  457. package/src/classes/callbacks/PostKnifeInitLate.ts +3 -3
  458. package/src/classes/callbacks/PostNewLevelReordered.ts +11 -0
  459. package/src/classes/callbacks/PostNewRoomEarly.ts +7 -7
  460. package/src/classes/callbacks/PostNewRoomReordered.ts +11 -0
  461. package/src/classes/callbacks/PostPEffectUpdateReordered.ts +11 -0
  462. package/src/classes/callbacks/PostPitRender.ts +2 -2
  463. package/src/classes/callbacks/PostPlayerFatalDamage.ts +127 -0
  464. package/src/classes/callbacks/PostPlayerRenderReordered.ts +11 -0
  465. package/src/classes/callbacks/PostPlayerUpdateReordered.ts +11 -0
  466. package/src/classes/callbacks/PostRoomClearChanged.ts +4 -4
  467. package/src/classes/callbacks/PostSpikesRender.ts +2 -2
  468. package/src/classes/callbacks/PreBerserkDeath.ts +42 -0
  469. package/src/classes/callbacks/PreCustomRevive.ts +11 -0
  470. package/src/classes/callbacks/validation/CustomCallbackAmbush.ts +3 -3
  471. package/src/classes/callbacks/validation/CustomCallbackBomb.ts +2 -2
  472. package/src/classes/callbacks/validation/CustomCallbackCollectible.ts +2 -2
  473. package/src/classes/callbacks/validation/CustomCallbackDoor.ts +28 -0
  474. package/src/classes/callbacks/validation/CustomCallbackEffect.ts +29 -0
  475. package/src/classes/callbacks/validation/CustomCallbackFamiliar.ts +30 -0
  476. package/src/classes/callbacks/validation/CustomCallbackGridEntity.ts +42 -0
  477. package/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.ts +36 -0
  478. package/src/classes/callbacks/validation/CustomCallbackKnife.ts +2 -2
  479. package/src/classes/callbacks/validation/CustomCallbackPit.ts +2 -2
  480. package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +13 -3
  481. package/src/classes/callbacks/validation/CustomCallbackRevive.ts +27 -0
  482. package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +2 -2
  483. package/src/classes/features/callbackLogic/CustomGridEntities.ts +398 -0
  484. package/src/classes/features/callbackLogic/CustomRevive.ts +214 -0
  485. package/src/classes/features/callbackLogic/EsauJrDetection.ts +98 -0
  486. package/src/classes/features/callbackLogic/FlipDetection.ts +82 -0
  487. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +160 -0
  488. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +90 -0
  489. package/src/classes/features/callbackLogic/GridEntityDetection.ts +231 -0
  490. package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +126 -0
  491. package/src/classes/features/other/RunInNFrames.ts +256 -0
  492. package/src/classes/private/CustomCallback.ts +29 -26
  493. package/src/classes/private/Feature.ts +24 -0
  494. package/src/core/upgradeMod.ts +71 -25
  495. package/src/decorators.ts +13 -0
  496. package/src/enums/ISCFeature.ts +47 -0
  497. package/src/enums/ModCallbackCustom2.ts +40 -0
  498. package/src/features/customGridEntity.ts +3 -7
  499. package/src/features/customTrapdoor/touched.ts +1 -1
  500. package/src/features/deployJSONRoom.ts +3 -7
  501. package/src/features/extraConsoleCommands/listCommands.ts +1 -1
  502. package/src/features/saveDataManager/constants.ts +1 -1
  503. package/src/features/saveDataManager/exports.ts +27 -0
  504. package/src/features/saveDataManager/main.ts +4 -6
  505. package/src/features/saveDataManager/save.ts +2 -2
  506. package/src/features.ts +90 -0
  507. package/src/functions/characters.ts +3 -3
  508. package/src/functions/charge.ts +30 -8
  509. package/src/functions/chargeBar.ts +6 -0
  510. package/src/functions/decorators.ts +45 -0
  511. package/src/functions/flying.ts +4 -4
  512. package/src/functions/gridEntities.ts +5 -5
  513. package/src/functions/gridEntitiesSpecific.ts +12 -12
  514. package/src/functions/itemPool.ts +2 -2
  515. package/src/functions/playerHealth.ts +6 -6
  516. package/src/functions/playerIndex.ts +2 -2
  517. package/src/functions/players.ts +26 -7
  518. package/src/functions/pocketItems.ts +1 -1
  519. package/src/functions/rooms.ts +1 -1
  520. package/src/functions/run.ts +12 -0
  521. package/src/functions/table.ts +11 -0
  522. package/src/functions/trinkets.ts +1 -1
  523. package/src/functions/tstlClass.ts +48 -24
  524. package/src/functions/utils.ts +49 -0
  525. package/src/index.ts +12 -1
  526. package/src/interfaces/SaveData.ts +4 -2
  527. package/src/interfaces/{private/TSTLClassMetatable.ts → TSTLClassMetatable.ts} +0 -0
  528. package/src/interfaces/private/AddCallbackParametersCustom.ts +3 -0
  529. package/src/interfaces/private/AddCallbackParametersCustom2.ts +265 -1
  530. package/src/maps/characterNameToTypeMap.ts +12 -12
  531. package/src/objects/characterDamageMultipliers.ts +6 -6
  532. package/src/objects/characterNames.ts +6 -6
  533. package/src/objects/playerNamePNGFileNames.ts +6 -6
  534. package/src/objects/playerPortraitPNGFileNames.ts +6 -6
  535. package/src/sets/charactersThatStartWithAnActiveItemSet.ts +1 -1
  536. package/src/sets/charactersWithFreeDevilDealsSet.ts +1 -1
  537. package/src/sets/charactersWithNoRedHeartsSet.ts +3 -3
  538. package/src/sets/charactersWithNoSoulHeartsSet.ts +2 -2
  539. package/src/sets/lostStyleCharactersSet.ts +4 -4
  540. package/src/types/AllButFirst.ts +6 -0
  541. package/src/types/AllButLast.ts +3 -0
  542. package/src/types/Constructor.ts +2 -0
  543. package/src/types/FunctionTuple.ts +4 -0
  544. package/src/types/HasAllEnumKeys.ts +25 -0
  545. package/src/types/LowercaseKeys.ts +3 -0
  546. package/src/types/StartsWithLowercase.ts +3 -0
  547. package/src/types/StartsWithUppercase.ts +3 -0
  548. package/src/types/UnionToIntersection.ts +6 -0
  549. package/src/types/UppercaseKeys.ts +3 -0
  550. package/src/types/private/CallbackTuple.ts +4 -4
  551. package/src/types/private/MatchingCallbackCustom.ts +7 -1
  552. package/dist/src/enums/IsaacScriptCommonFeature.d.ts +0 -35
  553. package/dist/src/enums/IsaacScriptCommonFeature.d.ts.map +0 -1
  554. package/dist/src/enums/IsaacScriptCommonFeature.lua +0 -35
  555. package/dist/src/interfaces/private/TSTLClassMetatable.d.ts.map +0 -1
  556. package/src/enums/IsaacScriptCommonFeature.ts +0 -34
package/dist/index.d.ts CHANGED
@@ -208,22 +208,168 @@ declare interface AddCallbackParametersCustom2 {
208
208
  playerVariant?: PlayerVariant,
209
209
  character?: PlayerType
210
210
  ];
211
+ [ModCallbackCustom2.POST_CUSTOM_REVIVE]: [
212
+ callback: (player: EntityPlayer, revivalType: int) => void,
213
+ revivalType?: int
214
+ ];
215
+ [ModCallbackCustom2.POST_DICE_ROOM_ACTIVATED]: [
216
+ callback: (player: EntityPlayer, diceFloorSubType: DiceFloorSubType) => void,
217
+ diceFloorSubType?: DiceFloorSubType
218
+ ];
219
+ [ModCallbackCustom2.POST_DOOR_RENDER]: [
220
+ callback: (door: GridEntityDoor) => void,
221
+ doorVariant?: DoorVariant
222
+ ];
223
+ [ModCallbackCustom2.POST_DOOR_UPDATE]: [
224
+ callback: (door: GridEntityDoor) => void,
225
+ doorVariant?: DoorVariant
226
+ ];
227
+ [ModCallbackCustom2.POST_EFFECT_INIT_LATE]: [
228
+ callback: (effect: EntityEffect) => void,
229
+ effectVariant?: EffectVariant
230
+ ];
231
+ [ModCallbackCustom2.POST_EFFECT_STATE_CHANGED]: [
232
+ callback: (effect: EntityEffect, previousState: int, currentState: int) => void,
233
+ effectVariant?: EffectVariant
234
+ ];
235
+ [ModCallbackCustom2.POST_ESAU_JR]: [callback: (player: EntityPlayer) => void];
236
+ [ModCallbackCustom2.POST_FAMILIAR_INIT_LATE]: [
237
+ callback: (familiar: EntityFamiliar) => void,
238
+ familiarVariant?: FamiliarVariant
239
+ ];
240
+ [ModCallbackCustom2.POST_FAMILIAR_STATE_CHANGED]: [
241
+ callback: (familiar: EntityFamiliar, previousState: int, currentState: int) => void,
242
+ familiarVariant?: FamiliarVariant
243
+ ];
244
+ [ModCallbackCustom2.POST_FIRST_ESAU_JR]: [
245
+ callback: (player: EntityPlayer) => void
246
+ ];
247
+ [ModCallbackCustom2.POST_FIRST_FLIP]: [
248
+ callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
249
+ ];
250
+ [ModCallbackCustom2.POST_FLIP]: [
251
+ callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
252
+ ];
253
+ [ModCallbackCustom2.POST_GAME_STARTED_REORDERED]: [
254
+ callback: (isContinued: boolean) => void
255
+ ];
256
+ [ModCallbackCustom2.POST_GAME_STARTED_REORDERED_LAST]: [
257
+ callback: (isContinued: boolean) => void
258
+ ];
259
+ [ModCallbackCustom2.POST_GREED_MODE_WAVE]: [
260
+ callback: (oldWave: int, newWave: int) => void
261
+ ];
262
+ [ModCallbackCustom2.POST_GRID_ENTITY_BROKEN]: [
263
+ callback: (gridEntity: GridEntity) => void,
264
+ gridEntityType?: GridEntityType,
265
+ variant?: int
266
+ ];
267
+ [ModCallbackCustom2.POST_GRID_ENTITY_COLLISION]: [
268
+ callback: (gridEntity: GridEntity, entity: Entity) => void,
269
+ gridEntityType?: GridEntityType,
270
+ gridEntityVariant?: int,
271
+ entityType?: EntityType,
272
+ entityVariant?: int
273
+ ];
274
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_BROKEN]: [
275
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
276
+ gridEntityTypeCustom?: GridEntityType
277
+ ];
278
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION]: [
279
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
280
+ gridEntityTypeCustom?: GridEntityType,
281
+ entityType?: EntityType,
282
+ entityVariant?: int
283
+ ];
284
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_INIT]: [
285
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
286
+ gridEntityTypeCustom?: GridEntityType
287
+ ];
288
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE]: [
289
+ callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
290
+ gridEntityTypeCustom?: GridEntityType
291
+ ];
292
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: [
293
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
294
+ gridEntityTypeCustom?: GridEntityType
295
+ ];
296
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_UPDATE]: [
297
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
298
+ gridEntityTypeCustom?: GridEntityType
299
+ ];
300
+ [ModCallbackCustom2.POST_GRID_ENTITY_INIT]: [
301
+ callback: (gridEntity: GridEntity) => void,
302
+ gridEntityType?: GridEntityType,
303
+ variant?: int
304
+ ];
305
+ [ModCallbackCustom2.POST_GRID_ENTITY_REMOVE]: [
306
+ callback: (gridIndex: int, gridEntityType: GridEntityType, variant: int) => void,
307
+ gridEntityType?: GridEntityType,
308
+ variant?: int
309
+ ];
310
+ [ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED]: [
311
+ callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
312
+ gridEntityType?: GridEntityType,
313
+ variant?: int
314
+ ];
315
+ [ModCallbackCustom2.POST_GRID_ENTITY_UPDATE]: [
316
+ callback: (gridEntity: GridEntity) => void,
317
+ gridEntityType?: GridEntityType,
318
+ variant?: int
319
+ ];
320
+ [ModCallbackCustom2.POST_HOLY_MANTLE_REMOVED]: [
321
+ callback: (player: EntityPlayer, oldNumHolyMantles: int, newNumHolyMantles: int) => void,
322
+ playerVariant?: PlayerVariant,
323
+ character?: PlayerType
324
+ ];
325
+ [ModCallbackCustom2.POST_NEW_LEVEL_REORDERED]: [callback: () => void];
211
326
  [ModCallbackCustom2.POST_KNIFE_INIT_LATE]: [
212
327
  callback: (knife: EntityKnife) => void,
213
328
  knifeVariant?: KnifeVariant
214
329
  ];
215
330
  [ModCallbackCustom2.POST_NEW_ROOM_EARLY]: [callback: () => void];
331
+ [ModCallbackCustom2.POST_NEW_ROOM_REORDERED]: [callback: () => void];
332
+ [ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED]: [
333
+ callback: (player: EntityPlayer) => void,
334
+ playerVariant?: PlayerVariant,
335
+ character?: PlayerType
336
+ ];
216
337
  [ModCallbackCustom2.POST_PIT_RENDER]: [
217
338
  callback: (pit: GridEntityPit) => void,
218
339
  pitVariant?: PitVariant
219
340
  ];
341
+ [ModCallbackCustom2.POST_PLAYER_FATAL_DAMAGE]: [
342
+ callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined,
343
+ playerVariant?: PlayerVariant,
344
+ character?: PlayerType
345
+ ];
346
+ [ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED]: [
347
+ callback: (player: EntityPlayer) => void,
348
+ playerVariant?: PlayerVariant,
349
+ character?: PlayerType
350
+ ];
351
+ [ModCallbackCustom2.POST_PLAYER_UPDATE_REORDERED]: [
352
+ callback: (player: EntityPlayer) => void,
353
+ playerVariant?: PlayerVariant,
354
+ character?: PlayerType
355
+ ];
220
356
  [ModCallbackCustom2.POST_ROOM_CLEAR_CHANGED]: [
221
357
  callback: (roomClear: boolean) => void,
222
358
  roomClear?: boolean
223
359
  ];
224
360
  [ModCallbackCustom2.POST_SPIKES_RENDER]: [
225
361
  callback: (spikes: GridEntitySpikes) => void,
226
- gridEntityVariant?: int
362
+ variant?: int
363
+ ];
364
+ [ModCallbackCustom2.PRE_BERSERK_DEATH]: [
365
+ callback: (player: EntityPlayer) => void,
366
+ playerVariant?: PlayerVariant,
367
+ character?: PlayerType
368
+ ];
369
+ [ModCallbackCustom2.PRE_CUSTOM_REVIVE]: [
370
+ callback: (player: EntityPlayer) => int | undefined,
371
+ playerVariant?: PlayerVariant,
372
+ character?: PlayerType
227
373
  ];
228
374
  }
229
375
 
@@ -239,14 +385,14 @@ declare interface AddCallbackParametersCustom2 {
239
385
  * - AAA Battery
240
386
  *
241
387
  * @param player The player to grant the charges to.
242
- * @param activeSlot The slot to grant the charges to.
388
+ * @param activeSlot Optional. The slot to grant the charges to. Default is `ActiveSlot.PRIMARY`.
243
389
  * @param numCharges Optional. The amount of charges to grant. Default is 1.
244
390
  * @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
245
391
  * @returns The amount of charges that were actually granted. For example, if the active item was
246
392
  * only one away from a full charge, but the `numCharges` provided to this function was 2,
247
393
  * then this function would return 1.
248
394
  */
249
- export declare function addCharge(player: EntityPlayer, activeSlot: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
395
+ export declare function addCharge(player: EntityPlayer, activeSlot?: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
250
396
 
251
397
  export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
252
398
 
@@ -335,13 +481,14 @@ export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void
335
481
  * - Not charging active items with `chargetype="special"`
336
482
  *
337
483
  * @param player The player to grant the charges to.
338
- * @param activeSlot The active item slot to grant the charges to.
484
+ * @param activeSlot Optional. The active item slot to grant the charges to. Default is
485
+ * `ActiveSlot.PRIMARY`.
339
486
  * @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
340
487
  * room for the purposes of calculating how much charge to grant. Default
341
488
  * is true.
342
489
  * @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
343
490
  */
344
- export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot: ActiveSlot, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
491
+ export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot?: ActiveSlot, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
345
492
 
346
493
  /**
347
494
  * Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
@@ -386,6 +533,18 @@ export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
386
533
  readonly __displayFlagBrand: symbol;
387
534
  }>;
388
535
 
536
+ export declare type AllButFirst<T extends unknown[]> = T extends [
537
+ unknown,
538
+ ...infer Tail
539
+ ] ? Tail : unknown[];
540
+
541
+ declare type AllButFirst_2<T extends unknown[]> = T extends [
542
+ unknown,
543
+ ...infer Tail
544
+ ] ? Tail : unknown[];
545
+
546
+ export declare type AllButLast<T extends unknown[]> = T extends [...infer Head, unknown] ? Head : unknown[];
547
+
389
548
  /** This is used by the `POST_AMBUSH_STARTED` and `POST_AMBUSH_FINISHED` custom callbacks. */
390
549
  export declare enum AmbushType {
391
550
  CHALLENGE_ROOM = 0,
@@ -665,6 +824,37 @@ export declare function calculateStageType(stage: LevelStage): StageType;
665
824
  */
666
825
  export declare function calculateStageTypeRepentance(stage: LevelStage): StageType;
667
826
 
827
+ /**
828
+ * A decorator function that signifies that the decorated class method should be automatically
829
+ * registered with `Mod.AddCallback`.
830
+ */
831
+ export declare function Callback<T extends ModCallback>(modCallback: T, ...optionalArgs: AllButFirst<AddCallbackParameters[T]>): <Class extends ModFeature, Fn extends AddCallbackParameters[T][0]>(target: Class, propertyKey: string, _descriptor: TypedPropertyDescriptor<Fn>) => void;
832
+
833
+ /**
834
+ * A decorator function that signifies that the decorated class method should be automatically
835
+ * registered with `ModUpgraded.AddCallbackCustom`.
836
+ */
837
+ export declare function CallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, ...optionalArgs: AllButFirst<AddCallbackParametersCustom2[T]>): <Class extends {
838
+ mod: ModUpgraded;
839
+ }>(target: Class, propertyKey: string) => void;
840
+
841
+ declare type CallbackSignatureGridEntity = ((gridEntity: GridEntity) => void) | ((gridEntity: GridEntity, oldState: int, newState: int) => void);
842
+
843
+ declare type CallbackSignatureGridEntityCustom = ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void) | ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void);
844
+
845
+ declare type CallbackSignaturePlayer = ((player: EntityPlayer) => void) | ((player: EntityPlayer) => int | undefined) | ((player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined);
846
+
847
+ declare type CallbackSignatureRevive = (player: EntityPlayer, revivalType: int) => void;
848
+
849
+ /**
850
+ * A mapping of the callback enum to the associated callback functions (and optional arguments).
851
+ * This is so that the respective callback functions can be added/removed on demand as subscribers
852
+ * get added/removed.
853
+ */
854
+ declare type CallbackTuple = {
855
+ [K in ModCallback]: [K, AddCallbackParameters[K]];
856
+ }[ModCallback];
857
+
668
858
  /**
669
859
  * Helper function to see if the provided player can pick up an eternal heart. (If a player already
670
860
  * has an eternal heart and full heart containers, they are not able to pick up any additional
@@ -940,6 +1130,8 @@ export declare function combineArrays<T>(...arrays: Array<T[] | readonly T[]>):
940
1130
  */
941
1131
  export declare function combineSets<T>(...sets: Array<Set<T> | ReadonlySet<T>>): Set<T>;
942
1132
 
1133
+ export declare type Constructor = new (...args: any[]) => {};
1134
+
943
1135
  /**
944
1136
  * Helper function to get the enum name for the specified `Controller` value. Note that this will
945
1137
  * trim off the "BUTTON_" prefix.
@@ -1069,6 +1261,215 @@ export declare const CUSTOM_FLOOR_STAGE: LevelStage;
1069
1261
  */
1070
1262
  export declare const CUSTOM_FLOOR_STAGE_TYPE = StageType.WRATH_OF_THE_LAMB;
1071
1263
 
1264
+ /**
1265
+ * The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
1266
+ * extend from this class.
1267
+ */
1268
+ declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feature {
1269
+ private subscriptions;
1270
+ hasSubscriptions(): boolean;
1271
+ add(...args: AddCallbackParametersCustom2[T]): void;
1272
+ /**
1273
+ * If the submitted function does not match any of the existing subscriptions, this method will do
1274
+ * nothing.
1275
+ */
1276
+ remove(callback: AddCallbackParametersCustom2[T][0]): void;
1277
+ fire: (...fireArgs: FireArgs<T>) => ReturnType<AddCallbackParametersCustom2[T][0]>;
1278
+ /**
1279
+ * This method needs to be overwritten for any callback that has optional filtration arguments.
1280
+ */
1281
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1282
+ }
1283
+
1284
+ declare class CustomCallbackGridEntity<T extends ModCallbackCustomGridEntity> extends CustomCallback<T> {
1285
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1286
+ }
1287
+
1288
+ declare class CustomCallbackGridEntityCustom<T extends ModCallbackCustomGridEntityCustom> extends CustomCallback<T> {
1289
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1290
+ }
1291
+
1292
+ declare class CustomCallbackPlayer<T extends ModCallbackCustomPlayer> extends CustomCallback<T> {
1293
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1294
+ }
1295
+
1296
+ declare class CustomCallbackRevive<T extends ModCallbackCustomRevive> extends CustomCallback<T> {
1297
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1298
+ }
1299
+
1300
+ /**
1301
+ * A mapping of the custom callback enum to the associated callback functions (and optional
1302
+ * arguments). This is so that the respective callback functions can be added/removed on demand as
1303
+ * subscribers get added/removed.
1304
+ */
1305
+ declare type CustomCallbackTuple = {
1306
+ [K in ModCallbackCustom2]: [K, AddCallbackParametersCustom2[K]];
1307
+ }[ModCallbackCustom2];
1308
+
1309
+ declare class CustomGridEntities extends Feature {
1310
+ v: {
1311
+ level: {
1312
+ /** Indexed by room list index and grid index. */
1313
+ customGridEntities: DefaultMap<number, Map<number, GridEntityCustomData>, []>;
1314
+ };
1315
+ room: {
1316
+ genericPropPtrHashes: Set<PtrHash>;
1317
+ manuallyUsingShovel: boolean;
1318
+ };
1319
+ };
1320
+ private runInNFrames;
1321
+ constructor(runInNFrames: RunInNFrames);
1322
+ private preUseItemWeNeedToGoDeeper;
1323
+ private postNewRoomReordered;
1324
+ /**
1325
+ * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
1326
+ * will reappear if the player leaves and re-enters the room. (It will be manually respawned in
1327
+ * the `POST_NEW_ROOM` callback.)
1328
+ *
1329
+ * Custom grid entities are built on top of real grid entities. You can use any existing grid
1330
+ * entity type as a base. For example, if you want to create a custom rock that would be breakable
1331
+ * like a normal rock, then you should specify `GridEntityType.ROCK` as the base grid entity type.
1332
+ *
1333
+ * Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such
1334
+ * as `POST_GRID_ENTITY_CUSTOM_UPDATE`. Note that the "normal" grid entities callbacks will not
1335
+ * fire for custom entities. For example, if you had a custom grid entity based on
1336
+ * `GridEntityType.ROCK`, and you also had a subscription to the `POST_GRID_ENTITY_UPDATE`
1337
+ * callback, the callback would only fire for normal rocks and not the custom entity.
1338
+ *
1339
+ * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
1340
+ * custom grid entities.
1341
+ *
1342
+ * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
1343
+ * dime when destroyed:
1344
+ *
1345
+ * ```ts
1346
+ * // This is local to the mod and can safely overlap with the values of `GridEntityType`.
1347
+ * const GridEntityTypeCustom = {
1348
+ * SILVER_ROCK: 0 as GridEntityType,
1349
+ * } as const;
1350
+ *
1351
+ * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
1352
+ * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
1353
+ *
1354
+ * export function silverRockInit(mod: ModUpgraded): void {
1355
+ * mod.AddCallbackCustom(
1356
+ * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
1357
+ * postGridEntityCustomBrokenSilverRock,
1358
+ * GridEntityTypeCustom.SILVER_ROCK,
1359
+ * );
1360
+ * }
1361
+ *
1362
+ * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
1363
+ * spawnCoin(CoinSubType.DIME, gridEntity.Position);
1364
+ * }
1365
+ *
1366
+ * export function spawnSilverRock(mod: ModUpgraded, gridIndex: int): GridEntity {
1367
+ * return mod.spawnCustomGridEntity(
1368
+ * GridEntityTypeCustom.SILVER_ROCK,
1369
+ * gridIndex,
1370
+ * undefined,
1371
+ * SILVER_ROCK_ANM2_PATH,
1372
+ * undefined,
1373
+ * GridEntityType.ROCK,
1374
+ * );
1375
+ * }
1376
+ * ```
1377
+ *
1378
+ * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are
1379
+ * creating. It should correspond to a local enum value created in
1380
+ * your mod. The integer can be any unique value and will not
1381
+ * correspond to the actual grid entity type used. (This integer is
1382
+ * used in the various custom grid entity callbacks.)
1383
+ * @param gridIndexOrPosition The grid index or position in the room that you want to spawn the
1384
+ * grid entity at. If a position is specified, the closest grid index
1385
+ * will be used.
1386
+ * @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
1387
+ * have. If not specified, the grid collision class from the base grid
1388
+ * entity will be used.
1389
+ * @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified,
1390
+ * the normal sprite from the base grid entity will be used.
1391
+ * @param defaultAnimation Optional. The name of the animation to play after the sprite is
1392
+ * initialized and after the player re-enters a room with this grid entity
1393
+ * in it. If not specified, the default animation in the anm2 will be
1394
+ * used.
1395
+ * @param baseGridEntityType Optional. The type of the grid entity to use as a "base" for this
1396
+ * custom grid entity. Default is `GridEntityType.DECORATION`.
1397
+ * @param baseGridEntityVariant Optional. The variant of the grid entity to use as a "base" for
1398
+ * this custom grid entity. Default is 0.
1399
+ */
1400
+ spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass?: GridCollisionClass, anm2Path?: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
1401
+ /**
1402
+ * Helper function to remove a custom grid entity created by the `spawnCustomGrid` function.
1403
+ *
1404
+ * @param gridIndexOrPositionOrGridEntity You can specify the custom grid entity to remove by
1405
+ * providing the grid index, the room position, or the grid entity
1406
+ * itself.
1407
+ * @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
1408
+ * Default is true. This is generally a good idea because if the room is not
1409
+ * updated, you will be unable to spawn another grid entity on the same tile
1410
+ * until a frame has passed. However, doing this is expensive, since it involves
1411
+ * a call to `Isaac.GetRoomEntities`, so set it to false if you need to run this
1412
+ * function multiple times.
1413
+ * @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
1414
+ * given location or if the given grid entity was not a custom grid entity.
1415
+ */
1416
+ removeCustomGridEntity(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
1417
+ /**
1418
+ * Helper function to get the custom grid entities in the current room. Returns an array of tuples
1419
+ * containing the raw decoration grid entity and the associated entity data.
1420
+ */
1421
+ getCustomGridEntities(): Array<[
1422
+ gridEntity: GridEntity,
1423
+ data: GridEntityCustomData
1424
+ ]>;
1425
+ /**
1426
+ * Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
1427
+ * undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
1428
+ * entity on the provided grid index.
1429
+ */
1430
+ getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
1431
+ /**
1432
+ * Helper function to check if a `GridEntity` is a custom grid entity or if a grid index has a
1433
+ * custom grid entity.
1434
+ */
1435
+ isCustomGridEntity(gridEntityOrGridIndex: GridEntity | int): boolean;
1436
+ }
1437
+
1438
+ declare class CustomRevive extends Feature {
1439
+ v: {
1440
+ run: {
1441
+ state: CustomReviveState;
1442
+ revivalType: number | null;
1443
+ dyingPlayerIndex: PlayerIndex | null;
1444
+ };
1445
+ };
1446
+ private preCustomRevive;
1447
+ private postCustomRevive;
1448
+ constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive);
1449
+ private postRender;
1450
+ private postNewRoomReordered;
1451
+ private postPEffectUpdateReordered;
1452
+ private checkWaitingForItemAnimation;
1453
+ private postPlayerFatalDamage;
1454
+ private preBerserkDeath;
1455
+ /**
1456
+ * The player is about to die, which will immediately delete the save data for the run. To prevent
1457
+ * this from happening, we grant the 1-Up item.
1458
+ */
1459
+ private playerIsAboutToDie;
1460
+ private logStateChanged;
1461
+ }
1462
+
1463
+ declare enum CustomReviveState {
1464
+ DISABLED = 0,
1465
+ /**
1466
+ * We can't immediately jump to waiting for an item animation because it is possible for a player
1467
+ * to be holding an item above their head as they are dying (e.g. with Razor Blade).
1468
+ */
1469
+ WAITING_FOR_ROOM_TRANSITION = 1,
1470
+ WAITING_FOR_ITEM_ANIMATION = 2
1471
+ }
1472
+
1072
1473
  /**
1073
1474
  * An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
1074
1475
  * custom boss.
@@ -2199,6 +2600,21 @@ declare type ErrorCustomClassNotSerializable = "Error: Custom classes with one o
2199
2600
 
2200
2601
  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";
2201
2602
 
2603
+ declare class EsauJrDetection extends Feature {
2604
+ v: {
2605
+ run: {
2606
+ usedEsauJrFrame: number | null;
2607
+ usedEsauJrControllerIndex: ControllerIndex | null;
2608
+ usedEsauJrAtLeastOnce: boolean;
2609
+ };
2610
+ };
2611
+ private postEsauJr;
2612
+ private postFirstEsauJr;
2613
+ constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
2614
+ private postUpdate;
2615
+ private useItemEsauJr;
2616
+ }
2617
+
2202
2618
  /**
2203
2619
  * These are a collection of functions for non-TypeScript users so that they can access some of
2204
2620
  * useful methods offered on the `Array` class in the JavaScript standard library.
@@ -2222,6 +2638,22 @@ export declare function every<T>(array: T[], func: (value: T, index: number, arr
2222
2638
  */
2223
2639
  export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
2224
2640
 
2641
+ /**
2642
+ * The IsaacScript standard library contains many optional features, such as the ability to create
2643
+ * custom pickups. All features are optional and are only initialized when needed. This class
2644
+ * contains elements to facilitate that.
2645
+ *
2646
+ * Additionally, all custom callbacks extend from this class.
2647
+ */
2648
+ declare class Feature {
2649
+ initialized: boolean;
2650
+ v?: SaveData;
2651
+ featuresUsed?: ISCFeature[];
2652
+ callbacksUsed?: CallbackTuple[];
2653
+ customCallbacksUsed?: CustomCallbackTuple[];
2654
+ exportedMethods: string[];
2655
+ }
2656
+
2225
2657
  export declare function fillLevelWithRedRooms(): void;
2226
2658
 
2227
2659
  /**
@@ -2254,6 +2686,8 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
2254
2686
  */
2255
2687
  export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
2256
2688
 
2689
+ declare type FireArgs<T extends ModCallbackCustom2> = Parameters<AddCallbackParametersCustom2[T][0]>;
2690
+
2257
2691
  /**
2258
2692
  * Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
2259
2693
  *
@@ -2318,6 +2752,19 @@ export declare const FIRST_STAGE = LevelStage.BASEMENT_1;
2318
2752
  /** Equal to `TrinketType.SWALLOWED_PENNY`. */
2319
2753
  export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
2320
2754
 
2755
+ declare class FlipDetection extends Feature {
2756
+ v: {
2757
+ run: {
2758
+ /** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
2759
+ usedFlipAtLeastOnce: boolean;
2760
+ };
2761
+ };
2762
+ private postFlip;
2763
+ private postFirstFlip;
2764
+ constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
2765
+ private useItemFlip;
2766
+ }
2767
+
2321
2768
  /**
2322
2769
  * An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
2323
2770
  *
@@ -2371,6 +2818,11 @@ export declare function forgottenSwitch(): void;
2371
2818
 
2372
2819
  declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
2373
2820
 
2821
+ export declare type FunctionTuple = [
2822
+ name: string,
2823
+ func: (...args: unknown[]) => unknown
2824
+ ];
2825
+
2374
2826
  /**
2375
2827
  * A cached version of the class returned from the `Game()` constructor.
2376
2828
  *
@@ -2384,6 +2836,27 @@ export declare const game: Game;
2384
2836
  /** Game frames are what is returned by the `Game.GetFrameCount` method. */
2385
2837
  export declare const GAME_FRAMES_PER_SECOND = 30;
2386
2838
 
2839
+ declare class GameReorderedCallbacks extends Feature {
2840
+ private currentStage;
2841
+ private currentStageType;
2842
+ private usedGlowingHourGlass;
2843
+ private forceNewLevel;
2844
+ private forceNewRoom;
2845
+ private postGameStartedReordered;
2846
+ private postNewLevelReordered;
2847
+ private postNewRoomReordered;
2848
+ private postGameStartedReorderedLast;
2849
+ constructor(postGameStartedReordered: PostGameStartedReordered, postNewLevelReordered: PostNewLevelReordered, postNewRoomReordered: PostNewRoomReordered, postGameStartedReorderedLast: PostGameStartedReorderedLast);
2850
+ private useItemGlowingHourGlass;
2851
+ private postGameStarted;
2852
+ private postNewLevel;
2853
+ private postNewRoom;
2854
+ private recordCurrentStage;
2855
+ forceNewLevelCallback(): void;
2856
+ forceNewRoomCallback(): void;
2857
+ reorderedCallbacksSetStage(stage: LevelStage, stageType: StageType): void;
2858
+ }
2859
+
2387
2860
  /**
2388
2861
  * Helper function to find the active slot that the player has the corresponding collectible type
2389
2862
  * in. Returns undefined if the player does not have the collectible in any active slot.
@@ -2716,8 +3189,11 @@ export declare function getCharacters(): PlayerType[];
2716
3189
  * This function accounts for The Battery. For example, if the player has 2/6 charges on a D6, this
2717
3190
  * function will return 10 (because there are 4 charges remaining on the base charge and 6 charges
2718
3191
  * remaining on The Battery charge).
3192
+ *
3193
+ * @param player The player to get the charges from.
3194
+ * @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
2719
3195
  */
2720
- export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot: ActiveSlot): int;
3196
+ export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot?: ActiveSlot): int;
2721
3197
 
2722
3198
  /**
2723
3199
  * Helper function to get an array of equidistant points on the circumference around a circle.
@@ -4214,6 +4690,12 @@ export declare function getPlayerFromEntity(entity: Entity): EntityPlayer | unde
4214
4690
  */
4215
4691
  export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlayer | undefined;
4216
4692
 
4693
+ /**
4694
+ * Helper function to get an `EntityPlayer` object from an `EntityPtr`. Returns undefined if the
4695
+ * entity has gone out of scope or if the associated entity is not a player.
4696
+ */
4697
+ export declare function getPlayerFromPtr(entityPtr: EntityPtr): EntityPlayer | undefined;
4698
+
4217
4699
  /**
4218
4700
  * Helper function to get an object representing the player's health. You can use this in
4219
4701
  * combination with the `setPlayerHealth` function to restore the player's health back to a certain
@@ -5296,8 +5778,11 @@ export declare function getTopLeftWallGridIndex(): int;
5296
5778
  * Helper function to get the combined normal charge and the battery charge for the player's active
5297
5779
  * item. This is useful because you have to add these two values together when setting the active
5298
5780
  * charge.
5781
+ *
5782
+ * @param player The player to get the charges from.
5783
+ * @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
5299
5784
  */
5300
- export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveSlot): int;
5785
+ export declare function getTotalCharge(player: EntityPlayer, activeSlot?: ActiveSlot): int;
5301
5786
 
5302
5787
  /**
5303
5788
  * Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
@@ -5419,14 +5904,24 @@ export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): ReadonlyS
5419
5904
  export declare function getTrinketTypes(): TrinketType[];
5420
5905
 
5421
5906
  /**
5422
- * Helper function to get the name of a TypeScriptToLua class. TSTL classes are Lua tables created
5423
- * with the `__TS__Class` Lua function from the TSTL lualib. Their name is contained within
5424
- * "constructor.name" metatable key.
5907
+ * Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
5908
+ * located on the metatable.
5909
+ *
5910
+ * Returns undefined if passed a non-table or if the provided table does not have a metatable.
5911
+ */
5912
+ export declare function getTSTLClassConstructor(object: unknown): TSTLClassMetatable["constructor"] | undefined;
5913
+
5914
+ export declare function getTSTLClassMethods(object: unknown): FunctionTuple[];
5915
+
5916
+ /**
5917
+ * Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
5918
+ *
5919
+ * TSTL classes are Lua tables created with the `__TS__Class` Lua function from the TSTL lualib.
5920
+ * Their name is contained within "constructor.name" metatable key.
5425
5921
  *
5426
5922
  * For example, a `Map` class is has a name of "Map".
5427
5923
  *
5428
- * Returns undefined if the object is not a table or if the aforementioned metatable key does not
5429
- * exist.
5924
+ * Returns undefined if passed a non-table or if the provided table does not have a metatable.
5430
5925
  */
5431
5926
  export declare function getTSTLClassName(object: unknown): string | undefined;
5432
5927
 
@@ -5514,6 +6009,20 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
5514
6009
  */
5515
6010
  export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector;
5516
6011
 
6012
+ declare class GridEntityCollisionDetection extends Feature {
6013
+ v: {
6014
+ room: {
6015
+ /** Indexed by grid entity pointer hash. */
6016
+ collidingEntitiesMap: DefaultMap<PtrHash, Set<PtrHash>, []>;
6017
+ };
6018
+ };
6019
+ private postGridEntityCollision;
6020
+ private postGridEntityCustomCollision;
6021
+ private customGridEntities;
6022
+ constructor(postGridEntityCollision: PostGridEntityCollision, postGridEntityCustomCollision: PostGridEntityCustomCollision, customGridEntities: CustomGridEntities);
6023
+ private postUpdate;
6024
+ }
6025
+
5517
6026
  /**
5518
6027
  * This is meta-data that describes a custom grid entity.
5519
6028
  *
@@ -5533,6 +6042,39 @@ export declare interface GridEntityCustomData {
5533
6042
  defaultAnimation?: string;
5534
6043
  }
5535
6044
 
6045
+ declare class GridEntityDetection extends Feature {
6046
+ v: {
6047
+ room: {
6048
+ /** Indexed by grid index. */
6049
+ initializedGridEntities: Map<number, GridEntityTuple>;
6050
+ };
6051
+ };
6052
+ private postGridEntityInit;
6053
+ private postGridEntityCustomInit;
6054
+ private postGridEntityUpdate;
6055
+ private postGridEntityCustomUpdate;
6056
+ private postGridEntityRemove;
6057
+ private postGridEntityCustomRemove;
6058
+ private postGridEntityStateChanged;
6059
+ private postGridEntityCustomStateChanged;
6060
+ private postGridEntityBroken;
6061
+ private postGridEntityCustomBroken;
6062
+ private customGridEntities;
6063
+ constructor(postGridEntityInit: PostGridEntityInit, postGridEntityCustomInit: PostGridEntityCustomInit, postGridEntityUpdate: PostGridEntityUpdate, postGridEntityCustomUpdate: PostGridEntityCustomUpdate, postGridEntityRemove: PostGridEntityRemove, postGridEntityCustomRemove: PostGridEntityCustomRemove, postGridEntityStateChanged: PostGridEntityStateChanged, postGridEntityCustomStateChanged: PostGridEntityCustomStateChanged, postGridEntityBroken: PostGridEntityBroken, postGridEntityCustomBroken: PostGridEntityCustomBroken, customGridEntities: CustomGridEntities);
6064
+ private postUpdate;
6065
+ private checkGridEntitiesRemoved;
6066
+ private checkGridEntityStateChanged;
6067
+ private checkNewGridEntity;
6068
+ private updateTupleInMap;
6069
+ private postNewRoomReordered;
6070
+ }
6071
+
6072
+ declare type GridEntityTuple = [
6073
+ gridEntityType: GridEntityType,
6074
+ variant: int,
6075
+ state: int
6076
+ ];
6077
+
5536
6078
  /**
5537
6079
  * Helper function to convert a grid index to a grid position.
5538
6080
  *
@@ -5548,6 +6090,32 @@ export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomS
5548
6090
  */
5549
6091
  export declare function gridPositionToWorldPosition(gridPosition: Vector): Vector;
5550
6092
 
6093
+ /**
6094
+ * A helper type to ensure that an object contains a key for every enum member. Use this with `as
6095
+ * const` and `satisfies` to prevent narrowing the type of the object.
6096
+ *
6097
+ * For example:
6098
+ *
6099
+ * ```ts
6100
+ * enum MyEnum {
6101
+ * Value1,
6102
+ * Value2,
6103
+ * Value3,
6104
+ * }
6105
+ *
6106
+ * const MyEnumToString = {
6107
+ * [MyEnum.Value1]: "foo",
6108
+ * [MyEnum.Value2]: "bar",
6109
+ * [MyEnum.Value3]: "baz",
6110
+ * } as const satisfies HasAllEnumKeys<MyEnum>;
6111
+ *
6112
+ * const value = MyEnumToString[MyEnum.Value2];
6113
+ * ```
6114
+ */
6115
+ export declare type HasAllEnumKeys<T extends string | number> = {
6116
+ readonly [key in T]: unknown;
6117
+ };
6118
+
5551
6119
  /**
5552
6120
  * Helper function to see if a particular entity has armor. In this context, armor refers to the
5553
6121
  * damage scaling mechanic. For example, Ultra Greed has armor, but a Gaper does not.
@@ -5826,6 +6394,17 @@ export declare function inSecretShop(): boolean;
5826
6394
  */
5827
6395
  export declare function inStartingRoom(): boolean;
5828
6396
 
6397
+ /**
6398
+ * Used for `setInterval` functions.
6399
+ *
6400
+ * The return value is whether or not to continue the function from firing.
6401
+ */
6402
+ declare type IntervalFunctionTuple = [
6403
+ frameCountToFire: int,
6404
+ func: () => boolean,
6405
+ numIntervalFrames: int
6406
+ ];
6407
+
5829
6408
  /**
5830
6409
  * Helper function to return an array of integers with the specified range, inclusive on both ends.
5831
6410
  * (The "i" stands for inclusive.)
@@ -5862,41 +6441,6 @@ declare interface IsaacAPIClassTypeToType {
5862
6441
  [CopyableIsaacAPIClassType.VECTOR]: Vector;
5863
6442
  }
5864
6443
 
5865
- export declare enum IsaacScriptCommonFeature {
5866
- CHARACTER_HEALTH_CONVERSION = "characterHealthConversion",
5867
- CHARACTER_STATS = "characterStats",
5868
- COLLECTIBLE_ITEM_POOL_TYPE = "collectibleItemPoolType",
5869
- CUSTOM_GRID_ENTITY = "customGridEntity",
5870
- CUSTOM_HOTKEYS = "customHotkeys",
5871
- CUSTOM_PICKUP = "customPickup",
5872
- CUSTOM_STAGE = "customStage",
5873
- CUSTOM_TRAPDOOR = "customTrapdoor",
5874
- DEBUG_DISPLAY = "debugDisplay",
5875
- DEPLOY_JSON_ROOM = "deployJSONRoom",
5876
- DISABLE_ALL_SOUND = "displayAllSound",
5877
- DISABLE_INPUTS = "disableInputs",
5878
- FADE_IN_REMOVER = "fadeInRemover",
5879
- FAST_RESET = "fastReset",
5880
- FIRST_LAST = "firstLast",
5881
- FORGOTTEN_SWITCH = "forgottenSwitch",
5882
- EXTRA_CONSOLE_COMMANDS = "extraConsoleCommands",
5883
- PAUSE = "pause",
5884
- PERSISTENT_ENTITIES = "persistentEntities",
5885
- PICKUP_INDEX = "pickupIndex",
5886
- PLAYER_INVENTORY = "playerInventory",
5887
- PONY_DETECTION = "ponyDetection",
5888
- PREVENT_CHILD_ENTITIES = "preventChildEntities",
5889
- PREVENT_COLLECTIBLE_ROTATION = "preventCollectibleRotation",
5890
- ROOM_CLEAR_FRAME = "roomClearFrame",
5891
- ROOM_HISTORY = "roomHistory",
5892
- RUN_IN_N_FRAMES = "runInNFrames",
5893
- RUN_NEXT_ROOM = "runNextRoom",
5894
- SAVE_DATA_MANAGER = "saveDataManager",
5895
- SIREN_HELPERS = "sirenHelpers",
5896
- STAGE_HISTORY = "stageHistory",
5897
- TAINTED_LAZARUS_PLAYERS = "taintedLazarusPlayers"
5898
- }
5899
-
5900
6444
  /** Iterates over all inputs to determine if a particular button is pressed (i.e. held down). */
5901
6445
  export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): boolean;
5902
6446
 
@@ -5909,9 +6453,22 @@ export declare function isActionTriggeredOnAnyInput(buttonAction: ButtonAction):
5909
6453
  /** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
5910
6454
  export declare function isActiveCollectible(collectibleType: CollectibleType): boolean;
5911
6455
 
5912
- export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
6456
+ /**
6457
+ * Helper function to check if a player's active item is "double charged", meaning that it has both
6458
+ * a full normal charge and a full charge from The Battery.
6459
+ *
6460
+ * @param player The player to check.
6461
+ * @param activeSlot Optional. The slot to check. Default is `ActiveSlot.PRIMARY`.
6462
+ */
6463
+ export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
5913
6464
 
5914
- export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
6465
+ /**
6466
+ * Helper function to check if the active slot of a particular player is empty.
6467
+ *
6468
+ * @param player The player to check.
6469
+ * @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`.
6470
+ */
6471
+ export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
5915
6472
 
5916
6473
  /**
5917
6474
  * Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
@@ -6007,6 +6564,30 @@ export declare function isCardPickup(pickup: EntityPickup): pickup is EntityPick
6007
6564
  /** Returns whether or not the given card type matches the specified item config card type. */
6008
6565
  export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean;
6009
6566
 
6567
+ export declare enum ISCFeature {
6568
+ CUSTOM_REVIVE = "CustomRevive",
6569
+ ESAU_JR_DETECTION = "EsauJrDetection",
6570
+ FLIP_DETECTION = "FlipDetection",
6571
+ GRID_ENTITY_COLLISION_DETECTION = "GridEntityCollisionDetection",
6572
+ GRID_ENTITY_DETECTION = "GridEntityDetection",
6573
+ GAME_REORDERED_CALLBACKS = "GameReorderedCallbacks",
6574
+ PLAYER_REORDERED_CALLBACKS = "PlayerReorderedCallbacks",
6575
+ CUSTOM_GRID_ENTITIES = "CustomGridEntities",
6576
+ RUN_IN_N_FRAMES = "runInNFrames"
6577
+ }
6578
+
6579
+ declare interface ISCFeatureToClass {
6580
+ [ISCFeature.CUSTOM_REVIVE]: CustomRevive;
6581
+ [ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection;
6582
+ [ISCFeature.FLIP_DETECTION]: FlipDetection;
6583
+ [ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection;
6584
+ [ISCFeature.GRID_ENTITY_DETECTION]: GridEntityDetection;
6585
+ [ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks;
6586
+ [ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
6587
+ [ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities;
6588
+ [ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames;
6589
+ }
6590
+
6010
6591
  /**
6011
6592
  * Helper function to check if a player is a specific character (i.e. `PlayerType`).
6012
6593
  *
@@ -6246,6 +6827,12 @@ export declare function isGlitchedCollectible(pickup: EntityPickup): boolean;
6246
6827
 
6247
6828
  export declare function isGoldenTrinketType(trinketType: TrinketType): boolean;
6248
6829
 
6830
+ /**
6831
+ * Helper function to check if the difficulty of the current run is equal to `Difficulty.GREED` or
6832
+ * `Difficulty.GREEDIER`.
6833
+ */
6834
+ export declare function isGreedMode(): boolean;
6835
+
6249
6836
  /** Helper function to detect if a variable is of type `GridEntity`. */
6250
6837
  export declare function isGridEntity(variable: unknown): variable is GridEntity;
6251
6838
 
@@ -6620,6 +7207,9 @@ export declare function isSuitCard(cardType: CardType): boolean;
6620
7207
 
6621
7208
  export declare function isTable(variable: unknown): variable is LuaMap<AnyNotNil, unknown>;
6622
7209
 
7210
+ /** Helper function to check if a Lua table has 0 keys. */
7211
+ export declare function isTableEmpty(luaMap: LuaMap<AnyNotNil, unknown>): boolean;
7212
+
6623
7213
  /** Helper function for detecting if a player is one of the Tainted characters. */
6624
7214
  export declare function isTainted(player: EntityPlayer): boolean;
6625
7215
 
@@ -6675,16 +7265,18 @@ export declare function isTrinket(pickup: EntityPickup): pickup is EntityPickupT
6675
7265
  /**
6676
7266
  * Helper function to determine if a given object is a TypeScriptToLua `Map`.
6677
7267
  *
6678
- * It is not reliable to use the `instanceof` operator to determine this because each Lua module has
6679
- * their own copies of the entire lualib and thus their own instantiated version of a `Map`.
7268
+ * It is not reliable to use the `instanceof` operator to determine this because each Lua module
7269
+ * might have their own copy of the entire lualib and thus their own instantiated version of a
7270
+ * `Map`.
6680
7271
  */
6681
7272
  export declare function isTSTLMap(object: unknown): object is Map<AnyNotNil, unknown>;
6682
7273
 
6683
7274
  /**
6684
7275
  * Helper function to determine if a given object is a TypeScriptToLua `Set`.
6685
7276
  *
6686
- * It is not reliable to use the `instanceof` operator to determine this because each Lua module has
6687
- * their own copies of the entire lualib and thus their own instantiated version of a `Set`.
7277
+ * It is not reliable to use the `instanceof` operator to determine this because each Lua module
7278
+ * might have their own copy of the entire lualib and thus their own instantiated version of a
7279
+ * `Set`.
6688
7280
  */
6689
7281
  export declare function isTSTLSet(object: unknown): object is Set<AnyNotNil>;
6690
7282
 
@@ -6930,6 +7522,8 @@ export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean;
6930
7522
  */
6931
7523
  export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
6932
7524
 
7525
+ declare type KeysToScrubFromModClass = keyof Feature | LowercaseKeys<ModUpgraded>;
7526
+
6933
7527
  /**
6934
7528
  * For `EntityType.EFFECT` (1000), `EffectVariant.LADDER` (8).
6935
7529
  *
@@ -7147,6 +7741,8 @@ export declare function logUserdata(userdata: unknown): void;
7147
7741
 
7148
7742
  export declare function logVector(vector: Vector, round?: boolean): void;
7149
7743
 
7744
+ export declare type LowercaseKeys<T> = StartsWithLowercase<keyof T>;
7745
+
7150
7746
  /**
7151
7747
  * Helper function for non-TypeScript users to convert all of the elements in an array to something
7152
7748
  * else.
@@ -7211,6 +7807,20 @@ export declare function mapSetHash<V>(map: Map<PtrHash, V>, entity: Entity, valu
7211
7807
  */
7212
7808
  export declare function mapSetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer, value: V): void;
7213
7809
 
7810
+ /**
7811
+ * A helper type used to get the matching `ModCallbackCustom` enum values that match the provided
7812
+ * callback function signature.
7813
+ *
7814
+ * "T extends T" is necessary because of distributive conditional types:
7815
+ * https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
7816
+ *
7817
+ * "extends Parameters<FuncSignature>" is necessary because "() => void" will match "(arg1: number)
7818
+ * => void", since in JavaScript, functions ignore extra arguments.
7819
+ *
7820
+ * "extends ReturnType<FuncSignature>" is necessary because "() => void" will match "() => number".
7821
+ */
7822
+ declare type MatchingCallbackCustom<FuncSignature extends (...args: any[]) => unknown, T extends ModCallbackCustom2 = ModCallbackCustom2> = T extends T ? AddCallbackParametersCustom2[T][0] extends FuncSignature ? Parameters<AddCallbackParametersCustom2[T][0]> extends Parameters<FuncSignature> ? ReturnType<AddCallbackParametersCustom2[T][0]> extends ReturnType<FuncSignature> ? T : never : never : never : never;
7823
+
7214
7824
  /**
7215
7825
  * The floor is represented by a 13x13 grid. Room indexes start at 0. The first row is represented
7216
7826
  * by grid indexes from 0 to 12. The second row is represented by grid indexes from 13 to 25, and so
@@ -8788,11 +9398,65 @@ export declare enum ModCallbackCustom2 {
8788
9398
  POST_COLLECTIBLE_EMPTY = 5,
8789
9399
  POST_COLLECTIBLE_INIT_FIRST = 6,
8790
9400
  POST_CURSED_TELEPORT = 7,
8791
- POST_KNIFE_INIT_LATE = 8,
8792
- POST_NEW_ROOM_EARLY = 9,
8793
- POST_PIT_RENDER = 10,
8794
- POST_ROOM_CLEAR_CHANGED = 11,
8795
- POST_SPIKES_RENDER = 12
9401
+ POST_CUSTOM_REVIVE = 8,
9402
+ POST_DICE_ROOM_ACTIVATED = 9,
9403
+ POST_DOOR_RENDER = 10,
9404
+ POST_DOOR_UPDATE = 11,
9405
+ POST_EFFECT_INIT_LATE = 12,
9406
+ POST_EFFECT_STATE_CHANGED = 13,
9407
+ POST_ESAU_JR = 14,
9408
+ POST_FAMILIAR_INIT_LATE = 15,
9409
+ POST_FAMILIAR_STATE_CHANGED = 16,
9410
+ POST_FIRST_ESAU_JR = 17,
9411
+ POST_FIRST_FLIP = 18,
9412
+ POST_FLIP = 19,
9413
+ POST_GAME_STARTED_REORDERED = 20,
9414
+ POST_GAME_STARTED_REORDERED_LAST = 21,
9415
+ POST_GREED_MODE_WAVE = 22,
9416
+ POST_GRID_ENTITY_BROKEN = 23,
9417
+ POST_GRID_ENTITY_COLLISION = 24,
9418
+ POST_GRID_ENTITY_CUSTOM_BROKEN = 25,
9419
+ POST_GRID_ENTITY_CUSTOM_COLLISION = 26,
9420
+ POST_GRID_ENTITY_CUSTOM_INIT = 27,
9421
+ POST_GRID_ENTITY_CUSTOM_REMOVE = 28,
9422
+ POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 29,
9423
+ POST_GRID_ENTITY_CUSTOM_UPDATE = 30,
9424
+ POST_GRID_ENTITY_INIT = 31,
9425
+ POST_GRID_ENTITY_REMOVE = 32,
9426
+ POST_GRID_ENTITY_STATE_CHANGED = 33,
9427
+ POST_GRID_ENTITY_UPDATE = 34,
9428
+ POST_HOLY_MANTLE_REMOVED = 35,
9429
+ POST_KNIFE_INIT_LATE = 36,
9430
+ POST_NEW_LEVEL_REORDERED = 37,
9431
+ POST_NEW_ROOM_EARLY = 38,
9432
+ POST_NEW_ROOM_REORDERED = 39,
9433
+ POST_PEFFECT_UPDATE_REORDERED = 40,
9434
+ POST_PIT_RENDER = 41,
9435
+ POST_PLAYER_FATAL_DAMAGE = 42,
9436
+ POST_PLAYER_RENDER_REORDERED = 43,
9437
+ POST_PLAYER_UPDATE_REORDERED = 44,
9438
+ POST_ROOM_CLEAR_CHANGED = 45,
9439
+ POST_SPIKES_RENDER = 46,
9440
+ PRE_BERSERK_DEATH = 47,
9441
+ PRE_CUSTOM_REVIVE = 48
9442
+ }
9443
+
9444
+ declare type ModCallbackCustomGridEntity = MatchingCallbackCustom<CallbackSignatureGridEntity>;
9445
+
9446
+ declare type ModCallbackCustomGridEntityCustom = MatchingCallbackCustom<CallbackSignatureGridEntityCustom>;
9447
+
9448
+ declare type ModCallbackCustomPlayer = MatchingCallbackCustom<CallbackSignaturePlayer>;
9449
+
9450
+ declare type ModCallbackCustomRevive = MatchingCallbackCustom<CallbackSignatureRevive>;
9451
+
9452
+ /**
9453
+ * A helper class for a mod that wants to represent its individual features as classes. This is
9454
+ * useful if you are using decorators to represent class methods that should be automatically
9455
+ * subscribed to callbacks.
9456
+ */
9457
+ export declare class ModFeature {
9458
+ private mod;
9459
+ constructor(mod: ModUpgraded);
8796
9460
  }
8797
9461
 
8798
9462
  /**
@@ -8804,8 +9468,8 @@ export declare enum ModCallbackCustom2 {
8804
9468
  */
8805
9469
  export declare class ModUpgraded implements Mod {
8806
9470
  /**
8807
- * The vanilla mod object stores the name of the mod for some reason. (It is never used or
8808
- * referenced. (We match the casing of the vanilla variable.)
9471
+ * The `RegisterMod` function stores the name of the mod on the mod object for some reason. (It is
9472
+ * never used or referenced.)
8809
9473
  */
8810
9474
  Name: string;
8811
9475
  /** We store a copy of the original mod object so that we can re-implement its functions. */
@@ -8814,25 +9478,66 @@ export declare class ModUpgraded implements Mod {
8814
9478
  private timeThreshold;
8815
9479
  private callbacks;
8816
9480
  constructor(mod: Mod, debug: boolean, timeThreshold?: float);
9481
+ /**
9482
+ * Registers a function to be executed when an in-game event happens. For example, the
9483
+ * `ModCallback.POST_UPDATE` event corresponds to being executed once at the end of every game
9484
+ * logic frame.
9485
+ */
8817
9486
  AddCallback<T extends ModCallback>(modCallback: T, ...args: AddCallbackParameters[T]): void;
9487
+ /** Returns whether or not a corresponding "save#.dat" file exists for the current mod. */
8818
9488
  HasData(): boolean;
9489
+ /**
9490
+ * Returns a string containing all of the data inside of the corresponding "save#.dat" file for
9491
+ * this mod.
9492
+ */
8819
9493
  LoadData(): string;
8820
9494
  /**
8821
- * This method does not care about the tertiary argument. Regardless of the conditions of how you
8822
- * registered the callback, it will be removed.
9495
+ * Unregisters a function that was previously registered with the `AddCallback` method.
9496
+ *
9497
+ * This method does not care about the tertiary argument. In other words, regardless of the
9498
+ * conditions of how you registered the callback, it will be removed.
8823
9499
  */
8824
9500
  RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
9501
+ /** Deletes the corresponding "save#.dat" file for this mod, if it exists. */
8825
9502
  RemoveData(): void;
9503
+ /**
9504
+ * Creates or updates the corresponding "save#.dat" file for this mod with the provided string.
9505
+ */
8826
9506
  SaveData(data: string): void;
9507
+ /**
9508
+ * Registers a function to be executed when an in-game event happens. This method is specifically
9509
+ * for events that are provided by the IsaacScript standard library. For example, the
9510
+ * `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb explodes.
9511
+ */
8827
9512
  AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
9513
+ /** Adds a callback in the new callback system format. This method is only temporary. */
8828
9514
  AddCallbackCustom2<T extends ModCallbackCustom2>(modCallbackCustom: T, ...args: AddCallbackParametersCustom2[T]): void;
8829
9515
  /**
8830
- * This method does not care about the tertiary argument. Regardless of the conditions of how you
8831
- * registered the callback, it will be removed.
9516
+ * Unregisters a function that was previously registered with the `AddCallbackCustom` method.
9517
+ *
9518
+ * This method does not care about the tertiary argument. In other words, regardless of the
9519
+ * conditions of how you registered the callback, it will be removed.
8832
9520
  */
8833
- RemoveCallbackCustom<T extends ModCallbackCustom>(modCallback: T, callback: AddCallbackParametersCustom[T][0]): void;
9521
+ RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
9522
+ /**
9523
+ * This method should only be used by the `upgradeMod` function. Returns the class methods from
9524
+ * the features that were added.
9525
+ */
9526
+ initOptionalFeature(feature: ISCFeature): FunctionTuple[];
9527
+ /** This is used to initialize both custom callbacks and "extra features". */
9528
+ private initFeature;
9529
+ private uninitFeature;
8834
9530
  }
8835
9531
 
9532
+ /**
9533
+ * By specifying one or more optional features, end-users will get a version of `ModUpgraded` that
9534
+ * has extra methods corresponding to the features.
9535
+ *
9536
+ * We have to explicitly account for the empty array case, since `never` will cause mess up the
9537
+ * union.
9538
+ */
9539
+ declare type ModUpgradedWithFeatures<T extends ISCFeature> = [T] extends [never] ? ModUpgraded : Omit<ModUpgraded & UnionToIntersection<ISCFeatureToClass[T]>, KeysToScrubFromModClass>;
9540
+
8836
9541
  /**
8837
9542
  * Helper function to move all of the players to where they would normally go when arriving at a new
8838
9543
  * floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
@@ -8869,6 +9574,9 @@ export declare const NEW_RUN_PLAYER_STARTING_POSITION: Vector;
8869
9574
  /**
8870
9575
  * Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar`
8871
9576
  * helper function.
9577
+ *
9578
+ * Note that this is for the vertical charge bar that represents the number of charges that an
9579
+ * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone.
8872
9580
  */
8873
9581
  export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites;
8874
9582
 
@@ -8878,6 +9586,16 @@ export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites;
8878
9586
  */
8879
9587
  export declare function newCollectibleSprite(collectibleType: CollectibleType): Sprite;
8880
9588
 
9589
+ /**
9590
+ * Helper function for creating objects that represent a mapping of an enum value to some other
9591
+ * value in a type-safe way.
9592
+ *
9593
+ * This function will ensure that the provided object has a key for each value in the enum.
9594
+ *
9595
+ * After the `satisfies` operator is released in TypeScript 4.9, this function should be deleted.
9596
+ */
9597
+ export declare function newObjectWithEnumKeys<Enum extends number | string, T extends Record<Enum, unknown>>(theEnum: Record<string, Enum>, obj: T): T;
9598
+
8881
9599
  export declare function newPickingUpItem(): PickingUpItem;
8882
9600
 
8883
9601
  /** Returns a `PlayerHealth` object with all zeros. */
@@ -9008,6 +9726,8 @@ export declare function openAllDoors(): void;
9008
9726
  */
9009
9727
  export declare function openDoorFast(door: GridEntityDoor): void;
9010
9728
 
9729
+ declare type OptionalArgs<T extends ModCallbackCustom2> = AllButFirst_2<AddCallbackParametersCustom2[T]>;
9730
+
9011
9731
  /**
9012
9732
  * Helper function to parse a string that contains an entity type, a variant, and a sub-type,
9013
9733
  * separated by periods.
@@ -9085,7 +9805,15 @@ export declare type PickupIndex = int & {
9085
9805
  /** Maps pill effect names to the values of the `PillEffect` enum. */
9086
9806
  export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
9087
9807
 
9088
- export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot: ActiveSlot): void;
9808
+ /**
9809
+ * Helper function to play the appropriate sound effect for a player after getting one or more
9810
+ * charges on their active item. (There is a different sound depending on whether the item is fully
9811
+ * charged or not.)
9812
+ *
9813
+ * @param player The player to play the sound effect for.
9814
+ * @param activeSlot Optional. The slot that was just charged. Default is `ActiveSlot.PRIMARY`.
9815
+ */
9816
+ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?: ActiveSlot): void;
9089
9817
 
9090
9818
  /**
9091
9819
  * Helper function to add one or more collectibles to a player.
@@ -9150,6 +9878,25 @@ export declare type PlayerIndex = int & {
9150
9878
  readonly __playerIndexBrand: symbol;
9151
9879
  };
9152
9880
 
9881
+ declare class PlayerReorderedCallbacks extends Feature {
9882
+ v: {
9883
+ run: {
9884
+ postGameStartedFiredOnThisRun: boolean;
9885
+ postPEffectUpdateQueue: PlayerIndex[];
9886
+ postPlayerUpdateQueue: PlayerIndex[];
9887
+ postPlayerRenderQueue: PlayerIndex[];
9888
+ };
9889
+ };
9890
+ private postPEffectUpdateReordered;
9891
+ private postPlayerRenderReordered;
9892
+ private postPlayerUpdateReordered;
9893
+ constructor(postPEffectUpdateReordered: PostPEffectUpdateReordered, postPlayerRenderReordered: PostPlayerRenderReordered, postPlayerUpdateReordered: PostPlayerUpdateReordered);
9894
+ private postPEffectUpdate;
9895
+ private postPlayerUpdate;
9896
+ private postPlayerRender;
9897
+ private postGameStartedReorderedLast;
9898
+ }
9899
+
9153
9900
  /** This is used by the `getPocketItems` and related helper functions. */
9154
9901
  export declare interface PocketItemDescription {
9155
9902
  slot: PocketItemSlot;
@@ -9213,6 +9960,10 @@ playerVariant?: PlayerVariant,
9213
9960
  character?: PlayerType
9214
9961
  ];
9215
9962
 
9963
+ declare class PostCustomRevive extends CustomCallbackRevive<ModCallbackCustom2.POST_CUSTOM_REVIVE> {
9964
+ constructor();
9965
+ }
9966
+
9216
9967
  declare type PostCustomReviveRegisterParameters = [
9217
9968
  callback: (player: EntityPlayer, revivalType: int) => void,
9218
9969
  revivalType?: int
@@ -9243,6 +9994,10 @@ callback: (effect: EntityEffect, previousState: int, currentState: int) => void,
9243
9994
  effectVariant?: EffectVariant
9244
9995
  ];
9245
9996
 
9997
+ declare class PostEsauJr extends CustomCallback<ModCallbackCustom2.POST_ESAU_JR> {
9998
+ constructor();
9999
+ }
10000
+
9246
10001
  declare type PostEsauJrRegisterParameters = [
9247
10002
  callback: (player: EntityPlayer) => void
9248
10003
  ];
@@ -9257,18 +10012,38 @@ callback: (familiar: EntityFamiliar, previousState: int, currentState: int) => v
9257
10012
  familiarVariant?: FamiliarVariant
9258
10013
  ];
9259
10014
 
10015
+ declare class PostFirstEsauJr extends CustomCallback<ModCallbackCustom2.POST_FIRST_ESAU_JR> {
10016
+ constructor();
10017
+ }
10018
+
9260
10019
  declare type PostFirstEsauJrRegisterParameters = [
9261
10020
  callback: (player: EntityPlayer) => void
9262
10021
  ];
9263
10022
 
10023
+ declare class PostFirstFlip extends CustomCallback<ModCallbackCustom2.POST_FIRST_FLIP> {
10024
+ constructor();
10025
+ }
10026
+
9264
10027
  declare type PostFirstFlipRegisterParameters = [
9265
10028
  callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
9266
10029
  ];
9267
10030
 
10031
+ declare class PostFlip extends CustomCallback<ModCallbackCustom2.POST_FLIP> {
10032
+ constructor();
10033
+ }
10034
+
9268
10035
  declare type PostFlipRegisterParameters = [
9269
10036
  callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
9270
10037
  ];
9271
10038
 
10039
+ declare class PostGameStartedReordered extends CustomCallback<ModCallbackCustom2.POST_GAME_STARTED_REORDERED> {
10040
+ constructor();
10041
+ }
10042
+
10043
+ declare class PostGameStartedReorderedLast extends CustomCallback<ModCallbackCustom2.POST_GAME_STARTED_REORDERED> {
10044
+ constructor();
10045
+ }
10046
+
9272
10047
  declare type PostGameStartedReorderedLastRegisterParameters = [
9273
10048
  callback: (isContinued: boolean) => void
9274
10049
  ];
@@ -9281,12 +10056,21 @@ declare type PostGreedModeWaveRegisterParameters = [
9281
10056
  callback: (oldWave: int, newWave: int) => void
9282
10057
  ];
9283
10058
 
10059
+ declare class PostGridEntityBroken extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_BROKEN> {
10060
+ constructor();
10061
+ }
10062
+
9284
10063
  declare type PostGridEntityBrokenRegisterParameters = [
9285
10064
  callback: (gridEntity: GridEntity) => void,
9286
10065
  gridEntityType?: GridEntityType,
9287
- gridEntityVariant?: int
10066
+ variant?: int
9288
10067
  ];
9289
10068
 
10069
+ declare class PostGridEntityCollision extends CustomCallback<T> {
10070
+ constructor();
10071
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
10072
+ }
10073
+
9290
10074
  declare type PostGridEntityCollisionRegisterParameters = [
9291
10075
  callback: (gridEntity: GridEntity, entity: Entity) => void,
9292
10076
  gridEntityType?: GridEntityType,
@@ -9295,11 +10079,20 @@ entityType?: EntityType,
9295
10079
  entityVariant?: int
9296
10080
  ];
9297
10081
 
10082
+ declare class PostGridEntityCustomBroken extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_BROKEN> {
10083
+ constructor();
10084
+ }
10085
+
9298
10086
  declare type PostGridEntityCustomBrokenRegisterParameters = [
9299
10087
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9300
10088
  gridEntityTypeCustom?: GridEntityType
9301
10089
  ];
9302
10090
 
10091
+ declare class PostGridEntityCustomCollision extends CustomCallback<T_2> {
10092
+ constructor();
10093
+ protected shouldFire(fireArgs: FireArgs<T_2>, optionalArgs: OptionalArgs<T_2>): boolean;
10094
+ }
10095
+
9303
10096
  declare type PostGridEntityCustomCollisionRegisterParameters = [
9304
10097
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
9305
10098
  gridEntityTypeCustom?: GridEntityType,
@@ -9307,11 +10100,20 @@ entityType?: EntityType,
9307
10100
  entityVariant?: int
9308
10101
  ];
9309
10102
 
10103
+ declare class PostGridEntityCustomInit extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_INIT> {
10104
+ constructor();
10105
+ }
10106
+
9310
10107
  declare type PostGridEntityCustomInitRegisterParameters = [
9311
10108
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9312
10109
  gridEntityTypeCustom?: GridEntityType
9313
10110
  ];
9314
10111
 
10112
+ declare class PostGridEntityCustomRemove extends CustomCallback<T_4> {
10113
+ constructor();
10114
+ protected shouldFire(fireArgs: FireArgs<T_4>, optionalArgs: OptionalArgs<T_4>): boolean;
10115
+ }
10116
+
9315
10117
  declare type PostGridEntityCustomRemoveRegisterParameters = [
9316
10118
  callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
9317
10119
  gridEntityTypeCustom?: GridEntityType
@@ -9322,44 +10124,69 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
9322
10124
  gridEntityTypeCustom?: GridEntityType
9323
10125
  ];
9324
10126
 
10127
+ declare class PostGridEntityCustomStateChanged extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED> {
10128
+ constructor();
10129
+ }
10130
+
9325
10131
  declare type PostGridEntityCustomStateChangedRegisterParameters = [
9326
10132
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
9327
10133
  gridEntityTypeCustom?: GridEntityType
9328
10134
  ];
9329
10135
 
10136
+ declare class PostGridEntityCustomUpdate extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_UPDATE> {
10137
+ constructor();
10138
+ }
10139
+
9330
10140
  declare type PostGridEntityCustomUpdateRegisterParameters = [
9331
10141
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9332
10142
  gridEntityTypeCustom?: GridEntityType
9333
10143
  ];
9334
10144
 
10145
+ declare class PostGridEntityInit extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_INIT> {
10146
+ constructor();
10147
+ }
10148
+
9335
10149
  declare type PostGridEntityInitRegisterParameters = [
9336
10150
  callback: (gridEntity: GridEntity) => void,
9337
10151
  gridEntityType?: GridEntityType,
9338
- gridEntityVariant?: int
10152
+ variant?: int
9339
10153
  ];
9340
10154
 
10155
+ declare class PostGridEntityRemove extends CustomCallback<T_3> {
10156
+ constructor();
10157
+ protected shouldFire(fireArgs: FireArgs<T_3>, optionalArgs: OptionalArgs<T_3>): boolean;
10158
+ }
10159
+
9341
10160
  declare type PostGridEntityRemoveRegisterParameters = [
9342
- callback: (gridIndex: int, gridEntityType: GridEntityType) => void,
10161
+ callback: (gridIndex: int, gridEntityType: GridEntityType, variant: int) => void,
9343
10162
  gridEntityType?: GridEntityType,
9344
- gridEntityVariant?: int
10163
+ variant?: int
9345
10164
  ];
9346
10165
 
9347
10166
  declare type PostGridEntityRenderRegisterParameters = [
9348
10167
  callback: (gridEntity: GridEntity) => void,
9349
10168
  gridEntityType?: GridEntityType,
9350
- gridEntityVariant?: int
10169
+ variant?: int
9351
10170
  ];
9352
10171
 
10172
+ declare class PostGridEntityStateChanged extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED> {
10173
+ constructor();
10174
+ }
10175
+
9353
10176
  declare type PostGridEntityStateChangedRegisterParameters = [
9354
10177
  callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
9355
10178
  gridEntityType?: GridEntityType,
9356
- gridEntityVariant?: int
10179
+ variant?: int
9357
10180
  ];
9358
10181
 
10182
+ declare class PostGridEntityUpdate extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_UPDATE> {
10183
+ constructor();
10184
+ }
10185
+
9359
10186
  declare type PostGridEntityUpdateRegisterParameters = [
9360
10187
  callback: (gridEntity: GridEntity) => void,
9361
10188
  gridEntityType?: GridEntityType,
9362
- gridEntityVariant?: int
10189
+ variant?: int
9363
10190
  ];
9364
10191
 
9365
10192
  declare type PostHolyMantleRemovedRegisterParameters = [
@@ -9393,10 +10220,18 @@ callback: (laser: EntityLaser) => void,
9393
10220
  laserVariant?: LaserVariant
9394
10221
  ];
9395
10222
 
10223
+ declare class PostNewLevelReordered extends CustomCallback<ModCallbackCustom2.POST_NEW_LEVEL_REORDERED> {
10224
+ constructor();
10225
+ }
10226
+
9396
10227
  declare type PostNewLevelReorderedRegisterParameters = [callback: () => void];
9397
10228
 
9398
10229
  declare type PostNewRoomEarlyRegisterParameters = [callback: () => void];
9399
10230
 
10231
+ declare class PostNewRoomReordered extends CustomCallback<ModCallbackCustom2.POST_NEW_ROOM_REORDERED> {
10232
+ constructor();
10233
+ }
10234
+
9400
10235
  declare type PostNewRoomReorderedRegisterParameters = [callback: () => void];
9401
10236
 
9402
10237
  declare type PostNPCInitLateRegisterParameters = [
@@ -9410,6 +10245,10 @@ entityType?: EntityType,
9410
10245
  variant?: int
9411
10246
  ];
9412
10247
 
10248
+ declare class PostPEffectUpdateReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED> {
10249
+ constructor();
10250
+ }
10251
+
9413
10252
  declare type PostPEffectUpdateReorderedRegisterParameters = [
9414
10253
  callback: (player: EntityPlayer) => void,
9415
10254
  playerVariant?: PlayerVariant,
@@ -9491,12 +10330,20 @@ playerVariant?: PlayerVariant,
9491
10330
  character?: PlayerType
9492
10331
  ];
9493
10332
 
10333
+ declare class PostPlayerRenderReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED> {
10334
+ constructor();
10335
+ }
10336
+
9494
10337
  declare type PostPlayerRenderReorderedRegisterParameters = [
9495
10338
  callback: (player: EntityPlayer) => void,
9496
10339
  playerVariant?: PlayerVariant,
9497
10340
  character?: PlayerType
9498
10341
  ];
9499
10342
 
10343
+ declare class PostPlayerUpdateReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PLAYER_UPDATE_REORDERED> {
10344
+ constructor();
10345
+ }
10346
+
9500
10347
  declare type PostPlayerUpdateReorderedRegisterParameters = [
9501
10348
  callback: (player: EntityPlayer) => void,
9502
10349
  playerVariant?: PlayerVariant,
@@ -9536,12 +10383,12 @@ pickupSubType?: int
9536
10383
 
9537
10384
  declare type PostRockRenderRegisterParameters = [
9538
10385
  callback: (rock: GridEntityRock) => void,
9539
- gridEntityVariant?: int
10386
+ variant?: int
9540
10387
  ];
9541
10388
 
9542
10389
  declare type PostRockUpdateRegisterParameters = [
9543
10390
  callback: (rock: GridEntityRock) => void,
9544
- gridEntityVariant?: int
10391
+ variant?: int
9545
10392
  ];
9546
10393
 
9547
10394
  declare type PostRoomClearChangedRegisterParameters = [
@@ -9588,12 +10435,12 @@ slotVariant?: SlotVariant
9588
10435
 
9589
10436
  declare type PostSpikesRenderRegisterParameters = [
9590
10437
  callback: (spikes: GridEntitySpikes) => void,
9591
- gridEntityVariant?: int
10438
+ variant?: int
9592
10439
  ];
9593
10440
 
9594
10441
  declare type PostSpikesUpdateRegisterParameters = [
9595
10442
  callback: (spikes: GridEntitySpikes) => void,
9596
- gridEntityVariant?: int
10443
+ variant?: int
9597
10444
  ];
9598
10445
 
9599
10446
  declare type PostTearInitLateRegisterParameters = [
@@ -9608,12 +10455,12 @@ tearVariant?: TearVariant
9608
10455
 
9609
10456
  declare type PostTNTRenderRegisterParameters = [
9610
10457
  callback: (tnt: GridEntityTNT) => void,
9611
- gridEntityVariant?: int
10458
+ variant?: int
9612
10459
  ];
9613
10460
 
9614
10461
  declare type PostTNTUpdateRegisterParameters = [
9615
10462
  callback: (tnt: GridEntityTNT) => void,
9616
- gridEntityVariant?: int
10463
+ variant?: int
9617
10464
  ];
9618
10465
 
9619
10466
  declare type PostTransformationRegisterParameters = [
@@ -9632,6 +10479,10 @@ playerVariant?: PlayerVariant,
9632
10479
  character?: PlayerType
9633
10480
  ];
9634
10481
 
10482
+ declare class PreCustomRevive extends CustomCallbackPlayer<ModCallbackCustom2.PRE_CUSTOM_REVIVE> {
10483
+ constructor();
10484
+ }
10485
+
9635
10486
  declare type PreCustomReviveRegisterParameters = [
9636
10487
  callback: (player: EntityPlayer) => int | undefined,
9637
10488
  playerVariant?: PlayerVariant,
@@ -9711,6 +10562,9 @@ export declare function printConsole(msg: string): void;
9711
10562
  /** Helper function to print whether something was enabled or disabled to the in-game console. */
9712
10563
  export declare function printEnabled(enabled: boolean, description: string): void;
9713
10564
 
10565
+ /** Used for `runInNFrames` functions. */
10566
+ declare type QueuedFunctionTuple = [frameCountToFire: int, func: () => void];
10567
+
9714
10568
  /**
9715
10569
  * Helper function to make a character that has the same health mechanic as Blue Baby (red heart
9716
10570
  * containers --> soul hearts) or Dark Judas (red heart containers --> black hearts).
@@ -10384,6 +11238,9 @@ export declare const RENDER_FRAMES_PER_SECOND = 60;
10384
11238
  /**
10385
11239
  * Helper function to render a charge bar on the screen. First, call the `newChargeBarSprites`
10386
11240
  * function to initialize the sprites, and then call this function on every render frame.
11241
+ *
11242
+ * Note that this is for the vertical charge bar that represents the number of charges that an
11243
+ * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone.
10387
11244
  */
10388
11245
  export declare function renderChargeBar(sprites: ChargeBarSprites, position: Vector, normalCharges: int, batteryCharges: int): void;
10389
11246
 
@@ -10536,6 +11393,114 @@ export declare function round(num: float, numDecimalPlaces?: number): float;
10536
11393
  */
10537
11394
  export declare function runDeepCopyTests(): void;
10538
11395
 
11396
+ declare class RunInNFrames extends Feature {
11397
+ v: {
11398
+ run: {
11399
+ queuedGameFunctionTuples: QueuedFunctionTuple[];
11400
+ queuedRenderFunctionTuples: QueuedFunctionTuple[];
11401
+ intervalGameFunctionTuples: IntervalFunctionTuple[];
11402
+ intervalRenderFunctionTuples: IntervalFunctionTuple[];
11403
+ };
11404
+ };
11405
+ constructor();
11406
+ private postUpdate;
11407
+ private postRender;
11408
+ /**
11409
+ * Supply a function to run N game frames from now in the `POST_UPDATE` callback.
11410
+ *
11411
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11412
+ * similar way.
11413
+ *
11414
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11415
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11416
+ * deferred functions manually using serializable data.
11417
+ */
11418
+ runInNGameFrames(func: () => void, gameFrames: int): void;
11419
+ /**
11420
+ * Supply a function to run N render frames from now in the `POST_RENDER` callback.
11421
+ *
11422
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11423
+ * similar way.
11424
+ *
11425
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11426
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11427
+ * deferred functions manually using serializable data.
11428
+ */
11429
+ runInNRenderFrames(func: () => void, renderFrames: int): void;
11430
+ /**
11431
+ * Supply a function to run on the next `POST_UPDATE` callback.
11432
+ *
11433
+ * For example:
11434
+ *
11435
+ * ```ts
11436
+ * const NUM_EXPLODER_EXPLOSIONS = 5;
11437
+ *
11438
+ * function useItemExploder(player: EntityPlayer) {
11439
+ * playSound("exploderBegin");
11440
+ * explode(player, NUM_EXPLODER_EXPLOSIONS);
11441
+ * }
11442
+ *
11443
+ * function explode(player: EntityPlayer, numFramesLeft: int) {
11444
+ * Isaac.Explode(player, undefined, 1);
11445
+ * numFramesLeft -= 1;
11446
+ * if (numFramesLeft === 0) {
11447
+ * runNextFrame(() => {
11448
+ * explode(player, numFramesLeft);
11449
+ * });
11450
+ * }
11451
+ * }
11452
+ * ```
11453
+ *
11454
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11455
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11456
+ * deferred functions manually using serializable data.
11457
+ */
11458
+ runNextGameFrame(func: () => void): void;
11459
+ /**
11460
+ * Supply a function to run on the next `POST_RENDER` callback.
11461
+ *
11462
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11463
+ * similar way.
11464
+ *
11465
+ * Note that this function will not handle saving and quitting.
11466
+ */
11467
+ runNextRenderFrame(func: () => void): void;
11468
+ /**
11469
+ * Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
11470
+ * callback. The function will continue to be fired until `false` is returned from the function.
11471
+ *
11472
+ * This is similar to the `setInterval` vanilla JavaScript function, except there is no
11473
+ * corresponding `clearInterval` function. (Instead, the return value from the supplied function
11474
+ * is used to stop the interval.)
11475
+ *
11476
+ * Note that this function will not handle saving and quitting. You must manually restart any
11477
+ * intervals if the player saves and quits in the middle of a run.
11478
+ *
11479
+ * @param func The function to repeatedly run on an interval.
11480
+ * @param gameFrames The amount of game frames to wait between each run.
11481
+ * @param runImmediately Whether or not to execute the function right now before waiting for the
11482
+ * interval.
11483
+ */
11484
+ setIntervalGameFrames(func: () => boolean, gameFrames: int, runImmediately: boolean): void;
11485
+ /**
11486
+ * Supply a function to be repeatedly run on an interval of N render frames in the `POST_RENDER`
11487
+ * callback. The function will continue to be fired until `false` is returned from the function.
11488
+ *
11489
+ * This is similar to the `setInterval` vanilla JavaScript function, except there is no
11490
+ * corresponding `clearInterval` function. (Instead, the return value from the supplied function
11491
+ * is used to stop the interval.)
11492
+ *
11493
+ * Note that this function will not handle saving and quitting. You must manually restart any
11494
+ * intervals if the player saves and quits in the middle of a run.
11495
+ *
11496
+ * @param func The function to repeatedly run on an interval.
11497
+ * @param renderFrames The amount of game frames to wait between each run.
11498
+ * @param runImmediately Whether or not to execute the function right now before waiting for the
11499
+ * interval.
11500
+ */
11501
+ setIntervalRenderFrames(func: () => boolean, renderFrames: int, runImmediately: boolean): void;
11502
+ }
11503
+
10539
11504
  /**
10540
11505
  * Supply a function to run N game frames from now in the `POST_UPDATE` callback.
10541
11506
  *
@@ -10759,6 +11724,12 @@ v: SaveData, conditionalFunc: false): void;
10759
11724
  */
10760
11725
  export declare function saveDataManagerLoad(): void;
10761
11726
 
11727
+ /**
11728
+ * Removes a previously registered key from the save data manager. This is the opposite of the
11729
+ * "saveDataManager" function.
11730
+ */
11731
+ export declare function saveDataManagerRemove(key: string): void;
11732
+
10762
11733
  /**
10763
11734
  * The save data manager will automatically reset variables at the appropriate times (i.e. when a
10764
11735
  * player enters a new room). Use this function to explicitly force the save data manager to reset a
@@ -10922,12 +11893,12 @@ export declare function serializeVector(vector: Vector): SerializedVector;
10922
11893
  *
10923
11894
  * @param player The player to give the item to.
10924
11895
  * @param collectibleType The collectible type of the item to give.
10925
- * @param activeSlot The slot to set.
11896
+ * @param activeSlot Optional. The slot to set. Default is `ActiveSlot.PRIMARY`.
10926
11897
  * @param charge Optional. The argument of charges to set. If not specified, the item will be set
10927
11898
  * with maximum charges.
10928
11899
  * @param keepInPools Optional. Whether or not to remove the item from pools. Default is false.
10929
11900
  */
10930
- export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot, charge?: int, keepInPools?: boolean): void;
11901
+ export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot?: ActiveSlot, charge?: int, keepInPools?: boolean): void;
10931
11902
 
10932
11903
  /**
10933
11904
  * Helper function to add one or more elements to a set at once without having to repeatedly call
@@ -10955,7 +11926,7 @@ export declare function setAllRNGToSeed(object: unknown, seed: Seed): void;
10955
11926
  */
10956
11927
  export declare function setAllRNGToStartSeed(object: unknown): void;
10957
11928
 
10958
- /** Helper function to set the backdrop of the current room. */
11929
+ /** Helper function to set the backdrop (i.e. background) of the current room. */
10959
11930
  export declare function setBackdrop(backdropType: BackdropType): void;
10960
11931
 
10961
11932
  /**
@@ -12057,6 +13028,10 @@ export declare function stageTypeToLetter(stageType: StageType): string;
12057
13028
  */
12058
13029
  export declare function startAmbush(): void;
12059
13030
 
13031
+ export declare type StartsWithLowercase<S> = S extends string ? Extract<S, Uncapitalize<S>> : never;
13032
+
13033
+ export declare type StartsWithUppercase<S> = S extends string ? Extract<S, Capitalize<S>> : never;
13034
+
12060
13035
  /** This represents the kinds of stats that a player can have. */
12061
13036
  export declare enum StatType {
12062
13037
  /** Corresponds to `CacheFlag.DAMAGE` (1 << 0) and `EntityPlayer.Damage`. */
@@ -12123,6 +13098,14 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
12123
13098
  */
12124
13099
  export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
12125
13100
 
13101
+ declare type T = ModCallbackCustom2.POST_GRID_ENTITY_COLLISION;
13102
+
13103
+ declare type T_2 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION;
13104
+
13105
+ declare type T_3 = ModCallbackCustom2.POST_GRID_ENTITY_REMOVE;
13106
+
13107
+ declare type T_4 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE;
13108
+
12126
13109
  /**
12127
13110
  * Helper function to check if a Lua table has all of the provided keys.
12128
13111
  *
@@ -12392,6 +13375,15 @@ export declare type TSTLClass = LuaMap<AnyNotNil, unknown> & {
12392
13375
  readonly __tstlClassBrand: symbol;
12393
13376
  };
12394
13377
 
13378
+ declare interface TSTLClassMetatable {
13379
+ ____constructor: () => void;
13380
+ __index: unknown;
13381
+ constructor: {
13382
+ name: string;
13383
+ prototype: LuaMetatable<LuaMap<AnyNotNil, unknown>>;
13384
+ };
13385
+ }
13386
+
12395
13387
  /**
12396
13388
  * Helper function to sort a two-dimensional array by the first element.
12397
13389
  *
@@ -12413,6 +13405,9 @@ export declare function twoDimensionalSort<T>(array1: T[], array2: T[]): -1 | 0
12413
13405
  */
12414
13406
  export declare const UI_HEART_WIDTH = 12;
12415
13407
 
13408
+ /** A helper type to convert a union to an intersection. */
13409
+ declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
13410
+
12416
13411
  /** Helper function to put things back to normal after the `pause` function was used. */
12417
13412
  export declare function unpause(): void;
12418
13413
 
@@ -12450,6 +13445,8 @@ export declare function unsetHotkey(keyboard: Keyboard): void;
12450
13445
  * ```
12451
13446
  *
12452
13447
  * @param modVanilla The mod object returned by the `RegisterMod` function.
13448
+ * @param features Optional. An array containing the optional standard library features that you
13449
+ * want to enable, if any. Default is an empty array.
12453
13450
  * @param debug Optional. Whether to log additional output when a callback is fired. Default is
12454
13451
  * false.
12455
13452
  * @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
@@ -12457,7 +13454,9 @@ export declare function unsetHotkey(keyboard: Keyboard): void;
12457
13454
  * or milliseconds (if the "--luadebug" launch flag is turned off).
12458
13455
  * @returns The upgraded mod object.
12459
13456
  */
12460
- export declare function upgradeMod(modVanilla: Mod, debug?: boolean, timeThreshold?: float): ModUpgraded;
13457
+ export declare function upgradeMod<T extends ISCFeature = never>(modVanilla: Mod, features?: T[], debug?: boolean, timeThreshold?: float): ModUpgradedWithFeatures<T>;
13458
+
13459
+ export declare type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
12461
13460
 
12462
13461
  /**
12463
13462
  * Helper function to use an active item without showing an animation, keeping the item, or adding
@@ -12489,6 +13488,35 @@ export declare function validateCustomEnum(transpiledEnumName: string, transpile
12489
13488
  */
12490
13489
  export declare function validateEnumContiguous<T>(transpiledEnumName: string, transpiledEnum: T): void;
12491
13490
 
13491
+ /**
13492
+ * Helper function to validate that an interface contains all of the keys of an enum. You must
13493
+ * specify both generic parameters in order for this to work properly (i.e. the interface and then
13494
+ * the enum).
13495
+ *
13496
+ * For example:
13497
+ *
13498
+ * ```ts
13499
+ * enum MyEnum {
13500
+ * Value1,
13501
+ * Value2,
13502
+ * Value3,
13503
+ * }
13504
+ *
13505
+ * interface MyEnumToType {
13506
+ * [MyEnum.Value1]: boolean;
13507
+ * [MyEnum.Value2]: number;
13508
+ * [MyEnum.Value3]: string;
13509
+ * }
13510
+ *
13511
+ * validateInterfaceMatchesEnum<MyEnumToType, MyEnum>();
13512
+ * ```
13513
+ *
13514
+ * This function is only meant to be used with interfaces (i.e. types that will not exist at
13515
+ * run-time). If you are generating an object that will contain all of the keys of an enum, use the
13516
+ * `newObjectWithEnumKeys` helper function instead.
13517
+ */
13518
+ export declare function validateInterfaceMatchesEnum<T extends Record<Enum, unknown>, Enum extends string | number>(): void;
13519
+
12492
13520
  export declare function vectorEquals(vector1: Vector, vector2: Vector): boolean;
12493
13521
 
12494
13522
  /**