isaacscript-common 10.0.0 → 10.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 (88) hide show
  1. package/dist/index.d.ts +78 -22
  2. package/dist/isaacscript-common.lua +203 -102
  3. package/dist/package.lua +2 -2
  4. package/dist/src/features/deployJSONRoom.d.ts +16 -6
  5. package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
  6. package/dist/src/features/deployJSONRoom.lua +16 -6
  7. package/dist/src/features/saveDataManager/load.d.ts.map +1 -1
  8. package/dist/src/features/saveDataManager/merge.d.ts.map +1 -1
  9. package/dist/src/features/saveDataManager/saveDataManagerConstants.d.ts +1 -1
  10. package/dist/src/features/saveDataManager/saveDataManagerConstants.d.ts.map +1 -1
  11. package/dist/src/functions/bitSet128.d.ts +2 -1
  12. package/dist/src/functions/bitSet128.d.ts.map +1 -1
  13. package/dist/src/functions/bitSet128.lua +2 -2
  14. package/dist/src/functions/color.d.ts +2 -3
  15. package/dist/src/functions/color.d.ts.map +1 -1
  16. package/dist/src/functions/color.lua +2 -2
  17. package/dist/src/functions/curses.d.ts +1 -1
  18. package/dist/src/functions/curses.lua +1 -1
  19. package/dist/src/functions/deepCopy.d.ts +2 -1
  20. package/dist/src/functions/deepCopy.d.ts.map +1 -1
  21. package/dist/src/functions/deepCopy.lua +19 -25
  22. package/dist/src/functions/deepCopyTests.lua +13 -26
  23. package/dist/src/functions/doors.d.ts +9 -1
  24. package/dist/src/functions/doors.d.ts.map +1 -1
  25. package/dist/src/functions/doors.lua +8 -1
  26. package/dist/src/functions/kColor.d.ts +2 -3
  27. package/dist/src/functions/kColor.d.ts.map +1 -1
  28. package/dist/src/functions/kColor.lua +2 -2
  29. package/dist/src/functions/rng.d.ts +2 -2
  30. package/dist/src/functions/rng.d.ts.map +1 -1
  31. package/dist/src/functions/serialization.d.ts +11 -4
  32. package/dist/src/functions/serialization.d.ts.map +1 -1
  33. package/dist/src/functions/serialization.lua +15 -0
  34. package/dist/src/functions/table.d.ts +2 -2
  35. package/dist/src/functions/table.d.ts.map +1 -1
  36. package/dist/src/functions/table.lua +6 -5
  37. package/dist/src/functions/vector.d.ts +2 -1
  38. package/dist/src/functions/vector.d.ts.map +1 -1
  39. package/dist/src/functions/vector.lua +2 -2
  40. package/dist/src/functions/weighted.d.ts +6 -0
  41. package/dist/src/functions/weighted.d.ts.map +1 -0
  42. package/dist/src/functions/weighted.lua +35 -0
  43. package/dist/src/index.d.ts +2 -1
  44. package/dist/src/index.d.ts.map +1 -1
  45. package/dist/src/index.lua +8 -0
  46. package/dist/src/interfaces/SaveData.d.ts +3 -8
  47. package/dist/src/interfaces/SaveData.d.ts.map +1 -1
  48. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +1 -1
  49. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
  50. package/dist/src/objects/isaacAPIClassTypeToBrand.lua +2 -2
  51. package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts +36 -8
  52. package/dist/src/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
  53. package/dist/src/objects/isaacAPIClassTypeToFunctions.lua +42 -7
  54. package/dist/src/types/WeightedArray.d.ts +4 -0
  55. package/dist/src/types/WeightedArray.d.ts.map +1 -0
  56. package/dist/src/types/{SerializedIsaacAPIClass.lua → WeightedArray.lua} +0 -0
  57. package/package.json +2 -2
  58. package/src/callbacks/customRevive.ts +1 -2
  59. package/src/features/deployJSONRoom.ts +16 -6
  60. package/src/features/saveDataManager/exports.ts +1 -1
  61. package/src/features/saveDataManager/load.ts +0 -2
  62. package/src/features/saveDataManager/merge.ts +0 -3
  63. package/src/features/saveDataManager/saveDataManagerConstants.ts +1 -1
  64. package/src/functions/bitSet128.ts +8 -2
  65. package/src/functions/color.ts +8 -2
  66. package/src/functions/curses.ts +1 -1
  67. package/src/functions/deepCopy.ts +25 -23
  68. package/src/functions/deepCopyTests.ts +19 -41
  69. package/src/functions/doors.ts +13 -1
  70. package/src/functions/initArray.ts +1 -1
  71. package/src/functions/kColor.ts +8 -2
  72. package/src/functions/rng.ts +2 -0
  73. package/src/functions/serialization.ts +72 -18
  74. package/src/functions/table.ts +8 -5
  75. package/src/functions/vector.ts +11 -3
  76. package/src/functions/weighted.ts +36 -0
  77. package/src/index.ts +2 -1
  78. package/src/interfaces/SaveData.ts +4 -3
  79. package/src/objects/isaacAPIClassTypeToBrand.ts +1 -1
  80. package/src/objects/isaacAPIClassTypeToFunctions.ts +58 -9
  81. package/src/types/WeightedArray.ts +2 -0
  82. package/dist/src/enums/private/CopyableIsaacAPIClassType.d.ts +0 -12
  83. package/dist/src/enums/private/CopyableIsaacAPIClassType.d.ts.map +0 -1
  84. package/dist/src/enums/private/CopyableIsaacAPIClassType.lua +0 -10
  85. package/dist/src/types/SerializedIsaacAPIClass.d.ts +0 -11
  86. package/dist/src/types/SerializedIsaacAPIClass.d.ts.map +0 -1
  87. package/src/enums/private/CopyableIsaacAPIClassType.ts +0 -11
  88. package/src/types/SerializedIsaacAPIClass.ts +0 -9
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import { CollectiblePedestalType } from 'isaac-typescript-definitions';
17
17
  import { CollectibleType } from 'isaac-typescript-definitions';
