isaacscript-common 20.3.0 → 20.3.1

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 (84) hide show
  1. package/dist/index.d.ts +16 -14
  2. package/dist/isaacscript-common.lua +10253 -10004
  3. package/dist/src/classes/ModUpgradedBase.d.ts +1 -1
  4. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +3 -3
  5. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +1 -1
  6. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
  7. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +3 -3
  8. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +1 -1
  9. package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  10. package/dist/src/classes/features/other/CustomHotkeys.lua +2 -2
  11. package/dist/src/classes/features/other/DeployJSONRoom.lua +1 -1
  12. package/dist/src/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
  13. package/dist/src/classes/features/other/ModdedElementSets.lua +3 -3
  14. package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
  15. package/dist/src/classes/features/other/PersistentEntities.lua +1 -1
  16. package/dist/src/classes/features/other/PickupIndexCreation.lua +1 -1
  17. package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
  18. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +0 -1
  19. package/dist/src/core/constants.d.ts +1 -1
  20. package/dist/src/core/constants.d.ts.map +1 -1
  21. package/dist/src/functions/cards.lua +0 -2
  22. package/dist/src/functions/entities.lua +1 -1
  23. package/dist/src/functions/hex.d.ts +4 -3
  24. package/dist/src/functions/hex.d.ts.map +1 -1
  25. package/dist/src/functions/hex.lua +8 -0
  26. package/dist/src/functions/isaacAPIClass.d.ts +1 -1
  27. package/dist/src/functions/isaacAPIClass.d.ts.map +1 -1
  28. package/dist/src/functions/levelGrid.d.ts.map +1 -1
  29. package/dist/src/functions/levelGrid.lua +2 -2
  30. package/dist/src/functions/map.d.ts +2 -2
  31. package/dist/src/functions/map.lua +1 -1
  32. package/dist/src/functions/minimap.lua +1 -1
  33. package/dist/src/functions/table.d.ts +1 -1
  34. package/dist/src/functions/table.d.ts.map +1 -1
  35. package/dist/src/functions/utils.d.ts +5 -5
  36. package/dist/src/functions/utils.d.ts.map +1 -1
  37. package/dist/src/functions/utils.lua +9 -18
  38. package/dist/src/maps/characterNameToTypeMap.d.ts +1 -1
  39. package/dist/src/maps/characterNameToTypeMap.d.ts.map +1 -1
  40. package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts +1 -1
  41. package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts.map +1 -1
  42. package/dist/src/sets/bossSets.lua +5 -5
  43. package/dist/src/sets/entitiesWithArmorSet.d.ts +1 -1
  44. package/dist/src/sets/entitiesWithArmorSet.d.ts.map +1 -1
  45. package/package.json +2 -2
  46. package/src/classes/ModUpgradedBase.ts +1 -1
  47. package/src/classes/callbacks/PostTrinketBreak.ts +2 -2
  48. package/src/classes/features/callbackLogic/CustomGridEntities.ts +3 -3
  49. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +1 -1
  50. package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +4 -6
  51. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +1 -1
  52. package/src/classes/features/other/CustomHotkeys.ts +2 -8
  53. package/src/classes/features/other/DeployJSONRoom.ts +1 -1
  54. package/src/classes/features/other/FlyingDetection.ts +2 -2
  55. package/src/classes/features/other/ItemPoolDetection.ts +3 -5
  56. package/src/classes/features/other/ModdedElementSets.ts +4 -4
  57. package/src/classes/features/other/PersistentEntities.ts +1 -4
  58. package/src/classes/features/other/PickupIndexCreation.ts +1 -1
  59. package/src/classes/features/other/PonyDetection.ts +2 -2
  60. package/src/classes/features/other/customStages/backdrop.ts +2 -2
  61. package/src/classes/features/other/customStages/streakText.ts +6 -4
  62. package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +2 -2
  63. package/src/core/constants.ts +7 -6
  64. package/src/functions/bitSet128.ts +1 -1
  65. package/src/functions/color.ts +1 -1
  66. package/src/functions/hex.ts +4 -2
  67. package/src/functions/input.ts +6 -6
  68. package/src/functions/isaacAPIClass.ts +1 -1
  69. package/src/functions/kColor.ts +1 -1
  70. package/src/functions/levelGrid.ts +3 -9
  71. package/src/functions/map.ts +2 -2
  72. package/src/functions/merge.ts +1 -1
  73. package/src/functions/minimap.ts +1 -1
  74. package/src/functions/rng.ts +1 -1
  75. package/src/functions/table.ts +1 -1
  76. package/src/functions/utils.ts +9 -15
  77. package/src/functions/vector.ts +1 -1
  78. package/src/maps/characterNameToTypeMap.ts +86 -85
  79. package/src/objects/roomShapeBounds.ts +2 -2
  80. package/src/objects/roomShapeLayoutSizes.ts +4 -4
  81. package/src/objects/roomShapeToDoorSlotCoordinates.ts +1 -1
  82. package/src/patchErrorFunctions.ts +2 -2
  83. package/src/sets/bossSets.ts +5 -5
  84. package/src/sets/entitiesWithArmorSet.ts +1 -1
package/dist/index.d.ts CHANGED
@@ -1108,7 +1108,7 @@ export declare const CARD_NAME_TO_TYPE_MAP: ReadonlyMap<string, CardType>;
1108
1108
  export declare function changeRoom(roomGridIndex: int): void;
1109
1109
 
1110
1110
  /** Maps character names to the values of the `PlayerType` enum. */
1111
- export declare const CHARACTER_NAME_TO_TYPE_MAP: Map<string, PlayerType>;
1111
+ export declare const CHARACTER_NAME_TO_TYPE_MAP: ReadonlyMap<string, PlayerType>;
1112
1112
 
1113
1113
  /**
1114
1114
  * Helper function to determine if the given character can have red heart containers. Returns true
@@ -1483,7 +1483,7 @@ export declare function copyRNG(rng: RNG): RNG;
1483
1483
  export declare function copySet<T>(oldSet: Set<T> | ReadonlySet<T>): Set<T>;
1484
1484
 
1485
1485
  /** Helper function to copy specific values from a userdata object (e.g. `Vector`) to a table. */
1486
- export declare function copyUserdataValuesToTable(object: unknown, keys: string[], luaMap: LuaMap<string, unknown>): void;
1486
+ export declare function copyUserdataValuesToTable(object: unknown, keys: string[] | readonly string[], luaMap: LuaMap<string, unknown>): void;
1487
1487
 
1488
1488
  /** Helper function to copy a `Vector` Isaac API class. */
1489
1489
  export declare function copyVector(vector: Vector): Vector;
@@ -3571,8 +3571,8 @@ export declare type EntityID = string & {
3571
3571
  * - For example, `eRange(1, 3)` will return `[1, 2]`.
3572
3572
  * - For example, `eRange(2)` will return `[0, 1]`.
3573
3573
  *
3574
- * @param start The number to start at.
3575
- * @param end Optional. The number to end at. If not specified, then the start will be 0 and the
3574
+ * @param start The integer to start at.
3575
+ * @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
3576
3576
  * first argument will be the end.
3577
3577
  * @param increment Optional. The increment to use. Default is 1.
3578
3578
  */
@@ -5126,10 +5126,10 @@ export declare function getLastFrameOfAnimation(sprite: Sprite, animation?: stri
5126
5126
  * ]);
5127
5127
  * const searchText = "f";
5128
5128
  * const match = getMapPartialMatch(map, searchText); // match is now equal to ["foo", 123]
5129
+ * ```
5129
5130
  *
5130
5131
  * @returns If a match was found, returns a tuple of the map key and value. If a match was not
5131
- * found, returns undefined.
5132
- * ```
5132
+ * found, returns undefined.
5133
5133
  */
5134
5134
  export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyMap<string, T>): [string, T] | undefined;
5135
5135
 
