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.
- package/dist/index.d.ts +28 -16
- package/dist/isaacscript-common.lua +4123 -4064
- package/dist/src/classes/CustomCallback.d.ts +8 -0
- package/dist/src/classes/CustomCallback.d.ts.map +1 -0
- package/dist/src/classes/CustomCallback.lua +28 -0
- package/dist/src/classes/ModUpgraded.d.ts +10 -6
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +6 -4
- package/dist/src/core/upgradeMod.d.ts +2 -1
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.lua +2 -1
- package/dist/src/functions/benchmark.d.ts +0 -12
- package/dist/src/functions/benchmark.d.ts.map +1 -1
- package/dist/src/functions/benchmark.lua +0 -19
- package/dist/src/functions/debugFunctions.d.ts +18 -24
- package/dist/src/functions/debugFunctions.d.ts.map +1 -1
- package/dist/src/functions/debugFunctions.lua +53 -73
- package/dist/src/functions/dev.d.ts +20 -0
- package/dist/src/functions/dev.d.ts.map +1 -0
- package/dist/src/functions/dev.lua +36 -0
- package/dist/src/functions/globals.d.ts +7 -0
- package/dist/src/functions/globals.d.ts.map +1 -1
- package/dist/src/functions/globals.lua +24 -0
- package/dist/src/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/gridEntitiesSpecific.lua +6 -12
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts +1 -1
- package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/src/objects/callbackRegisterFunctions.d.ts +2 -2
- package/dist/src/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/classes/CustomCallback.ts +23 -0
- package/src/classes/ModUpgraded.ts +17 -7
- package/src/core/upgradeMod.ts +2 -1
- package/src/functions/benchmark.ts +0 -23
- package/src/functions/debugFunctions.ts +38 -55
- package/src/functions/dev.ts +32 -0
- package/src/functions/globals.ts +27 -1
- package/src/functions/gridEntitiesSpecific.ts +6 -18
- package/src/index.ts +1 -0
- package/src/interfaces/private/AddCallbackParameterCustom.ts +2 -2
- package/src/objects/callbackRegisterFunctions.ts +2 -2
- package/dist/src/indexLua.d.ts +0 -185
- package/dist/src/indexLua.d.ts.map +0 -1
- 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
|
|
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
|
|
5206
|
+
* Helper function to get the current time for benchmarking / profiling purposes.
|
|
5207
5207
|
*
|
|
5208
|
-
*
|
|
5209
|
-
*
|
|
5210
|
-
*
|
|
5211
|
-
*
|
|
5212
|
-
*
|
|
5213
|
-
*
|
|
5214
|
-
*
|
|
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`.
|
|
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:
|
|
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:
|
|
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:
|
|
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;
|