18
18
  import { Controller } from 'isaac-typescript-definitions';
19
19
  import { ControllerIndex } from 'isaac-typescript-definitions';
20
+ import { CopyableIsaacAPIClassType } from 'isaac-typescript-definitions';
20
21
  import { CrawlSpaceVariant } from 'isaac-typescript-definitions';
21
22
  import { DamageFlag } from 'isaac-typescript-definitions';
22
23
  import { DiceFloorSubType } from 'isaac-typescript-definitions';
@@ -915,6 +916,9 @@ export declare function convertDecimalToBinary(number: number, minLength?: int):
915
916
  */
916
917
  export declare function convertXMLGridEntityType(gridEntityXMLType: GridEntityXMLType, gridEntityXMLVariant: int): [GridEntityType, int] | undefined;
917
918
 
919
+ /** A type representing an Isaac API class that can be safely copied or serialized. */
920
+ declare type CopyableIsaacAPIClass = BitSet128 | Color | KColor | RNG | Vector;
921
+
918
922
  /**
919
923
  * Helper function to perform a shallow copy.
920
924
  *
@@ -936,7 +940,7 @@ export declare function copyColor(color: Color): Color;
936
940
  *
937
941
  * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
938
942
  */
939
- export declare function copyIsaacAPIClass(isaacAPIClass: unknown): unknown;
943
+ export declare function copyIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaacAPIClass: T): T;
940
944
 
941
945
  /** Helper function to copy a `KColor` Isaac API class. */
942
946
  export declare function copyKColor(kColor: KColor): KColor;
@@ -950,8 +954,8 @@ export declare function copyRNG(rng: RNG): RNG;
950
954
  /** Helper function to copy a set. (You can also use a Set constructor to accomplish this task.) */
951
955
  export declare function copySet<T>(oldSet: Set<T> | ReadonlySet<T>): Set<T>;
952
956
 
953
- /** Helper function to copy specific values from a object to a table. */
954
- export declare function copyValuesToTable(object: unknown, keys: string[], luaMap: LuaMap<string, unknown>): void;
957
+ /** Helper function to copy specific values from a userdata object (e.g. `Vector`) to a table. */
958
+ export declare function copyUserdataValuesToTable(object: unknown, keys: string[], luaMap: LuaMap<string, unknown>): void;
955
959
 
956
960
  /** Helper function to copy a `Vector` Isaac API class. */
957
961
  export declare function copyVector(vector: Vector): Vector;
@@ -1545,7 +1549,9 @@ export declare interface CustomStageTSConfig {
1545
1549
  * @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
1546
1550
  * recursively copying a TSTL Map. Default is false.
1547
1551
  */
1548
- export declare function deepCopy(value: unknown, serializationType?: SerializationType, traversalDescription?: string, insideMap?: boolean): unknown;
1552
+ export declare function deepCopy<T>(value: T, serializationType?: SerializationType.NONE, traversalDescription?: string, insideMap?: boolean): T;
1553
+
1554
+ export declare function deepCopy(value: unknown, serializationType: SerializationType, traversalDescription?: string, insideMap?: boolean): unknown;
1549
1555
 
1550
1556
  export declare const DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2;
1551
1557
 
@@ -1701,16 +1707,21 @@ export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: A
1701
1707
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
1702
1708
  * all of the entries and grid entities in the provided JSON room.
1703
1709
  *
1710
+ * You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
1711
+ * my-rooms.xml`).
1712
+ *
1704
1713
  * This function is meant to be used in the `POST_NEW_ROOM` callback.
1705
1714
  *
1706
1715
  * For example:
1707
1716
  *
1708
1717
  * ```ts
1709
1718
  *
1710
- * import customRooms from "./customRooms";
1719
+ * import customRooms from "./customRooms.json";
1711
1720
  *
1712
- * const firstJSONRoom = customRooms.rooms.room[0];
1713
- * deployJSONRoom(firstJSONRoom);
1721
+ * export function postNewRoom(): void {
1722
+ * const firstJSONRoom = customRooms.rooms.room[0];
1723
+ * deployJSONRoom(firstJSONRoom);
1724
+ * }
1714
1725
  * ```
1715
1726
  *
1716
1727
  * @param jsonRoom The JSON room to deploy. *
@@ -1726,6 +1737,9 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
1726
1737
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
1727
1738
  * all of the entries and grid entities in one of the provided JSON rooms.
1728
1739
  *
1740
+ * You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
1741
+ * my-rooms.xml`).
1742
+ *
1729
1743
  * This function is meant to be used in the `POST_NEW_ROOM` callback.
1730
1744
  *
1731
1745
  * Note that this function does not simply choose a random element in the provided array; it will
@@ -1735,10 +1749,12 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
1735
1749
  * For example:
1736
1750
  *
1737
1751
  * ```ts
1738
- * import customRooms from "./customRooms";
1752
+ * import customRooms from "./customRooms.json";
1739
1753
  *
1740
- * const jsonRooms = customRooms.rooms.room;
1741
- * deployRandomJSONRoom(jsonRooms);
1754
+ * export function postNewRoom(): void {
1755
+ * const jsonRooms = customRooms.rooms.room;
1756
+ * deployRandomJSONRoom(jsonRooms);
1757
+ * }
1742
1758
  * ```
1743
1759
  *
1744
1760
  * @param jsonRooms An array of JSON rooms to randomly select from. In practice, this will be
@@ -1769,7 +1785,7 @@ export declare function deserializeColor(color: SerializedColor): Color;
1769
1785
  *
1770
1786
  * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
1771
1787
  */
1772
- export declare function deserializeIsaacAPIClass(serializedIsaacAPIClass: unknown): unknown;
1788
+ export declare function deserializeIsaacAPIClass<SerializedT extends SerializedIsaacAPIClass>(serializedIsaacAPIClass: SerializedT): IsaacAPIClassTypeToType[SerializedT["__kind"]];
1773
1789
 
1774
1790
  /**
1775
1791
  * Helper function to convert a `SerializedKColor` object to a normal `KColor` object. (This is used
@@ -2901,7 +2917,7 @@ export declare function getCrawlSpaces(crawlSpaceVariant?: CrawlSpaceVariant): G
2901
2917
  /**
2902
2918
  * Helper function to get the actual bit flag for modded curses.
2903
2919
  *
2904
- * Will throw a runtime error if the provided curse does not exist.
2920
+ * Will throw a run-time error if the provided curse does not exist.
2905
2921
  *
2906
2922
  * Use this over the `Isaac.GetCurseIdByName` method because that will return an integer instead of
2907
2923
  * a bit flag.
@@ -4453,6 +4469,9 @@ export declare function getRandomEnumValue<T>(transpiledEnum: T, seedOrRNG?: See
4453
4469
  */
4454
4470
  export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RNG): float;
4455
4471
 
