isaacscript-common 2.0.34 → 2.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.
- package/README.md +1 -1
- package/classes/DefaultMap.d.ts +11 -7
- package/enums/ModCallbackCustom.d.ts +1 -1
- package/features/characterHealthConversion.d.ts +1 -2
- package/features/disableInputs.d.ts +5 -5
- package/features/disableSound.d.ts +2 -2
- package/features/saveDataManager/exports.d.ts +4 -4
- package/features/saveDataManager/load.d.ts +1 -1
- package/features/saveDataManager/main.d.ts +1 -1
- package/features/saveDataManager/maps.d.ts +1 -1
- package/features/saveDataManager/save.d.ts +1 -1
- package/functions/cards.d.ts +1 -1
- package/functions/chargeBar.d.ts +1 -8
- package/functions/color.d.ts +17 -3
- package/functions/entitySpecific.d.ts +15 -1
- package/functions/entitySpecific.lua +8 -0
- package/functions/kColor.d.ts +1 -1
- package/functions/rng.d.ts +1 -1
- package/functions/trinkets.d.ts +3 -3
- package/functions/vector.d.ts +1 -1
- package/package.json +1 -1
- package/types/ChargeBarSprites.d.ts +13 -0
- package/types/{Primitive.lua → ChargeBarSprites.lua} +0 -0
- package/types/CollectibleIndex.d.ts +2 -2
- package/types/PlayerIndex.d.ts +2 -2
- package/types/{private/SaveData.d.ts → SaveData.d.ts} +14 -8
- package/types/{private/SaveData.lua → SaveData.lua} +0 -0
- package/types/private/IsaacAPIClass.d.ts +1 -1
- package/types/private/SerializedIsaacAPIClass.d.ts +1 -1
- package/types/private/TSTLClass.d.ts +1 -1
- package/types/Primitive.d.ts +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/isaacscript-common)
|
|
4
4
|
|
|
5
|
-
This
|
|
5
|
+
This package contains helper functions and extra features for IsaacScript mods. Start by [browsing the auto-generated documentation](https://isaacscript.github.io/docs/api).
|
|
6
6
|
|
|
7
7
|
For more information about IsaacScript, see the [official website](https://isaacscript.github.io/).
|
package/classes/DefaultMap.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A function that creates the value for your default map. For example, if it was a default map
|
|
3
|
+
* containing a map, the factory function would be: `() => new Map()`
|
|
4
|
+
*/
|
|
5
|
+
export declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs: Args) => V;
|
|
2
6
|
declare type FirstArg<K, V, Args extends unknown[]> = Iterable<[K, V]> | V | FactoryFunction<V, Args>;
|
|
3
7
|
declare type SecondArg<V, Args extends unknown[]> = V | FactoryFunction<V, Args>;
|
|
4
8
|
/**
|
|
5
|
-
* An extended Map with some new methods:
|
|
9
|
+
* An extended `Map` with some new methods:
|
|
6
10
|
*
|
|
7
11
|
* - `getAndSetDefault` - If the key exists, this will return the same thing as the `get` method.
|
|
8
12
|
* Otherwise, it will set a default value to the key, and then return the default value.
|
|
@@ -17,15 +21,15 @@ declare type SecondArg<V, Args extends unknown[]> = V | FactoryFunction<V, Args>
|
|
|
17
21
|
* For example:
|
|
18
22
|
*
|
|
19
23
|
* ```ts
|
|
20
|
-
* // Initializes a new empty DefaultMap with a default value of "foo"
|
|
24
|
+
* // Initializes a new empty DefaultMap with a default value of "foo".
|
|
21
25
|
* const defaultMapWithPrimitive = new DefaultMap<string, string>("foo");
|
|
22
26
|
*
|
|
23
|
-
* // Initializes a new empty DefaultMap with a default value of a new Map
|
|
27
|
+
* // Initializes a new empty DefaultMap with a default value of a new Map.
|
|
24
28
|
* const defaultMapWithFactory = new DefaultMap<string, Map<string, string>>(() => {
|
|
25
29
|
* return new Map();
|
|
26
30
|
* })
|
|
27
31
|
*
|
|
28
|
-
* // Initializes a DefaultMap with some initial values and a default value of "bar"
|
|
32
|
+
* // Initializes a DefaultMap with some initial values and a default value of "bar".
|
|
29
33
|
* const defaultMapWithInitialValues = new DefaultMap<string, string>([
|
|
30
34
|
* ["a1", "a2"],
|
|
31
35
|
* ["b1", "b2"],
|
|
@@ -52,8 +56,8 @@ export declare class DefaultMap<K, V, Args extends unknown[] = []> extends Map<K
|
|
|
52
56
|
private defaultValue;
|
|
53
57
|
private defaultValueFactory;
|
|
54
58
|
/**
|
|
55
|
-
* See the DefaultMap documentation:
|
|
56
|
-
* https://isaacscript.github.io/isaacscript-common/classes/
|
|
59
|
+
* See the main `DefaultMap` documentation:
|
|
60
|
+
* https://isaacscript.github.io/isaacscript-common/classes/classes_DefaultMap.DefaultMap
|
|
57
61
|
*/
|
|
58
62
|
constructor(iterableOrDefaultValueOrDefaultValueFactory: FirstArg<K, V, Args>, defaultValueOrDefaultValueFactory?: SecondArg<V, Args>);
|
|
59
63
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HeartSubType, PlayerType } from "isaac-typescript-definitions";
|
|
2
|
-
declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
|
|
2
|
+
export declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to make a character that has the same health mechanic as Blue Baby (red heart
|
|
5
5
|
* containers --> soul hearts) or Dark Judas (red heart containers --> black hearts).
|
|
@@ -7,4 +7,3 @@ declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
|
|
|
7
7
|
* Call this function once at the beginning of your mod to declare the health conversion type.
|
|
8
8
|
*/
|
|
9
9
|
export declare function registerCharacterHealthConversion(playerType: PlayerType, conversionHeartSubType: ConversionHeartSubType): void;
|
|
10
|
-
export {};
|
|
@@ -11,7 +11,7 @@ export declare function enableAllInputs(key: string): void;
|
|
|
11
11
|
* Helper function to disable all inputs. This is useful because `EntityPlayer.ControlsEnabled` can
|
|
12
12
|
* be changed by the game under certain conditions.
|
|
13
13
|
*
|
|
14
|
-
* Use the
|
|
14
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
15
15
|
*
|
|
16
16
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
17
17
|
* that multiple mod features can work in tandem.
|
|
@@ -21,7 +21,7 @@ export declare function disableAllInputs(key: string): void;
|
|
|
21
21
|
* Helper function to enable all inputs besides the ones provided. This is useful because
|
|
22
22
|
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
|
|
23
23
|
*
|
|
24
|
-
* Use the
|
|
24
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
25
25
|
*
|
|
26
26
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
27
27
|
* that multiple mod features can work in tandem.
|
|
@@ -32,7 +32,7 @@ export declare function enableAllInputsExceptFor(key: string, blacklist: Set<But
|
|
|
32
32
|
* Helper function to disable all inputs besides the ones provided. This is useful because
|
|
33
33
|
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
|
|
34
34
|
*
|
|
35
|
-
* Use the
|
|
35
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
36
36
|
*
|
|
37
37
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
38
38
|
* that multiple mod features can work in tandem.
|
|
@@ -44,7 +44,7 @@ export declare function disableAllInputsExceptFor(key: string, whitelist: Set<Bu
|
|
|
44
44
|
* the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under
|
|
45
45
|
* certain conditions.
|
|
46
46
|
*
|
|
47
|
-
* Use the
|
|
47
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
48
48
|
*
|
|
49
49
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
50
50
|
* that multiple mod features can work in tandem.
|
|
@@ -54,7 +54,7 @@ export declare function disableMovementInputs(key: string): void;
|
|
|
54
54
|
* Helper function to disable only the inputs used for shooting tears. This is useful because
|
|
55
55
|
* `EntityPlayer.ControlsEnabled` can be changed by the game under certain conditions.
|
|
56
56
|
*
|
|
57
|
-
* Use the
|
|
57
|
+
* Use the `enableAllInputs` helper function to set things back to normal.
|
|
58
58
|
*
|
|
59
59
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
60
60
|
* that multiple mod features can work in tandem.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helper function to stop muting all sound effects and music.
|
|
3
3
|
*
|
|
4
|
-
* Use this function to set things back to normal after having used
|
|
4
|
+
* Use this function to set things back to normal after having used `disableAllSounds`.
|
|
5
5
|
*
|
|
6
6
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
7
7
|
* that multiple mod features can work in tandem.
|
|
@@ -10,7 +10,7 @@ export declare function enableAllSound(key: string): void;
|
|
|
10
10
|
/**
|
|
11
11
|
* Helper function to disable all sound effects and music (by constantly musting them).
|
|
12
12
|
*
|
|
13
|
-
* Use the
|
|
13
|
+
* Use the `enableAllSounds` helper function to set things back to normal.
|
|
14
14
|
*
|
|
15
15
|
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
16
16
|
* that multiple mod features can work in tandem.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaveData } from "../../types/
|
|
1
|
+
import { SaveData } from "../../types/SaveData";
|
|
2
2
|
/**
|
|
3
3
|
* This is the entry point to the save data manager, a system which provides two major features:
|
|
4
4
|
*
|
|
@@ -59,16 +59,16 @@ import { SaveData } from "../../types/private/SaveData";
|
|
|
59
59
|
* can possibly run).
|
|
60
60
|
* - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
|
|
61
61
|
*
|
|
62
|
-
* Note that before using the save data manager, you must call the
|
|
62
|
+
* Note that before using the save data manager, you must call the `upgradeMod` function.
|
|
63
63
|
*
|
|
64
64
|
* If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
|
|
65
|
-
* the main menu), then you should explicitly call the
|
|
65
|
+
* the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
|
|
66
66
|
* data manager cannot do this on its own because it cannot know when your mod features are finished
|
|
67
67
|
* initializing.)
|
|
68
68
|
*
|
|
69
69
|
* Finally, some features may have variables that need to be automatically reset per run/level, but
|
|
70
70
|
* not saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
71
|
-
* data.) For these cases, set
|
|
71
|
+
* data.) For these cases, set the second argument to `() => false`.
|
|
72
72
|
*
|
|
73
73
|
* @param key The name of the file or feature that is submitting data to be managed by the save data
|
|
74
74
|
* manager. The save data manager will throw an error if the key is already registered.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
|
-
import { SaveData } from "../../types/
|
|
3
|
+
import { SaveData } from "../../types/SaveData";
|
|
4
4
|
export declare function loadFromDisk(mod: Mod, oldSaveData: LuaTable<string, SaveData>): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SaveDataKey } from "../../enums/private/SaveDataKey";
|
|
2
|
-
import { SaveData } from "../../types/
|
|
2
|
+
import { SaveData } from "../../types/SaveData";
|
|
3
3
|
export declare function restoreDefaultSaveData(subscriberName: string, saveData: SaveData, saveDataKey: SaveDataKey): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
-
import { SaveData } from "../../types/
|
|
2
|
+
import { SaveData } from "../../types/SaveData";
|
|
3
3
|
/**
|
|
4
4
|
* The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
5
5
|
* Maps for the master map so that we can access the variables via the in-game console when
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
|
-
import { SaveData } from "../../types/
|
|
3
|
+
import { SaveData } from "../../types/SaveData";
|
|
4
4
|
export declare function saveToDisk(mod: Mod, saveDataMap: LuaTable<string, SaveData>, saveDataConditionalFuncMap: Map<string, () => boolean>): void;
|
package/functions/cards.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare function getCardDescription(card: Card): string;
|
|
|
25
25
|
export declare function getCardName(card: Card): string;
|
|
26
26
|
export declare function getCardType(card: Card): ItemConfigCardType;
|
|
27
27
|
/**
|
|
28
|
-
* Helper function to get a set of cards matching the type. Also see the
|
|
28
|
+
* Helper function to get a set of cards matching the type. Also see the `CardType` enum.
|
|
29
29
|
*
|
|
30
30
|
* This function is variadic, meaning that you can you can specify N card types to get a set
|
|
31
31
|
* containing cards that match any of the specified types.
|
package/functions/chargeBar.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
|
|
3
|
-
export interface ChargeBarSprites {
|
|
4
|
-
back: Sprite;
|
|
5
|
-
meter: Sprite;
|
|
6
|
-
meterBattery: Sprite;
|
|
7
|
-
lines: Sprite;
|
|
8
|
-
maxCharges: int;
|
|
9
|
-
}
|
|
2
|
+
import { ChargeBarSprites } from "../types/ChargeBarSprites";
|
|
10
3
|
/**
|
|
11
4
|
* Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar`
|
|
12
5
|
* helper function.
|
package/functions/color.d.ts
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SerializationType } from "../enums/SerializationType";
|
|
4
4
|
declare type SerializedColor = LuaTable<string, unknown> & {
|
|
5
|
-
__serializedColorBrand:
|
|
5
|
+
__serializedColorBrand: void;
|
|
6
6
|
};
|
|
7
7
|
interface CopyColorReturn {
|
|
8
8
|
[SerializationType.NONE]: Color;
|
|
9
9
|
[SerializationType.SERIALIZE]: SerializedColor;
|
|
10
10
|
[SerializationType.DESERIALIZE]: Color;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @category color
|
|
14
|
+
*/
|
|
12
15
|
export declare function colorEquals(color1: Color, color2: Color): boolean;
|
|
13
16
|
/**
|
|
14
17
|
* Helper function to copy a `Color` object.
|
|
@@ -16,16 +19,27 @@ export declare function colorEquals(color1: Color, color2: Color): boolean;
|
|
|
16
19
|
* @param color The Color object to copy. In the case of deserialization, this will actually be a
|
|
17
20
|
* Lua table instead of an instantiated Color class.
|
|
18
21
|
* @param serializationType Default is `SerializationType.NONE`.
|
|
22
|
+
* @category color
|
|
19
23
|
*/
|
|
20
24
|
export declare function copyColor<C extends Color | SerializedColor, S extends SerializationType>(color: C, serializationType: S): CopyColorReturn[S];
|
|
21
25
|
export declare function copyColor<C extends Color | SerializedColor>(color: C): CopyColorReturn[SerializationType.NONE];
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Returns `Color(1, 1, 1)`.
|
|
28
|
+
*
|
|
29
|
+
* @category color
|
|
30
|
+
*/
|
|
23
31
|
export declare function getDefaultColor(): Color;
|
|
24
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Helper function to check if something is an instantiated Color object.
|
|
34
|
+
*
|
|
35
|
+
* @category color
|
|
36
|
+
*/
|
|
25
37
|
export declare function isColor(object: unknown): object is Color;
|
|
26
38
|
/**
|
|
27
39
|
* Used to determine is the given table is a serialized `Color` object created by the save data
|
|
28
40
|
* manager and/or the `deepCopy` function.
|
|
41
|
+
*
|
|
42
|
+
* @category color
|
|
29
43
|
*/
|
|
30
44
|
export declare function isSerializedColor(object: unknown): object is SerializedColor;
|
|
31
45
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BombVariant, EffectVariant, EntityType, FamiliarVariant, KnifeVariant, LaserVariant, PickupVariant, ProjectileVariant, SlotVariant, TearVariant } from "isaac-typescript-definitions";
|
|
1
|
+
import { BombVariant, EffectVariant, EntityType, FamiliarVariant, KnifeVariant, LaserVariant, PickupVariant, ProjectilesMode, ProjectileVariant, SlotVariant, TearVariant } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get all of the `EntityType.BOMB` in the room.
|
|
4
4
|
*
|
|
@@ -118,6 +118,20 @@ export declare function getSlots(slotVariant?: SlotVariant, subType?: number): E
|
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
120
|
export declare function getTears(tearVariant?: TearVariant, subType?: number): EntityTear[];
|
|
121
|
+
/**
|
|
122
|
+
* The base game `EntityNPC.FireProjectiles` method does not return anything, which is a problem in
|
|
123
|
+
* situations where you need to work with the fired projectiles. This function invokes that method,
|
|
124
|
+
* and then returns the projectiles that were spawned.
|
|
125
|
+
*
|
|
126
|
+
* @param npc The EntityNPC firing projectiles.
|
|
127
|
+
* @param position The starting position of the projectiles.
|
|
128
|
+
* @param velocity The starting velocity of the projectiles.
|
|
129
|
+
* @param projectilesMode A ProjectilesMode enum value defining how to fire the projectiles.
|
|
130
|
+
* @param projectileParams A ProjectileParams object containing various parameters for the
|
|
131
|
+
* projectiles.
|
|
132
|
+
* @returns An array of EntityProjectiles containing all fired projectiles.
|
|
133
|
+
*/
|
|
134
|
+
export declare function npcFireProjectiles(npc: EntityNPC, position: Vector, velocity: Vector, projectilesMode: ProjectilesMode, projectileParams: ProjectileParams): EntityProjectile[];
|
|
121
135
|
/**
|
|
122
136
|
* Helper function to remove all of the `EntityType.BOMB` in the room.
|
|
123
137
|
*
|
|
@@ -5,6 +5,7 @@ local ____constants = require("constants")
|
|
|
5
5
|
local VectorZero = ____constants.VectorZero
|
|
6
6
|
local ____entity = require("functions.entity")
|
|
7
7
|
local getEntities = ____entity.getEntities
|
|
8
|
+
local getFilteredNewEntities = ____entity.getFilteredNewEntities
|
|
8
9
|
local removeEntities = ____entity.removeEntities
|
|
9
10
|
local spawn = ____entity.spawn
|
|
10
11
|
function ____exports.getBombs(self, bombVariant, subType)
|
|
@@ -173,6 +174,13 @@ function ____exports.getTears(self, tearVariant, subType)
|
|
|
173
174
|
end
|
|
174
175
|
return tears
|
|
175
176
|
end
|
|
177
|
+
function ____exports.npcFireProjectiles(self, npc, position, velocity, projectilesMode, projectileParams)
|
|
178
|
+
local oldEntities = ____exports.getProjectiles(nil)
|
|
179
|
+
npc:FireProjectiles(position, velocity, projectilesMode, projectileParams)
|
|
180
|
+
local newEntities = ____exports.getProjectiles(nil)
|
|
181
|
+
local filteredNewEntities = getFilteredNewEntities(nil, oldEntities, newEntities)
|
|
182
|
+
return filteredNewEntities
|
|
183
|
+
end
|
|
176
184
|
function ____exports.removeAllBombs(self, bombVariant, subType, cap)
|
|
177
185
|
local bombs = ____exports.getBombs(nil, bombVariant, subType)
|
|
178
186
|
return removeEntities(nil, bombs, cap)
|
package/functions/kColor.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SerializationType } from "../enums/SerializationType";
|
|
4
4
|
declare type SerializedKColor = LuaTable<string, unknown> & {
|
|
5
|
-
__serializedKColorBrand:
|
|
5
|
+
__serializedKColorBrand: void;
|
|
6
6
|
};
|
|
7
7
|
interface CopyKColorReturn {
|
|
8
8
|
[SerializationType.NONE]: KColor;
|
package/functions/rng.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
3
|
import { SerializationType } from "../enums/SerializationType";
|
|
4
4
|
declare type SerializedRNG = LuaTable<string, unknown> & {
|
|
5
|
-
__serializedRNGBrand:
|
|
5
|
+
__serializedRNGBrand: void;
|
|
6
6
|
};
|
|
7
7
|
interface CopyRNGReturn {
|
|
8
8
|
[SerializationType.NONE]: RNG;
|
package/functions/trinkets.d.ts
CHANGED
|
@@ -65,9 +65,9 @@ export declare function isGoldenTrinket(trinketType: TrinketType): boolean;
|
|
|
65
65
|
*
|
|
66
66
|
* @param trinket The trinket whose sprite you want to modify.
|
|
67
67
|
* @param pngPath Equal to either the spritesheet path to load (e.g.
|
|
68
|
-
* "gfx/items/
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* "gfx/items/trinkets/trinket_001_swallowedpenny.png") or undefined. If undefined,
|
|
69
|
+
* the sprite will be removed, making it appear like the collectible has already been
|
|
70
|
+
* taken by the player.
|
|
71
71
|
*/
|
|
72
72
|
export declare function setTrinketSprite(trinket: EntityPickup, pngPath: string | undefined): void;
|
|
73
73
|
export declare function trinketHasCacheFlag(trinketType: TrinketType, cacheFlag: CacheFlag): boolean;
|
package/functions/vector.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Direction } from "isaac-typescript-definitions";
|
|
3
3
|
import { SerializationType } from "../enums/SerializationType";
|
|
4
4
|
declare type SerializedVector = LuaTable<string, unknown> & {
|
|
5
|
-
__serializedVectorBrand:
|
|
5
|
+
__serializedVectorBrand: void;
|
|
6
6
|
};
|
|
7
7
|
interface CopyVectorReturn {
|
|
8
8
|
[SerializationType.NONE]: Vector;
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* A collection of the four sprites necessary in order to render a charge bar.
|
|
4
|
+
*
|
|
5
|
+
* Used in the `newChargeBarSprites` and related helper functions.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChargeBarSprites {
|
|
8
|
+
back: Sprite;
|
|
9
|
+
meter: Sprite;
|
|
10
|
+
meterBattery: Sprite;
|
|
11
|
+
lines: Sprite;
|
|
12
|
+
maxCharges: int;
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CollectibleIndex is a specific type of string; see the documentation for the
|
|
3
|
-
*
|
|
3
|
+
* `getCollectibleIndex` function. Mods can signify that data structures handle collectibles by
|
|
4
4
|
* using this type.
|
|
5
5
|
*
|
|
6
6
|
* For example:
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* This type is branded for extra type safety.
|
|
13
13
|
*/
|
|
14
14
|
export declare type CollectibleIndex = string & {
|
|
15
|
-
__collectibleIndexBrand:
|
|
15
|
+
__collectibleIndexBrand: void;
|
|
16
16
|
};
|
package/types/PlayerIndex.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
|
-
* PlayerIndex is a specific type of string; see the documentation for the
|
|
3
|
+
* PlayerIndex is a specific type of string; see the documentation for the `getPlayerIndex`
|
|
4
4
|
* function. Mods can signify that data structures handle `EntityPlayer` by using this type.
|
|
5
5
|
*
|
|
6
6
|
* For example:
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* This type is branded for extra type safety.
|
|
13
13
|
*/
|
|
14
14
|
export declare type PlayerIndex = int & {
|
|
15
|
-
__playerIndexBrand:
|
|
15
|
+
__playerIndexBrand: void;
|
|
16
16
|
};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { Primitive } from "../Primitive";
|
|
2
|
-
/**
|
|
3
|
-
* I don't know how to create a recursive type definition for only primitive values. For now, this
|
|
4
|
-
* is typed as "unknown", which provides no type safety.
|
|
5
|
-
*/
|
|
6
|
-
declare type Serializable = Primitive | unknown;
|
|
7
1
|
/**
|
|
8
2
|
* Each sub-object of save data has a string as a key, without arbitrary data as a value. However,
|
|
9
3
|
* the data has to be serializable (i.e. no `userdata` objects).
|
|
4
|
+
*
|
|
5
|
+
* The values of the save data group can only be:
|
|
6
|
+
* - `boolean`
|
|
7
|
+
* - `number`
|
|
8
|
+
* - `string`
|
|
9
|
+
* - `Map` / `DefaultMap`
|
|
10
|
+
* - `Set`
|
|
11
|
+
* - a TSTL class
|
|
12
|
+
* - serializable Isaac API classes (such as `Color`)
|
|
13
|
+
* - a sub-object or `LuaTable` that contains the above values
|
|
14
|
+
*
|
|
15
|
+
* It is not possible to create a recursive type definition that matches these properties, so this
|
|
16
|
+
* is typed as "unknown", which provides no type safety.
|
|
10
17
|
*/
|
|
11
|
-
declare type SaveDataGroup = Record<string,
|
|
18
|
+
export declare type SaveDataGroup = Record<string, unknown>;
|
|
12
19
|
/**
|
|
13
20
|
* The object that contains all of the variables that will be managed by the save data manager.
|
|
14
21
|
* Depending on which property is used, the variables will be reset at certain times.
|
|
@@ -19,4 +26,3 @@ export interface SaveData {
|
|
|
19
26
|
level?: SaveDataGroup;
|
|
20
27
|
room?: SaveDataGroup;
|
|
21
28
|
}
|
|
22
|
-
export {};
|
|
File without changes
|
package/types/Primitive.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Primitive = boolean | number | string;
|