isaacscript-common 20.12.1 → 20.12.2
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 +4 -2
- package/dist/isaacscript-common.lua +1 -1
- package/dist/src/functions/modFeatures.d.ts +3 -1
- package/dist/src/functions/modFeatures.d.ts.map +1 -1
- package/dist/src/types/AnyClass.d.ts +1 -1
- package/dist/src/types/AnyClass.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/functions/modFeatures.ts +4 -4
- package/src/types/AnyClass.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -787,7 +787,7 @@ export declare enum AmbushType {
|
|
|
787
787
|
export declare function angleToDirection(angleDegrees: int): Direction;
|
|
788
788
|
|
|
789
789
|
/** Helper type to represent any class. (This is the same type as any class constructor.) */
|
|
790
|
-
export declare type AnyClass = new (
|
|
790
|
+
export declare type AnyClass = new () => object;
|
|
791
791
|
|
|
792
792
|
/**
|
|
793
793
|
* A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
|
|
@@ -6965,7 +6965,9 @@ export declare function initArray<T>(defaultValue: T, size: int): T[];
|
|
|
6965
6965
|
* @returns An array of the instantiated features in the same order that the constructors were
|
|
6966
6966
|
* passed in.
|
|
6967
6967
|
*/
|
|
6968
|
-
export declare function initModFeatures(mod: ModUpgraded, modFeatures:
|
|
6968
|
+
export declare function initModFeatures<T extends ReadonlyArray<typeof ModFeature>>(mod: ModUpgraded, modFeatures: T): {
|
|
6969
|
+
[Key in keyof T]: InstanceType<T[Key]>;
|
|
6970
|
+
};
|
|
6969
6971
|
|
|
6970
6972
|
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
6971
6973
|
export declare function inLRoom(): boolean;
|
|
@@ -21,5 +21,7 @@ import { ModUpgraded } from "../types/ModUpgraded";
|
|
|
21
21
|
* @returns An array of the instantiated features in the same order that the constructors were
|
|
22
22
|
* passed in.
|
|
23
23
|
*/
|
|
24
|
-
export declare function initModFeatures(mod: ModUpgraded, modFeatures:
|
|
24
|
+
export declare function initModFeatures<T extends ReadonlyArray<typeof ModFeature>>(mod: ModUpgraded, modFeatures: T): {
|
|
25
|
+
[Key in keyof T]: InstanceType<T[Key]>;
|
|
26
|
+
};
|
|
25
27
|
//# sourceMappingURL=modFeatures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modFeatures.d.ts","sourceRoot":"","sources":["../../../src/functions/modFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"modFeatures.d.ts","sourceRoot":"","sources":["../../../src/functions/modFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,aAAa,CAAC,OAAO,UAAU,CAAC,EACxE,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,CAAC,GACb;KAAG,GAAG,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,CAY5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnyClass.d.ts","sourceRoot":"","sources":["../../../src/types/AnyClass.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"AnyClass.d.ts","sourceRoot":"","sources":["../../../src/types/AnyClass.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAAG,UAAU,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,10 +22,10 @@ import { ModUpgraded } from "../types/ModUpgraded";
|
|
|
22
22
|
* @returns An array of the instantiated features in the same order that the constructors were
|
|
23
23
|
* passed in.
|
|
24
24
|
*/
|
|
25
|
-
export function initModFeatures(
|
|
25
|
+
export function initModFeatures<T extends ReadonlyArray<typeof ModFeature>>(
|
|
26
26
|
mod: ModUpgraded,
|
|
27
|
-
modFeatures:
|
|
28
|
-
):
|
|
27
|
+
modFeatures: T,
|
|
28
|
+
): { [Key in keyof T]: InstanceType<T[Key]> } {
|
|
29
29
|
const instantiatedModFeatures: ModFeature[] = [];
|
|
30
30
|
|
|
31
31
|
for (const modFeature of modFeatures) {
|
|
@@ -36,5 +36,5 @@ export function initModFeatures(
|
|
|
36
36
|
instantiatedModFeatures.push(instantiatedModFeature);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
return instantiatedModFeatures;
|
|
39
|
+
return instantiatedModFeatures as { [Key in keyof T]: InstanceType<T[Key]> };
|
|
40
40
|
}
|
package/src/types/AnyClass.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Helper type to represent any class. (This is the same type as any class constructor.) */
|
|
2
|
-
export type AnyClass = new (
|
|
2
|
+
export type AnyClass = new () => object;
|