@@ -6819,15 +6819,17 @@ export declare enum HealthType {
6819
6819
  * Converts a hex string like "#33aa33" to a KColor object.
6820
6820
  *
6821
6821
  * @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
6822
+ * @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
6822
6823
  */
6823
- export declare function hexToColor(hexString: string, alpha: float): Color;
6824
+ export declare function hexToColor(hexString: string, alpha?: number): Color;
6824
6825
 
6825
6826
  /**
6826
6827
  * Converts a hex string like "#33aa33" to a Color object.
6827
6828
  *
6828
6829
  * @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
6830
+ * @param alpha Range is from 0 to 1. Default is 1.
6829
6831
  */
6830
- export declare function hexToKColor(hexString: string, alpha: float): KColor;
6832
+ export declare function hexToKColor(hexString: string, alpha?: number): KColor;
6831
6833
 
6832
6834
  /**
6833
6835
  * Helper type to make the given array/map/set/object recursively read-only.
@@ -7008,8 +7010,8 @@ export declare function inStartingRoom(): boolean;
7008
7010
  * - For example, `iRange(1, 3)` will return `[1, 2, 3]`.
7009
7011
  * - For example, `iRange(2)` will return `[0, 1, 2]`.
7010
7012
  *
7011
- * @param start The number to start at.
7012
- * @param end Optional. The number to end at. If not specified, then the start will be 0 and the
7013
+ * @param start The integer to start at.
7014
+ * @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
7013
7015
  * first argument will be the end.
7014
7016
  * @param increment Optional. The increment to use. Default is 1.
7015
7017
  */
@@ -7019,7 +7021,7 @@ export declare function iRange(start: int, end?: int, increment?: number): int[]
7019
7021
  * Helper function to check if an instantiated Isaac API class is equal to another one of the same
7020
7022
  * type. You must provide the list of keys to check for.
7021
7023
  */
7022
- export declare function isaacAPIClassEquals(object1: unknown, object2: unknown, keys: string[]): boolean;
7024
+ export declare function isaacAPIClassEquals(object1: unknown, object2: unknown, keys: string[] | readonly string[]): boolean;
7023
7025
 
7024
7026
  declare interface IsaacAPIClassTypeToSerializedType {
7025
7027
  [CopyableIsaacAPIClassType.BIT_SET_128]: SerializedBitSet128;
@@ -8021,7 +8023,7 @@ export declare function isVanillaWallGridIndex(gridIndex: int): boolean;
8021
8023
  export declare function isVector(object: unknown): object is Vector;
8022
8024
 
8023
8025
  /** The set of all `ItemConfigCardType` values that are not a rune or special object. */
8024
- export declare const ITEM_CONFIG_CARD_TYPES_FOR_CARDS: Set<ItemConfigCardType>;
8026
+ export declare const ITEM_CONFIG_CARD_TYPES_FOR_CARDS: ReadonlySet<ItemConfigCardType>;
8025
8027
 
8026
8028
  /**
8027
8029
  * A cached version of the class returned from the `Isaac.GetItemConfig()` constructor.
@@ -11507,7 +11509,7 @@ export declare class ModUpgradedBase implements Mod {
11507
11509
  /**
11508
11510
  * Returns the names of the exported class methods from the features that were added. This is
11509
11511
  * called from the "upgradeMod" function, but we want to mark it as private so that end-users
11510
- * don't have access to it..
11512
+ * don't have access to it.
11511
11513
  */
11512
11514
  private initOptionalFeature;
11513
11515
  /**
@@ -15095,7 +15097,7 @@ export declare function validateEnumContiguous<T>(transpiledEnumName: string, tr
15095
15097
  *
15096
15098
  * This function is only meant to be used with interfaces (i.e. types that will not exist at
15097
15099
  * run-time). If you are generating an object that will contain all of the keys of an enum, use the
15098
- * `newObjectWithEnumKeys` helper function instead.
15100
+ * `satisfies` operator with the `HasAllEnumValues` helper type instead.
15099
15101
  */
15100
15102
  export declare function validateInterfaceMatchesEnum<T extends Record<Enum, unknown>, Enum extends string | number>(): void;
15101
15103