isaacscript-common 1.2.166 → 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.
@@ -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
@@ -16,7 +16,7 @@ function readSaveDatFile(self, mod)
16
16
  local renderFrameCount = Isaac.GetFrameCount()
17
17
  local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
18
18
  if not ok then
19
- log((("Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg)
19
+ log((("Error: Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg)
20
20
  return DEFAULT_MOD_DATA
21
21
  end
22
22
  if jsonStringOrErrMsg == nil then
@@ -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]
@@ -20,7 +20,7 @@ end
20
20
  function ____exports.jsonDecode(self, jsonString)
21
21
  local ok, luaTableOrErrMsg = pcall(tryDecode, jsonString)
22
22
  if not ok then
23
- log("Failed to convert the JSON string to a Lua table: " .. jsonString)
23
+ log("Error: Failed to convert the JSON string to a Lua table: " .. jsonString)
24
24
  return {}
25
25
  end
26
26
  return luaTableOrErrMsg
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
@@ -78,6 +78,16 @@ local function __TS__ArrayFilter(arr, callbackfn)
78
78
  return result
79
79
  end
80
80
 
81
+ local function __TS__ArrayForEach(arr, callbackFn)
82
+ do
83
+ local i = 0
84
+ while i < #arr do
85
+ callbackFn(nil, arr[i + 1], i, arr)
86
+ i = i + 1
87
+ end
88
+ end
89
+ end
90
+
81
91
  local function __TS__ArrayFind(arr, predicate)
82
92
  local len = #arr
83
93
  local k = 0
@@ -105,51 +115,6 @@ local function __TS__ArrayFindIndex(arr, callbackFn)
105
115
  return -1
106
116
  end
107
117
 
108
- local function __TS__ArrayFlat(array, depth)
109
- if depth == nil then
110
- depth = 1
111
- end
112
- local result = {}
113
- for ____, value in ipairs(array) do
114
- if depth > 0 and __TS__ArrayIsArray(value) then
115
- result = __TS__ArrayConcat(
116
- result,
117
- __TS__ArrayFlat(value, depth - 1)
118
- )
119
- else
120
- result[#result + 1] = value
121
- end
122
- end
123
- return result
124
- end
125
-
126
- local function __TS__ArrayFlatMap(array, callback)
127
- local result = {}
128
- do
129
- local i = 0
130
- while i < #array do
131
- local value = callback(nil, array[i + 1], i, array)
132
- if type(value) == "table" and __TS__ArrayIsArray(value) then
133
- result = __TS__ArrayConcat(result, value)
134
- else
135
- result[#result + 1] = value
136
- end
137
- i = i + 1
138
- end
139
- end
140
- return result
141
- end
142
-
143
- local function __TS__ArrayForEach(arr, callbackFn)
144
- do
145
- local i = 0
146
- while i < #arr do
147
- callbackFn(nil, arr[i + 1], i, arr)
148
- i = i + 1
149
- end
150
- end
151
- end
152
-
153
118
  local function __TS__ArrayIncludes(self, searchElement, fromIndex)
154
119
  if fromIndex == nil then
155
120
  fromIndex = 0
@@ -298,25 +263,32 @@ local function __TS__ArrayReverse(arr)
298
263
  return arr
299
264
  end
300
265
 
301
- local function __TS__ArraySetLength(arr, length)
302
- if length < 0 or length ~= length or length == math.huge or math.floor(length) ~= length then
303
- error(
304
- "invalid array length: " .. tostring(length),
305
- 0
306
- )
307
- end
266
+ local function __TS__ArrayShift(arr)
267
+ return table.remove(arr, 1)
268
+ end
269
+
270
+ local function __TS__ArrayUnshift(arr, ...)
271
+ local items = {...}
308
272
  do
309
- local i = #arr - 1
310
- while i >= length do
311
- arr[i + 1] = nil
273
+ local i = #items - 1
274
+ while i >= 0 do
275
+ table.insert(arr, 1, items[i + 1])
312
276
  i = i - 1
313
277
  end
314
278
  end
315
- return length
279
+ return #arr
316
280
  end
317
281
 
318
- local function __TS__ArrayShift(arr)
319
- return table.remove(arr, 1)
282
+ local function __TS__ArraySort(arr, compareFn)
283
+ if compareFn ~= nil then
284
+ table.sort(
285
+ arr,
286
+ function(a, b) return compareFn(nil, a, b) < 0 end
287
+ )
288
+ else
289
+ table.sort(arr)
290
+ end
291
+ return arr
320
292
  end
321
293
 
322
294
  local function __TS__ArraySlice(list, first, last)
@@ -361,18 +333,6 @@ local function __TS__ArraySome(arr, callbackfn)
361
333
  return false
362
334
  end
363
335
 
364
- local function __TS__ArraySort(arr, compareFn)
365
- if compareFn ~= nil then
366
- table.sort(
367
- arr,
368
- function(a, b) return compareFn(nil, a, b) < 0 end
369
- )
370
- else
371
- table.sort(arr)
372
- end
373
- return arr
374
- end
375
-
376
336
  local function __TS__ArraySplice(list, ...)
377
337
  local len = #list
378
338
  local actualArgumentCount = select("#", ...)
@@ -470,22 +430,56 @@ local function __TS__ArrayToObject(array)
470
430
  return object
471
431
  end
472
432
 
473
- local function __TS__ArrayUnshift(arr, ...)
474
- local items = {...}
433
+ local function __TS__ArrayFlat(array, depth)
434
+ if depth == nil then
435
+ depth = 1
436
+ end
437
+ local result = {}
438
+ for ____, value in ipairs(array) do
439
+ if depth > 0 and __TS__ArrayIsArray(value) then
440
+ result = __TS__ArrayConcat(
441
+ result,
442
+ __TS__ArrayFlat(value, depth - 1)
443
+ )
444
+ else
445
+ result[#result + 1] = value
446
+ end
447
+ end
448
+ return result
449
+ end
450
+
451
+ local function __TS__ArrayFlatMap(array, callback)
452
+ local result = {}
475
453
  do
476
- local i = #items - 1
477
- while i >= 0 do
478
- table.insert(arr, 1, items[i + 1])
479
- i = i - 1
454
+ local i = 0
455
+ while i < #array do
456
+ local value = callback(nil, array[i + 1], i, array)
457
+ if type(value) == "table" and __TS__ArrayIsArray(value) then
458
+ result = __TS__ArrayConcat(result, value)
459
+ else
460
+ result[#result + 1] = value
461
+ end
462
+ i = i + 1
480
463
  end
481
464
  end
482
- return #arr
465
+ return result
483
466
  end
484
467
 
485
- local function __TS__New(target, ...)
486
- local instance = setmetatable({}, target.prototype)
487
- instance:____constructor(...)
488
- return instance
468
+ local function __TS__ArraySetLength(arr, length)
469
+ if length < 0 or length ~= length or length == math.huge or math.floor(length) ~= length then
470
+ error(
471
+ "invalid array length: " .. tostring(length),
472
+ 0
473
+ )
474
+ end
475
+ do
476
+ local i = #arr - 1
477
+ while i >= length do
478
+ arr[i + 1] = nil
479
+ i = i - 1
480
+ end
481
+ end
482
+ return length
489
483
  end
490
484
 
491
485
  local function __TS__InstanceOf(obj, classTbl)
@@ -507,6 +501,12 @@ local function __TS__InstanceOf(obj, classTbl)
507
501
  return false
508
502
  end
509
503
 
504
+ local function __TS__New(target, ...)
505
+ local instance = setmetatable({}, target.prototype)
506
+ instance:____constructor(...)
507
+ return instance
508
+ end
509
+
510
510
  local function __TS__Class(self)
511
511
  local c = {prototype = {}}
512
512
  c.prototype.__index = c.prototype
@@ -829,6 +829,19 @@ local function __TS__CloneDescriptor(____bindingPattern0)
829
829
  return descriptor
830
830
  end
831
831
 
832
+ local function __TS__ObjectAssign(to, ...)
833
+ local sources = {...}
834
+ if to == nil then
835
+ return to
836
+ end
837
+ for ____, source in ipairs(sources) do
838
+ for key in pairs(source) do
839
+ to[key] = source[key]
840
+ end
841
+ end
842
+ return to
843
+ end
844
+
832
845
  local function __TS__ObjectGetOwnPropertyDescriptor(object, key)
833
846
  local metatable = getmetatable(object)
834
847
  if not metatable then
@@ -920,19 +933,6 @@ do
920
933
  end
921
934
  end
922
935
 
923
- local function __TS__ObjectAssign(to, ...)
924
- local sources = {...}
925
- if to == nil then
926
- return to
927
- end
928
- for ____, source in ipairs(sources) do
929
- for key in pairs(source) do
930
- to[key] = source[key]
931
- end
932
- end
933
- return to
934
- end
935
-
936
936
  local function __TS__Decorate(decorators, target, key, desc)
937
937
  local result = target
938
938
  do
@@ -974,55 +974,6 @@ local function __TS__DecorateParam(paramIndex, decorator)
974
974
  return function(____, target, key) return decorator(nil, target, key, paramIndex) end
975
975
  end
976
976
 
977
- local function __TS__StringAccess(self, index)
978
- if index >= 0 and index < #self then
979
- return string.sub(self, index + 1, index + 1)
980
- end
981
- end
982
-
983
- local function __TS__DelegatedYield(iterable)
984
- if type(iterable) == "string" then
985
- for index = 0, #iterable - 1 do
986
- coroutine.yield(__TS__StringAccess(iterable, index))
987
- end
988
- elseif iterable.____coroutine ~= nil then
989
- local co = iterable.____coroutine
990
- while true do
991
- local status, value = coroutine.resume(co)
992
- if not status then
993
- error(value, 0)
994
- end
995
- if coroutine.status(co) == "dead" then
996
- return value
997
- else
998
- coroutine.yield(value)
999
- end
1000
- end
1001
- elseif iterable[Symbol.iterator] then
1002
- local iterator = iterable[Symbol.iterator](iterable)
1003
- while true do
1004
- local result = iterator:next()
1005
- if result.done then
1006
- return result.value
1007
- else
1008
- coroutine.yield(result.value)
1009
- end
1010
- end
1011
- else
1012
- for ____, value in ipairs(iterable) do
1013
- coroutine.yield(value)
1014
- end
1015
- end
1016
- end
1017
-
1018
- local function __TS__ObjectGetOwnPropertyDescriptors(object)
1019
- local metatable = getmetatable(object)
1020
- if not metatable then
1021
- return {}
1022
- end
1023
- return rawget(metatable, "_descriptors") or ({})
1024
- end
1025
-
1026
977
  local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
1027
978
  do
1028
979
  local function getErrorStack(self, constructor)
@@ -1101,6 +1052,14 @@ do
1101
1052
  URIError = createErrorClass(nil, "URIError")
1102
1053
  end
1103
1054
 
1055
+ local function __TS__ObjectGetOwnPropertyDescriptors(object)
1056
+ local metatable = getmetatable(object)
1057
+ if not metatable then
1058
+ return {}
1059
+ end
1060
+ return rawget(metatable, "_descriptors") or ({})
1061
+ end
1062
+
1104
1063
  local function __TS__Delete(target, key)
1105
1064
  local descriptors = __TS__ObjectGetOwnPropertyDescriptors(target)
1106
1065
  local descriptor = descriptors[key]
@@ -1121,6 +1080,47 @@ local function __TS__Delete(target, key)
1121
1080
  return true
1122
1081
  end
1123
1082
 
1083
+ local function __TS__StringAccess(self, index)
1084
+ if index >= 0 and index < #self then
1085
+ return string.sub(self, index + 1, index + 1)
1086
+ end
1087
+ end
1088
+
1089
+ local function __TS__DelegatedYield(iterable)
1090
+ if type(iterable) == "string" then
1091
+ for index = 0, #iterable - 1 do
1092
+ coroutine.yield(__TS__StringAccess(iterable, index))
1093
+ end
1094
+ elseif iterable.____coroutine ~= nil then
1095
+ local co = iterable.____coroutine
1096
+ while true do
1097
+ local status, value = coroutine.resume(co)
1098
+ if not status then
1099
+ error(value, 0)
1100
+ end
1101
+ if coroutine.status(co) == "dead" then
1102
+ return value
1103
+ else
1104
+ coroutine.yield(value)
1105
+ end
1106
+ end
1107
+ elseif iterable[Symbol.iterator] then
1108
+ local iterator = iterable[Symbol.iterator](iterable)
1109
+ while true do
1110
+ local result = iterator:next()
1111
+ if result.done then
1112
+ return result.value
1113
+ else
1114
+ coroutine.yield(result.value)
1115
+ end
1116
+ end
1117
+ else
1118
+ for ____, value in ipairs(iterable) do
1119
+ coroutine.yield(value)
1120
+ end
1121
+ end
1122
+ end
1123
+
1124
1124
  local __TS__Generator
1125
1125
  do
1126
1126
  local function generatorIterator(self)
@@ -1937,6 +1937,115 @@ do
1937
1937
  Set[Symbol.species] = Set
1938
1938
  end
1939
1939
 
1940
+ local function __TS__SparseArrayNew(...)
1941
+ local sparseArray = {...}
1942
+ sparseArray.sparseLength = select("#", ...)
1943
+ return sparseArray
1944
+ end
1945
+
1946
+ local function __TS__SparseArrayPush(sparseArray, ...)
1947
+ local args = {...}
1948
+ local argsLen = select("#", ...)
1949
+ local listLen = sparseArray.sparseLength
1950
+ for i = 1, argsLen do
1951
+ sparseArray[listLen + i] = args[i]
1952
+ end
1953
+ sparseArray.sparseLength = listLen + argsLen
1954
+ end
1955
+
1956
+ local function __TS__SparseArraySpread(sparseArray)
1957
+ local _unpack = unpack or table.unpack
1958
+ return _unpack(sparseArray, 1, sparseArray.sparseLength)
1959
+ end
1960
+
1961
+ local WeakMap
1962
+ do
1963
+ WeakMap = __TS__Class()
1964
+ WeakMap.name = "WeakMap"
1965
+ function WeakMap.prototype.____constructor(self, entries)
1966
+ self[Symbol.toStringTag] = "WeakMap"
1967
+ self.items = {}
1968
+ setmetatable(self.items, {__mode = "k"})
1969
+ if entries == nil then
1970
+ return
1971
+ end
1972
+ local iterable = entries
1973
+ if iterable[Symbol.iterator] then
1974
+ local iterator = iterable[Symbol.iterator](iterable)
1975
+ while true do
1976
+ local result = iterator:next()
1977
+ if result.done then
1978
+ break
1979
+ end
1980
+ local value = result.value
1981
+ self.items[value[1]] = value[2]
1982
+ end
1983
+ else
1984
+ for ____, kvp in ipairs(entries) do
1985
+ self.items[kvp[1]] = kvp[2]
1986
+ end
1987
+ end
1988
+ end
1989
+ function WeakMap.prototype.delete(self, key)
1990
+ local contains = self:has(key)
1991
+ self.items[key] = nil
1992
+ return contains
1993
+ end
1994
+ function WeakMap.prototype.get(self, key)
1995
+ return self.items[key]
1996
+ end
1997
+ function WeakMap.prototype.has(self, key)
1998
+ return self.items[key] ~= nil
1999
+ end
2000
+ function WeakMap.prototype.set(self, key, value)
2001
+ self.items[key] = value
2002
+ return self
2003
+ end
2004
+ WeakMap[Symbol.species] = WeakMap
2005
+ end
2006
+
2007
+ local WeakSet
2008
+ do
2009
+ WeakSet = __TS__Class()
2010
+ WeakSet.name = "WeakSet"
2011
+ function WeakSet.prototype.____constructor(self, values)
2012
+ self[Symbol.toStringTag] = "WeakSet"
2013
+ self.items = {}
2014
+ setmetatable(self.items, {__mode = "k"})
2015
+ if values == nil then
2016
+ return
2017
+ end
2018
+ local iterable = values
2019
+ if iterable[Symbol.iterator] then
2020
+ local iterator = iterable[Symbol.iterator](iterable)
2021
+ while true do
2022
+ local result = iterator:next()
2023
+ if result.done then
2024
+ break
2025
+ end
2026
+ self.items[result.value] = true
2027
+ end
2028
+ else
2029
+ for ____, value in ipairs(values) do
2030
+ self.items[value] = true
2031
+ end
2032
+ end
2033
+ end
2034
+ function WeakSet.prototype.add(self, value)
2035
+ self.items[value] = true
2036
+ return self
2037
+ end
2038
+ function WeakSet.prototype.delete(self, value)
2039
+ local contains = self:has(value)
2040
+ self.items[value] = nil
2041
+ return contains
2042
+ end
2043
+ function WeakSet.prototype.has(self, value)
2044
+ return self.items[value] == true
2045
+ end
2046
+ WeakSet[Symbol.species] = WeakSet
2047
+ end
2048
+
1940
2049
  local function __TS__SourceMapTraceBack(fileName, sourceMap)
1941
2050
  _G.__TS__sourcemap = _G.__TS__sourcemap or ({})
1942
2051
  _G.__TS__sourcemap[fileName] = sourceMap
@@ -1979,27 +2088,6 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
1979
2088
  end
1980
2089
  end
1981
2090
 
1982
- local function __TS__SparseArrayNew(...)
1983
- local sparseArray = {...}
1984
- sparseArray.sparseLength = select("#", ...)
1985
- return sparseArray
1986
- end
1987
-
1988
- local function __TS__SparseArrayPush(sparseArray, ...)
1989
- local args = {...}
1990
- local argsLen = select("#", ...)
1991
- local listLen = sparseArray.sparseLength
1992
- for i = 1, argsLen do
1993
- sparseArray[listLen + i] = args[i]
1994
- end
1995
- sparseArray.sparseLength = listLen + argsLen
1996
- end
1997
-
1998
- local function __TS__SparseArraySpread(sparseArray)
1999
- local _unpack = unpack or table.unpack
2000
- return _unpack(sparseArray, 1, sparseArray.sparseLength)
2001
- end
2002
-
2003
2091
  local function __TS__Spread(iterable)
2004
2092
  local arr = {}
2005
2093
  if type(iterable) == "string" then
@@ -2276,197 +2364,108 @@ local function __TS__TypeOf(value)
2276
2364
  end
2277
2365
  end
2278
2366
 
2279
- local WeakMap
2280
- do
2281
- WeakMap = __TS__Class()
2282
- WeakMap.name = "WeakMap"
2283
- function WeakMap.prototype.____constructor(self, entries)
2284
- self[Symbol.toStringTag] = "WeakMap"
2285
- self.items = {}
2286
- setmetatable(self.items, {__mode = "k"})
2287
- if entries == nil then
2288
- return
2289
- end
2290
- local iterable = entries
2291
- if iterable[Symbol.iterator] then
2292
- local iterator = iterable[Symbol.iterator](iterable)
2293
- while true do
2294
- local result = iterator:next()
2295
- if result.done then
2296
- break
2297
- end
2298
- local value = result.value
2299
- self.items[value[1]] = value[2]
2300
- end
2301
- else
2302
- for ____, kvp in ipairs(entries) do
2303
- self.items[kvp[1]] = kvp[2]
2304
- end
2305
- end
2306
- end
2307
- function WeakMap.prototype.delete(self, key)
2308
- local contains = self:has(key)
2309
- self.items[key] = nil
2310
- return contains
2311
- end
2312
- function WeakMap.prototype.get(self, key)
2313
- return self.items[key]
2314
- end
2315
- function WeakMap.prototype.has(self, key)
2316
- return self.items[key] ~= nil
2317
- end
2318
- function WeakMap.prototype.set(self, key, value)
2319
- self.items[key] = value
2320
- return self
2321
- end
2322
- WeakMap[Symbol.species] = WeakMap
2323
- end
2324
-
2325
- local WeakSet
2326
- do
2327
- WeakSet = __TS__Class()
2328
- WeakSet.name = "WeakSet"
2329
- function WeakSet.prototype.____constructor(self, values)
2330
- self[Symbol.toStringTag] = "WeakSet"
2331
- self.items = {}
2332
- setmetatable(self.items, {__mode = "k"})
2333
- if values == nil then
2334
- return
2335
- end
2336
- local iterable = values
2337
- if iterable[Symbol.iterator] then
2338
- local iterator = iterable[Symbol.iterator](iterable)
2339
- while true do
2340
- local result = iterator:next()
2341
- if result.done then
2342
- break
2343
- end
2344
- self.items[result.value] = true
2345
- end
2346
- else
2347
- for ____, value in ipairs(values) do
2348
- self.items[value] = true
2349
- end
2350
- end
2351
- end
2352
- function WeakSet.prototype.add(self, value)
2353
- self.items[value] = true
2354
- return self
2355
- end
2356
- function WeakSet.prototype.delete(self, value)
2357
- local contains = self:has(value)
2358
- self.items[value] = nil
2359
- return contains
2360
- end
2361
- function WeakSet.prototype.has(self, value)
2362
- return self.items[value] == true
2363
- end
2364
- WeakSet[Symbol.species] = WeakSet
2365
- end
2366
-
2367
-
2368
2367
  return {
2369
- __TS__ArrayConcat = __TS__ArrayConcat,
2370
- __TS__ArrayEntries = __TS__ArrayEntries,
2371
- __TS__ArrayEvery = __TS__ArrayEvery,
2372
- __TS__ArrayFilter = __TS__ArrayFilter,
2373
- __TS__ArrayFind = __TS__ArrayFind,
2374
- __TS__ArrayFindIndex = __TS__ArrayFindIndex,
2375
- __TS__ArrayFlat = __TS__ArrayFlat,
2376
- __TS__ArrayFlatMap = __TS__ArrayFlatMap,
2377
- __TS__ArrayForEach = __TS__ArrayForEach,
2378
- __TS__ArrayIncludes = __TS__ArrayIncludes,
2379
- __TS__ArrayIndexOf = __TS__ArrayIndexOf,
2380
- __TS__ArrayIsArray = __TS__ArrayIsArray,
2381
- __TS__ArrayJoin = __TS__ArrayJoin,
2382
- __TS__ArrayMap = __TS__ArrayMap,
2383
- __TS__ArrayPush = __TS__ArrayPush,
2384
- __TS__ArrayReduce = __TS__ArrayReduce,
2385
- __TS__ArrayReduceRight = __TS__ArrayReduceRight,
2386
- __TS__ArrayReverse = __TS__ArrayReverse,
2387
- __TS__ArraySetLength = __TS__ArraySetLength,
2388
- __TS__ArrayShift = __TS__ArrayShift,
2389
- __TS__ArraySlice = __TS__ArraySlice,
2390
- __TS__ArraySome = __TS__ArraySome,
2391
- __TS__ArraySort = __TS__ArraySort,
2392
- __TS__ArraySplice = __TS__ArraySplice,
2393
- __TS__ArrayToObject = __TS__ArrayToObject,
2394
- __TS__ArrayUnshift = __TS__ArrayUnshift,
2395
- __TS__Promise = __TS__Promise,
2396
- __TS__AsyncAwaiter = __TS__AsyncAwaiter,
2397
- __TS__Await = __TS__Await,
2398
- __TS__Class = __TS__Class,
2399
- __TS__ClassExtends = __TS__ClassExtends,
2400
- __TS__CloneDescriptor = __TS__CloneDescriptor,
2401
- __TS__ObjectGetOwnPropertyDescriptor = __TS__ObjectGetOwnPropertyDescriptor,
2402
- __TS__SetDescriptor = __TS__SetDescriptor,
2403
- __TS__Decorate = __TS__Decorate,
2404
- __TS__DecorateParam = __TS__DecorateParam,
2405
- __TS__DelegatedYield = __TS__DelegatedYield,
2406
- __TS__ObjectGetOwnPropertyDescriptors = __TS__ObjectGetOwnPropertyDescriptors,
2407
- __TS__Delete = __TS__Delete,
2408
- Error = Error,
2409
- RangeError = RangeError,
2410
- ReferenceError = ReferenceError,
2411
- SyntaxError = SyntaxError,
2412
- TypeError = TypeError,
2413
- URIError = URIError,
2414
- __TS__FunctionBind = __TS__FunctionBind,
2415
- __TS__Generator = __TS__Generator,
2416
- __TS__InstanceOf = __TS__InstanceOf,
2417
- __TS__InstanceOfObject = __TS__InstanceOfObject,
2418
- __TS__Iterator = __TS__Iterator,
2419
- Map = Map,
2420
- __TS__MathAtan2 = __TS__MathAtan2,
2421
- __TS__MathSign = __TS__MathSign,
2422
- __TS__New = __TS__New,
2423
- __TS__Number = __TS__Number,
2424
- __TS__NumberIsFinite = __TS__NumberIsFinite,
2425
- __TS__NumberIsNaN = __TS__NumberIsNaN,
2426
- __TS__NumberToString = __TS__NumberToString,
2427
- __TS__ObjectAssign = __TS__ObjectAssign,
2428
- __TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
2429
- __TS__ObjectEntries = __TS__ObjectEntries,
2430
- __TS__ObjectFromEntries = __TS__ObjectFromEntries,
2431
- __TS__ObjectKeys = __TS__ObjectKeys,
2432
- __TS__ObjectRest = __TS__ObjectRest,
2433
- __TS__ObjectValues = __TS__ObjectValues,
2434
- __TS__ParseFloat = __TS__ParseFloat,
2435
- __TS__ParseInt = __TS__ParseInt,
2436
- __TS__PromiseAll = __TS__PromiseAll,
2437
- __TS__PromiseAllSettled = __TS__PromiseAllSettled,
2438
- __TS__PromiseAny = __TS__PromiseAny,
2439
- __TS__PromiseRace = __TS__PromiseRace,
2440
- Set = Set,
2441
- __TS__SourceMapTraceBack = __TS__SourceMapTraceBack,
2442
- __TS__SparseArrayNew = __TS__SparseArrayNew,
2443
- __TS__SparseArrayPush = __TS__SparseArrayPush,
2444
- __TS__SparseArraySpread = __TS__SparseArraySpread,
2445
- __TS__Spread = __TS__Spread,
2446
- __TS__StringAccess = __TS__StringAccess,
2447
- __TS__StringCharAt = __TS__StringCharAt,
2448
- __TS__StringCharCodeAt = __TS__StringCharCodeAt,
2449
- __TS__StringConcat = __TS__StringConcat,
2450
- __TS__StringEndsWith = __TS__StringEndsWith,
2451
- __TS__StringIncludes = __TS__StringIncludes,
2452
- __TS__StringPadEnd = __TS__StringPadEnd,
2453
- __TS__StringPadStart = __TS__StringPadStart,
2454
- __TS__StringReplace = __TS__StringReplace,
2455
- __TS__StringReplaceAll = __TS__StringReplaceAll,
2456
- __TS__StringSlice = __TS__StringSlice,
2457
- __TS__StringSplit = __TS__StringSplit,
2458
- __TS__StringStartsWith = __TS__StringStartsWith,
2459
- __TS__StringSubstr = __TS__StringSubstr,
2460
- __TS__StringSubstring = __TS__StringSubstring,
2461
- __TS__StringTrim = __TS__StringTrim,
2462
- __TS__StringTrimEnd = __TS__StringTrimEnd,
2463
- __TS__StringTrimStart = __TS__StringTrimStart,
2464
- __TS__Symbol = __TS__Symbol,
2465
- Symbol = Symbol,
2466
- __TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
2467
- __TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
2468
- __TS__TypeOf = __TS__TypeOf,
2469
- __TS__Unpack = __TS__Unpack,
2470
- WeakMap = WeakMap,
2471
- WeakSet = WeakSet
2368
+ __TS__ArrayConcat = __TS__ArrayConcat,
2369
+ __TS__ArrayEntries = __TS__ArrayEntries,
2370
+ __TS__ArrayEvery = __TS__ArrayEvery,
2371
+ __TS__ArrayFilter = __TS__ArrayFilter,
2372
+ __TS__ArrayForEach = __TS__ArrayForEach,
2373
+ __TS__ArrayFind = __TS__ArrayFind,
2374
+ __TS__ArrayFindIndex = __TS__ArrayFindIndex,
2375
+ __TS__ArrayIncludes = __TS__ArrayIncludes,
2376
+ __TS__ArrayIndexOf = __TS__ArrayIndexOf,
2377
+ __TS__ArrayIsArray = __TS__ArrayIsArray,
2378
+ __TS__ArrayJoin = __TS__ArrayJoin,
2379
+ __TS__ArrayMap = __TS__ArrayMap,
2380
+ __TS__ArrayPush = __TS__ArrayPush,
2381
+ __TS__ArrayReduce = __TS__ArrayReduce,
2382
+ __TS__ArrayReduceRight = __TS__ArrayReduceRight,
2383
+ __TS__ArrayReverse = __TS__ArrayReverse,
2384
+ __TS__ArrayShift = __TS__ArrayShift,
2385
+ __TS__ArrayUnshift = __TS__ArrayUnshift,
2386
+ __TS__ArraySort = __TS__ArraySort,
2387
+ __TS__ArraySlice = __TS__ArraySlice,
2388
+ __TS__ArraySome = __TS__ArraySome,
2389
+ __TS__ArraySplice = __TS__ArraySplice,
2390
+ __TS__ArrayToObject = __TS__ArrayToObject,
2391
+ __TS__ArrayFlat = __TS__ArrayFlat,
2392
+ __TS__ArrayFlatMap = __TS__ArrayFlatMap,
2393
+ __TS__ArraySetLength = __TS__ArraySetLength,
2394
+ __TS__AsyncAwaiter = __TS__AsyncAwaiter,
2395
+ __TS__Await = __TS__Await,
2396
+ __TS__Class = __TS__Class,
2397
+ __TS__ClassExtends = __TS__ClassExtends,
2398
+ __TS__CloneDescriptor = __TS__CloneDescriptor,
2399
+ __TS__Decorate = __TS__Decorate,
2400
+ __TS__DecorateParam = __TS__DecorateParam,
2401
+ __TS__Delete = __TS__Delete,
2402
+ __TS__DelegatedYield = __TS__DelegatedYield,
2403
+ Error = Error,
2404
+ RangeError = RangeError,
2405
+ ReferenceError = ReferenceError,
2406
+ SyntaxError = SyntaxError,
2407
+ TypeError = TypeError,
2408
+ URIError = URIError,
2409
+ __TS__FunctionBind = __TS__FunctionBind,
2410
+ __TS__Generator = __TS__Generator,
2411
+ __TS__InstanceOf = __TS__InstanceOf,
2412
+ __TS__InstanceOfObject = __TS__InstanceOfObject,
2413
+ __TS__Iterator = __TS__Iterator,
2414
+ Map = Map,
2415
+ __TS__MathAtan2 = __TS__MathAtan2,
2416
+ __TS__MathSign = __TS__MathSign,
2417
+ __TS__New = __TS__New,
2418
+ __TS__Number = __TS__Number,
2419
+ __TS__NumberIsFinite = __TS__NumberIsFinite,
2420
+ __TS__NumberIsNaN = __TS__NumberIsNaN,
2421
+ __TS__NumberToString = __TS__NumberToString,
2422
+ __TS__ObjectAssign = __TS__ObjectAssign,
2423
+ __TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
2424
+ __TS__ObjectEntries = __TS__ObjectEntries,
2425
+ __TS__ObjectFromEntries = __TS__ObjectFromEntries,
2426
+ __TS__ObjectGetOwnPropertyDescriptor = __TS__ObjectGetOwnPropertyDescriptor,
2427
+ __TS__ObjectGetOwnPropertyDescriptors = __TS__ObjectGetOwnPropertyDescriptors,
2428
+ __TS__ObjectKeys = __TS__ObjectKeys,
2429
+ __TS__ObjectRest = __TS__ObjectRest,
2430
+ __TS__ObjectValues = __TS__ObjectValues,
2431
+ __TS__ParseFloat = __TS__ParseFloat,
2432
+ __TS__ParseInt = __TS__ParseInt,
2433
+ __TS__Promise = __TS__Promise,
2434
+ __TS__PromiseAll = __TS__PromiseAll,
2435
+ __TS__PromiseAllSettled = __TS__PromiseAllSettled,
2436
+ __TS__PromiseAny = __TS__PromiseAny,
2437
+ __TS__PromiseRace = __TS__PromiseRace,
2438
+ Set = Set,
2439
+ __TS__SetDescriptor = __TS__SetDescriptor,
2440
+ __TS__SparseArrayNew = __TS__SparseArrayNew,
2441
+ __TS__SparseArrayPush = __TS__SparseArrayPush,
2442
+ __TS__SparseArraySpread = __TS__SparseArraySpread,
2443
+ WeakMap = WeakMap,
2444
+ WeakSet = WeakSet,
2445
+ __TS__SourceMapTraceBack = __TS__SourceMapTraceBack,
2446
+ __TS__Spread = __TS__Spread,
2447
+ __TS__StringAccess = __TS__StringAccess,
2448
+ __TS__StringCharAt = __TS__StringCharAt,
2449
+ __TS__StringCharCodeAt = __TS__StringCharCodeAt,
2450
+ __TS__StringConcat = __TS__StringConcat,
2451
+ __TS__StringEndsWith = __TS__StringEndsWith,
2452
+ __TS__StringIncludes = __TS__StringIncludes,
2453
+ __TS__StringPadEnd = __TS__StringPadEnd,
2454
+ __TS__StringPadStart = __TS__StringPadStart,
2455
+ __TS__StringReplace = __TS__StringReplace,
2456
+ __TS__StringReplaceAll = __TS__StringReplaceAll,
2457
+ __TS__StringSlice = __TS__StringSlice,
2458
+ __TS__StringSplit = __TS__StringSplit,
2459
+ __TS__StringStartsWith = __TS__StringStartsWith,
2460
+ __TS__StringSubstr = __TS__StringSubstr,
2461
+ __TS__StringSubstring = __TS__StringSubstring,
2462
+ __TS__StringTrim = __TS__StringTrim,
2463
+ __TS__StringTrimEnd = __TS__StringTrimEnd,
2464
+ __TS__StringTrimStart = __TS__StringTrimStart,
2465
+ __TS__Symbol = __TS__Symbol,
2466
+ Symbol = Symbol,
2467
+ __TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
2468
+ __TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
2469
+ __TS__TypeOf = __TS__TypeOf,
2470
+ __TS__Unpack = __TS__Unpack
2472
2471
  }
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?: Record<string, unknown>;
3
- run?: Record<string, unknown>;
4
- level?: Record<string, unknown>;
5
- room?: Record<string, unknown>;
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.166",
3
+ "version": "1.2.169",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,11 +25,11 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "@zamiell/typescript-to-lua": "^1.4.2",
29
- "isaac-typescript-definitions": "^1.0.370",
30
- "isaacscript-lint": "^1.0.90",
28
+ "isaac-typescript-definitions": "file:../isaac-typescript-definitions",
29
+ "isaacscript-lint": "^1.0.91",
31
30
  "isaacscript-tsconfig": "^1.1.8",
32
31
  "typedoc": "^0.22.13",
33
- "typescript": "4.5.5"
32
+ "typescript": "4.6.2",
33
+ "typescript-to-lua": "^1.4.0"
34
34
  }
35
35
  }