isaacscript-common 2.0.28 → 2.0.29
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type PostPickupCollectRegisterParameters = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
];
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare type PostPickupCollectRegisterParameters = PickupRegisterParameters<[
|
|
3
|
+
player: EntityPlayer
|
|
4
|
+
], void>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type PostPickupInitLateRegisterParameters = [
|
|
3
|
-
|
|
4
|
-
pickupVariant?: PickupVariant
|
|
5
|
-
];
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare type PostPickupInitLateRegisterParameters = PickupRegisterParameters<[
|
|
3
|
+
], void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type PostPickupStateChangedRegisterParameters = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
]
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare type PostPickupStateChangedRegisterParameters = PickupRegisterParameters<[
|
|
3
|
+
previousState: int,
|
|
4
|
+
currentState: int
|
|
5
|
+
], void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare type FactoryFunction<V,
|
|
2
|
-
declare type FirstArg<K, V,
|
|
3
|
-
declare type SecondArg<V,
|
|
1
|
+
declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs: Args) => V;
|
|
2
|
+
declare type FirstArg<K, V, Args extends unknown[]> = Iterable<[K, V]> | V | FactoryFunction<V, Args>;
|
|
3
|
+
declare type SecondArg<V, Args extends unknown[]> = V | FactoryFunction<V, Args>;
|
|
4
4
|
/**
|
|
5
5
|
* An extended Map with some new methods:
|
|
6
6
|
*
|
|
@@ -48,28 +48,28 @@ declare type SecondArg<V, A extends unknown[]> = V | FactoryFunction<V, A>;
|
|
|
48
48
|
* const defaultMapWithExtraArgs = new DefaultMap<string, string, [arg: boolean]>(factoryFunction);
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export declare class DefaultMap<K, V,
|
|
51
|
+
export declare class DefaultMap<K, V, Args extends unknown[] = []> extends Map<K, V> {
|
|
52
52
|
private defaultValue;
|
|
53
53
|
private defaultValueFactory;
|
|
54
54
|
/**
|
|
55
55
|
* See the DefaultMap documentation:
|
|
56
56
|
* https://isaacscript.github.io/isaacscript-common/classes/types_DefaultMap.DefaultMap.html
|
|
57
57
|
*/
|
|
58
|
-
constructor(iterableOrDefaultValueOrDefaultValueFactory: FirstArg<K, V,
|
|
58
|
+
constructor(iterableOrDefaultValueOrDefaultValueFactory: FirstArg<K, V, Args>, defaultValueOrDefaultValueFactory?: SecondArg<V, Args>);
|
|
59
59
|
/**
|
|
60
60
|
* If the key exists, this will return the same thing as the `get` method. Otherwise, it will set
|
|
61
61
|
* a default value to the key, and then return the default value.
|
|
62
62
|
*/
|
|
63
|
-
getAndSetDefault(key: K, ...extraArgs:
|
|
63
|
+
getAndSetDefault(key: K, ...extraArgs: Args): V;
|
|
64
64
|
/**
|
|
65
65
|
* Returns the default value to be used for a new key. (If a factory function was provided during
|
|
66
66
|
* instantiation, this will execute the factory function.)
|
|
67
67
|
*/
|
|
68
|
-
getDefaultValue(...extraArgs:
|
|
68
|
+
getDefaultValue(...extraArgs: Args): V;
|
|
69
69
|
/**
|
|
70
70
|
* Helper method for cloning the map. Returns either the default value or a reference to the
|
|
71
71
|
* factory function.
|
|
72
72
|
*/
|
|
73
|
-
getConstructorArg(): V | FactoryFunction<V,
|
|
73
|
+
getConstructorArg(): V | FactoryFunction<V, Args>;
|
|
74
74
|
}
|
|
75
75
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^2.0.
|
|
28
|
+
"isaac-typescript-definitions": "^2.0.46"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"isaacscript-lint": "^1.0.159",
|