4472
+ /** Get a random value from a `WeightedArray`. (The second element in the array is the weight.) */
4473
+ export declare function getRandomFromWeightedArray<T>(weightedArray: WeightedArray<T>, seedOrRNG?: Seed | RNG): T;
4474
+
4456
4475
  /**
4457
4476
  * This returns a random integer between min and max. It is inclusive on both ends.
4458
4477
  *
@@ -5254,7 +5273,10 @@ export declare function getTrinketTypes(): TrinketType[];
5254
5273
  */
5255
5274
  export declare function getTSTLClassName(object: unknown): string | undefined;
5256
5275
 
5257
- /** Helper function to find unused door slots in the room that can be used to make custom doors. */
5276
+ /**
5277
+ * Helper function to find unused door slots in the current room that can be used to make custom
5278
+ * doors.
5279
+ */
5258
5280
  export declare function getUnusedDoorSlots(): DoorSlot[];
5259
5281
 
5260
5282
  /** Helper function to get an array with every valid vanilla card sub-type. */
@@ -5439,6 +5461,12 @@ export declare function hasOpenTrinketSlot(player: EntityPlayer): boolean;
5439
5461
  */
5440
5462
  export declare function hasSirenStolenFamiliar(familiar: EntityFamiliar): boolean;
5441
5463
 
5464
+ /**
5465
+ * Helper function to check if the current room has one or more open door slots that can be used to
5466
+ * make custom doors.
5467
+ */
5468
+ export declare function hasUnusedDoorSlot(): boolean;
5469
+
5442
5470
  /**
5443
5471
  * Helper function to check if a player has previous visited a particular stage (or stage + stage
5444
5472
  * type combination) on this run.
@@ -5669,6 +5697,22 @@ export declare function irange(start: int, end?: int): int[];
5669
5697
  */
5670
5698
  export declare function isaacAPIClassEquals(object1: unknown, object2: unknown, keys: string[]): boolean;
5671
5699
 
5700
+ declare interface IsaacAPIClassTypeToSerializedType {
5701
+ [CopyableIsaacAPIClassType.BIT_SET_128]: SerializedBitSet128;
5702
+ [CopyableIsaacAPIClassType.COLOR]: SerializedColor;
5703
+ [CopyableIsaacAPIClassType.K_COLOR]: SerializedKColor;
5704
+ [CopyableIsaacAPIClassType.RNG]: SerializedRNG;
5705
+ [CopyableIsaacAPIClassType.VECTOR]: SerializedVector;
5706
+ }
5707
+
5708
+ declare interface IsaacAPIClassTypeToType {
5709
+ [CopyableIsaacAPIClassType.BIT_SET_128]: BitSet128;
5710
+ [CopyableIsaacAPIClassType.COLOR]: Color;
5711
+ [CopyableIsaacAPIClassType.K_COLOR]: KColor;
5712
+ [CopyableIsaacAPIClassType.RNG]: RNG;
5713
+ [CopyableIsaacAPIClassType.VECTOR]: Vector;
5714
+ }
5715
+
5672
5716
  /** Iterates over all inputs to determine if a particular button is pressed (i.e. held down). */
5673
5717
  export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): boolean;
5674
5718
 
@@ -5836,6 +5880,14 @@ export declare function isCollectibleUnlocked(collectibleType: CollectibleType,
5836
5880
  /** Helper function to check if something is an instantiated `Color` object. */
5837
5881
  export declare function isColor(object: unknown): object is Color;
5838
5882
 
5883
+ /**
5884
+ * Helper function to generically check if a given object is a copyable Isaac API class. (This is
5885
+ * used by the save data manager when determining what is safe to copy.)
5886
+ *
5887
+ * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
5888
+ */
5889
+ export declare function isCopyableIsaacAPIClass(object: unknown): object is CopyableIsaacAPIClass;
5890
+
5839
5891
  /**
5840
5892
  * Helper function to check if a `GridEntity` is a custom grid entity or if a grid index has a
5841
5893
  * custom grid entity.
@@ -10389,7 +10441,7 @@ export declare const SECOND_IN_MILLISECONDS = 1000;
10389
10441
  * The recursive nature of this type is based on the `Immutable` type:
10390
10442
  * https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
10391
10443
  */
10392
- declare type Serializable<T> = T extends SerializablePrimitive ? T : T extends SerializableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : SerializableObject<T>;
10444
+ declare type Serializable<T> = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : SerializableObject<T>;
10393
10445
 
10394
10446
  declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
10395
10447
 
@@ -10397,9 +10449,7 @@ declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
10397
10449
  * This is mostly copied from the `Serializable` type. The difference is that we want to disallow
10398
10450
  * classes with methods.
10399
10451
  */
10400
- declare type SerializableInsideArrayOrMap<T> = T extends SerializablePrimitive ? T : T extends SerializableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : T extends HasMethods<T> ? ErrorCustomClassNotSerializable : T extends Function ? FunctionIsNotSerializable : SerializableObject<T>;
10401
-
10402
- declare type SerializableIsaacAPIClass = BitSet128 | Color | KColor | RNG | Vector;
10452
+ declare type SerializableInsideArrayOrMap<T> = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : T extends HasMethods<T> ? ErrorCustomClassNotSerializable : T extends Function ? FunctionIsNotSerializable : SerializableObject<T>;
10403
10453
 
10404
10454
  declare type SerializableMap<K, V> = Map<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
10405
10455
 
@@ -10438,32 +10488,35 @@ export declare function serializeColor(color: Color): SerializedColor;
10438
10488
 
10439
10489
  export declare type SerializedBitSet128 = LuaMap<string, unknown> & {
10440
10490
  readonly __serializedBitSet128Brand: symbol;
10491
+ readonly __kind: CopyableIsaacAPIClassType.BIT_SET_128;
10441
10492
  };
10442
10493
 
10443
10494
  export declare type SerializedColor = LuaMap<string, unknown> & {
10444
10495
  readonly __serializedColorBrand: symbol;
10496
+ readonly __kind: CopyableIsaacAPIClassType.COLOR;
10445
10497
  };
10446
10498
 
10447
10499
  /**
10448
- * This is a type representing an Isaac API class like `Color` or `RNG` that has been written to the
10500
+ * A type representing an Isaac API class like `Color` or `RNG` that has been written to the
10449
10501
  * "save#.dat" file. It is used by the save data manager when reading and writing to that file.
10450
10502
  *
10451
10503
  * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
10452
10504
  */
10453
- export declare type SerializedIsaacAPIClass = LuaMap<string, unknown> & {
10454
- readonly __serializedIsaacAPIClassBrand: symbol;
10455
- };
10505
+ declare type SerializedIsaacAPIClass = SerializedBitSet128 | SerializedColor | SerializedKColor | SerializedRNG | SerializedVector;
10456
10506
 
10457
10507
  export declare type SerializedKColor = LuaMap<string, unknown> & {
10458
10508
  readonly __serializedKColorBrand: symbol;
10509
+ readonly __kind: CopyableIsaacAPIClassType.K_COLOR;
10459
10510
  };
10460
10511
 
10461
10512
  export declare type SerializedRNG = LuaMap<string, unknown> & {
10462
10513
  readonly __serializedRNGBrand: symbol;
10514
+ readonly __kind: CopyableIsaacAPIClassType.RNG;
10463
10515
  };
10464
10516
 
10465
10517
  export declare type SerializedVector = LuaMap<string, unknown> & {
10466
10518
  readonly __serializedVectorBrand: symbol;
10519
+ readonly __kind: CopyableIsaacAPIClassType.VECTOR;
10467
10520
  };
10468
10521
 
10469
10522
  /**
@@ -10472,7 +10525,7 @@ export declare type SerializedVector = LuaMap<string, unknown> & {
10472
10525
  *
10473
10526
  * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
10474
10527
  */
10475
- export declare function serializeIsaacAPIClass(isaacAPIClass: unknown): unknown;
10528
+ export declare function serializeIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaacAPIClass: T): IsaacAPIClassTypeToSerializedType[T["__kind"]];
10476
10529
 
10477
10530
  /**
10478
10531
  * Helper function to convert a `KColor` object to a `SerializedKColor` object. (This is used by the
@@ -12032,6 +12085,9 @@ export declare function vectorToString(vector: Vector, round?: boolean): string;
12032
12085
  */
12033
12086
  export declare const VectorZero: Readonly<Vector>;
12034
12087
 
12088
+ /** An array where each element is paired with a number indicating that elements 'weight'. */
12089
+ export declare type WeightedArray<T> = Array<[T, float]>;
12090
+
12035
12091
  /**
12036
12092
  * Assuming that we are on the frame of fatal damage, this function returns whether or not
12037
12093
  * Mysterious Paper would rotate to Missing Poster on the frame that the "Game Over" screen would