isaacscript-common 72.8.0 → 72.9.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.
@@ -1230,6 +1230,14 @@ export declare function asPillEffect(num: int): PillEffect;
1230
1230
  */
1231
1231
  export declare function asPlayerType(num: int): PlayerType;
1232
1232
 
1233
+ /**
1234
+ * Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
1235
+ * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
1236
+ *
1237
+ * This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
1238
+ */
1239
+ export declare function asRoomType(num: int): RoomType;
1240
+
1233
1241
  /**
1234
1242
  * Helper function to throw an error (using the `error` Lua function) if the provided value is equal
1235
1243
  * to `undefined`.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 72.8.0
3
+ isaacscript-common 72.9.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -15871,6 +15871,9 @@ end
15871
15871
  function ____exports.asPlayerType(self, num)
15872
15872
  return num
15873
15873
  end
15874
+ function ____exports.asRoomType(self, num)
15875
+ return num
15876
+ end
15874
15877
  function ____exports.asString(self, str)
15875
15878
  return str
15876
15879
  end
@@ -1,6 +1,6 @@
1
1
  /// <reference types="@typescript-to-lua/language-extensions" />
2
2
  /// <reference types="lua-types/5.3" />
3
- import type { CardType, CollectibleType, LevelStage, NPCState, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
3
+ import type { CardType, CollectibleType, LevelStage, NPCState, PillColor, PillEffect, PlayerType, RoomType, TrinketType } from "isaac-typescript-definitions";
4
4
  /**
5
5
  * Helper function to safely cast an `int` to a `CardType`. (This is better than using the `as`
6
6
  * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
@@ -71,6 +71,13 @@ export declare function asPillEffect(num: int): PillEffect;
71
71
  * This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
72
72
  */
73
73
  export declare function asPlayerType(num: int): PlayerType;
74
+ /**
75
+ * Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
76
+ * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
77
+ *
78
+ * This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
79
+ */
80
+ export declare function asRoomType(num: int): RoomType;
74
81
  /**
75
82
  * Helper function to safely cast an enum to a `string`. (This is better than using the `as`
76
83
  * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAEtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,G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E,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAOvC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAExC;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAErE"}
@@ -72,6 +72,13 @@ end
72
72
  function ____exports.asPlayerType(self, num)
73
73
  return num
74
74
  end
75
+ --- Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
76
+ -- TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
77
+ --
78
+ -- This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
79
+ function ____exports.asRoomType(self, num)
80
+ return num
81
+ end
75
82
  --- Helper function to safely cast an enum to a `string`. (This is better than using the `as`
76
83
  -- TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
77
84
  --
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "72.8.0",
3
+ "version": "72.9.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -6,6 +6,7 @@ import type {
6
6
  PillColor,
7
7
  PillEffect,
8
8
  PlayerType,
9
+ RoomType,
9
10
  TrinketType,
10
11
  } from "isaac-typescript-definitions";
11
12
 
@@ -109,6 +110,16 @@ export function asPlayerType(num: int): PlayerType {
109
110
  return num;
110
111
  }
111
112
 
113
+ /**
114
+ * Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
115
+ * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
116
+ *
117
+ * This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
118
+ */
119
+ export function asRoomType(num: int): RoomType {
120
+ return num;
121
+ }
122
+
112
123
  /**
113
124
  * Helper function to safely cast an enum to a `string`. (This is better than using the `as`
114
125
  * TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )