isaacscript-common 13.3.2 → 13.3.4

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 (47) hide show
  1. package/dist/index.d.ts +28 -16
  2. package/dist/isaacscript-common.lua +4123 -4064
  3. package/dist/src/classes/CustomCallback.d.ts +8 -0
  4. package/dist/src/classes/CustomCallback.d.ts.map +1 -0
  5. package/dist/src/classes/CustomCallback.lua +28 -0
  6. package/dist/src/classes/ModUpgraded.d.ts +10 -6
  7. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  8. package/dist/src/classes/ModUpgraded.lua +6 -4
  9. package/dist/src/core/upgradeMod.d.ts +2 -1
  10. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  11. package/dist/src/core/upgradeMod.lua +2 -1
  12. package/dist/src/functions/benchmark.d.ts +0 -12
  13. package/dist/src/functions/benchmark.d.ts.map +1 -1
  14. package/dist/src/functions/benchmark.lua +0 -19
  15. package/dist/src/functions/debugFunctions.d.ts +18 -24
  16. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  17. package/dist/src/functions/debugFunctions.lua +53 -73
  18. package/dist/src/functions/dev.d.ts +20 -0
  19. package/dist/src/functions/dev.d.ts.map +1 -0
  20. package/dist/src/functions/dev.lua +36 -0
  21. package/dist/src/functions/globals.d.ts +7 -0
  22. package/dist/src/functions/globals.d.ts.map +1 -1
  23. package/dist/src/functions/globals.lua +24 -0
  24. package/dist/src/functions/gridEntitiesSpecific.d.ts.map +1 -1
  25. package/dist/src/functions/gridEntitiesSpecific.lua +6 -12
  26. package/dist/src/index.d.ts +1 -0
  27. package/dist/src/index.d.ts.map +1 -1
  28. package/dist/src/index.lua +8 -0
  29. package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts +1 -1
  30. package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
  31. package/dist/src/objects/callbackRegisterFunctions.d.ts +2 -2
  32. package/dist/src/objects/callbackRegisterFunctions.d.ts.map +1 -1
  33. package/package.json +2 -2
  34. package/src/classes/CustomCallback.ts +23 -0
  35. package/src/classes/ModUpgraded.ts +17 -7
  36. package/src/core/upgradeMod.ts +2 -1
  37. package/src/functions/benchmark.ts +0 -23
  38. package/src/functions/debugFunctions.ts +38 -55
  39. package/src/functions/dev.ts +32 -0
  40. package/src/functions/globals.ts +27 -1
  41. package/src/functions/gridEntitiesSpecific.ts +6 -18
  42. package/src/index.ts +1 -0
  43. package/src/interfaces/private/AddCallbackParameterCustom.ts +2 -2
  44. package/src/objects/callbackRegisterFunctions.ts +2 -2
  45. package/dist/src/indexLua.d.ts +0 -185
  46. package/dist/src/indexLua.d.ts.map +0 -1
  47. package/dist/src/indexLua.lua +0 -1314
package/dist/index.d.ts CHANGED
@@ -79,7 +79,7 @@ import { TrapdoorVariant } from 'isaac-typescript-definitions';
79
79
  import { TrinketType } from 'isaac-typescript-definitions';
80
80
  import { UseFlag } from 'isaac-typescript-definitions';
81
81
 
82
- declare interface AddCallbackParameterCustom {
82
+ declare interface AddCallbackParametersCustom {
83
83
  [ModCallbackCustom.POST_AMBUSH_FINISHED]: PostAmbushFinishedRegisterParameters;
84
84
  [ModCallbackCustom.POST_AMBUSH_STARTED]: PostAmbushStartedRegisterParameters;
85
85
  [ModCallbackCustom.POST_BOMB_EXPLODED]: PostBombExplodedRegisterParameters;
@@ -5203,17 +5203,24 @@ export declare function getTearsStat(fireDelay: float): float;
5203
5203
  export declare function getTeleporters(variant?: number): GridEntity[];
5204
5204
 
5205
5205
  /**
5206
- * Helper function to get the current time in seconds for benchmarking / profiling purposes.
5206
+ * Helper function to get the current time for benchmarking / profiling purposes.
5207
5207
  *
5208
- * - If the "--luadebug" flag is enabled, then this function will use the `socket.gettime` method,
5209
- * which returns the epoch timestamp in seconds (e.g. "1640320492.5779"). This is preferable over
5210
- * the `Isaac.GetTime` method, since it has one extra decimal point of precision.
5211
- * - If the "--luadebug" flag is disabled, then this function will use the `Isaac.GetTime` method,
5212
- * which returns the number of seconds since the computer's operating system was started (e.g.
5213
- * "739454.963"). (The milliseconds return value of `Isaac.GetTime` is converted to seconds to
5214
- * align with the return value of `socket.gettime`.)
5208
+ * The return value will either be in seconds or milliseconds, depending on if the "--luadebug" flag
5209
+ * is turned on or not.
5210
+ *
5211
+ * If the "--luadebug" flag is present, then this function will use the `socket.gettime` method,
5212
+ * which returns the epoch timestamp in seconds (e.g. "1640320492.5779"). This is preferable over
5213
+ * the more conventional `Isaac.GetTime` method, since it has one extra decimal point of precision.
5214
+ *
5215
+ * If the "--luadebug" flag is not present, then this function will use the `Isaac.GetTime` method,
5216
+ * which returns the number of milliseconds since the computer's operating system was started (e.g.
5217
+ * "739454963").
5218
+ *
5219
+ * @param useSocketIfAvailable Optional. Whether to use the `socket.gettime` method, if available.
5220
+ * Default is true. If set to false, the `Isaac.GetTime()` method will
5221
+ * always be used.
5215
5222
  */
5216
- export declare function getTime(): float;
5223
+ export declare function getTime(useSocketIfAvailable?: boolean): float;
5217
5224
 
5218
5225
  /** Helper function to get all of the `GridEntityTNT` in the room. */
5219
5226
  export declare function getTNT(variant?: number): GridEntityTNT[];
@@ -8613,8 +8620,7 @@ export declare enum ModCallbackCustom {
8613
8620
  /**
8614
8621
  * `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
8615
8622
  * hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
8616
- * extends the base class and adds a new method of `AddCallbackCustom`. (There is no corresponding
8617
- * `RemoveCallbackCustom`.)
8623
+ * extends the base class and adds a new method of `AddCallbackCustom`.
8618
8624
  *
8619
8625
  * To upgrade your mod, use the `upgradeMod` helper function.
8620
8626
  */
@@ -8629,17 +8635,22 @@ export declare class ModUpgraded implements Mod {
8629
8635
  Debug: boolean;
8630
8636
  TimeThreshold: float | undefined;
8631
8637
  constructor(mod: Mod, debug: boolean, timeThreshold?: float);
8632
- AddCallback<T extends ModCallback>(modCallback: T, ...args: AddCallbackParameter[T]): void;
8638
+ AddCallback<T extends ModCallback>(modCallback: T, ...args: AddCallbackParameters[T]): void;
8633
8639
  HasData(): boolean;
8634
8640
  LoadData(): string;
8635
8641
  /**
8636
8642
  * This method does not care about the tertiary argument. Regardless of the conditions of how you
8637
8643
  * registered the callback, it will be removed.
8638
8644
  */
8639
- RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameter[T][0]): void;
8645
+ RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
8640
8646
  RemoveData(): void;
8641
8647
  SaveData(data: string): void;
8642
- AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParameterCustom[T]): void;
8648
+ AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
8649
+ /**
8650
+ * This method does not care about the tertiary argument. Regardless of the conditions of how you
8651
+ * registered the callback, it will be removed.
8652
+ */
8653
+ RemoveCallbackCustom<T extends ModCallbackCustom>(modCallback: T, callback: AddCallbackParametersCustom[T][0]): void;
8643
8654
  }
8644
8655
 
8645
8656
  /**
@@ -12267,7 +12278,8 @@ export declare function unsetHotkey(keyboard: Keyboard): void;
12267
12278
  * @param debug Optional. Whether to log additional output when a callback is fired. Default is
12268
12279
  * false.
12269
12280
  * @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
12270
- * specified number of seconds.
12281
+ * specified number of seconds (if the "--luadebug" launch flag is turned on)
12282
+ * or milliseconds (if the "--luadebug" launch flag is turned off).
12271
12283
  * @returns The upgraded mod object.
12272
12284
  */
12273
12285
  export declare function upgradeMod(modVanilla: Mod, debug?: boolean, timeThreshold?: float): ModUpgraded;