isaacscript-common 1.2.168 → 1.2.169
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/classes/null.d.ts +15 -0
- package/dist/classes/null.lua +12 -0
- package/dist/features/saveDataManager/main.lua +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/objects/null.d.ts +0 -0
- package/dist/objects/null.lua +1 -0
- package/dist/types/private/SaveData.d.ts +16 -9
- package/package.json +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Null is a class that represents the JavaScript/TypeScript type of "null".
|
|
3
|
+
*
|
|
4
|
+
* Do not instantiate this class directly and instead use the `Nul` singleton.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Null {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Nul is a singleton that represents an instantiated version of the `Null` class.
|
|
10
|
+
*
|
|
11
|
+
* In TSTL, `null` transpiles to `nil`. This is problematic because if you use it as an object or
|
|
12
|
+
* map value, the corresponding key will be deleted. You can work around this by using this `Nul`,
|
|
13
|
+
* which is an instantiated version of the `Null` custom class.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Nul: Null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
____exports.Null = __TS__Class()
|
|
7
|
+
local Null = ____exports.Null
|
|
8
|
+
Null.name = "Null"
|
|
9
|
+
function Null.prototype.____constructor(self)
|
|
10
|
+
end
|
|
11
|
+
____exports.Nul = __TS__New(____exports.Null)
|
|
12
|
+
return ____exports
|
|
@@ -12,6 +12,8 @@ local SaveDataKeys = ____SaveDataKeys.SaveDataKeys
|
|
|
12
12
|
local ____deepCopy = require("functions.deepCopy")
|
|
13
13
|
local deepCopy = ____deepCopy.deepCopy
|
|
14
14
|
local SerializationType = ____deepCopy.SerializationType
|
|
15
|
+
local ____log = require("functions.log")
|
|
16
|
+
local log = ____log.log
|
|
15
17
|
local ____table = require("functions.table")
|
|
16
18
|
local clearTable = ____table.clearTable
|
|
17
19
|
local ____constants = require("features.saveDataManager.constants")
|
|
@@ -62,6 +64,7 @@ function restoreDefaults(self, childTableName)
|
|
|
62
64
|
if childTableName ~= SaveDataKeys.Run and childTableName ~= SaveDataKeys.Level and childTableName ~= SaveDataKeys.Room then
|
|
63
65
|
error("Unknown child table name of: " .. childTableName)
|
|
64
66
|
end
|
|
67
|
+
log("Resetting data for type: " .. childTableName)
|
|
65
68
|
for subscriberName, saveData in pairs(saveDataMap) do
|
|
66
69
|
do
|
|
67
70
|
local childTable = saveData[childTableName]
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { initCustomDoor, spawnCustomDoor, } from "./callbacks/postCustomDoorEnte
|
|
|
3
3
|
export { forceNewLevelCallback, forceNewRoomCallback, } from "./callbacks/reorderedCallbacks";
|
|
4
4
|
export * from "./classes/DefaultMap";
|
|
5
5
|
export * from "./classes/ModUpgraded";
|
|
6
|
+
export * from "./classes/Null";
|
|
6
7
|
export * from "./constants";
|
|
7
8
|
export * from "./enums/CardType";
|
|
8
9
|
export * from "./enums/CollectiblePedestalType";
|
package/dist/index.lua
CHANGED
|
@@ -38,6 +38,14 @@ do
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
|
+
do
|
|
42
|
+
local ____export = require("classes.Null")
|
|
43
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
44
|
+
if ____exportKey ~= "default" then
|
|
45
|
+
____exports[____exportKey] = ____exportValue
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
41
49
|
do
|
|
42
50
|
local ____export = require("constants")
|
|
43
51
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
declare type Primitive = boolean | number | string;
|
|
2
|
+
declare type Serializable = Primitive | unknown;
|
|
3
|
+
/**
|
|
4
|
+
* Each sub-object of save data has a string as a key, without arbitrary data as a value. However,
|
|
5
|
+
* the data has to be serializable (i.e. no `userdata` objects).
|
|
6
|
+
*/
|
|
7
|
+
declare type SaveDataGroup = Record<string, Serializable>;
|
|
8
|
+
/**
|
|
9
|
+
* The object that contains all of the variables that will be managed by the save data manager.
|
|
10
|
+
* Depending on which property is used, the variables will be reset at certain times.
|
|
11
|
+
*/
|
|
1
12
|
export interface SaveData {
|
|
2
|
-
persistent?:
|
|
3
|
-
run?:
|
|
4
|
-
level?:
|
|
5
|
-
room?:
|
|
6
|
-
}
|
|
7
|
-
export interface SaveDataWithoutRoom {
|
|
8
|
-
persistent?: Record<string, unknown>;
|
|
9
|
-
run?: Record<string, unknown>;
|
|
10
|
-
level?: Record<string, unknown>;
|
|
13
|
+
persistent?: SaveDataGroup;
|
|
14
|
+
run?: SaveDataGroup;
|
|
15
|
+
level?: SaveDataGroup;
|
|
16
|
+
room?: SaveDataGroup;
|
|
11
17
|
}
|
|
18
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.169",
|
|
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
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "
|
|
28
|
+
"isaac-typescript-definitions": "file:../isaac-typescript-definitions",
|
|
29
29
|
"isaacscript-lint": "^1.0.91",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|