isaacscript-common 14.1.0 → 14.1.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 +2 -5
- package/dist/isaacscript-common.lua +45 -47
- package/dist/src/callbacks.d.ts +1 -1
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/callbacks.lua +7 -16
- package/dist/src/classes/ModUpgraded.d.ts +2 -2
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +24 -2
- package/dist/src/classes/private/Feature.d.ts +0 -1
- package/dist/src/classes/private/Feature.d.ts.map +1 -1
- package/dist/src/classes/private/Feature.lua +0 -1
- package/dist/src/core/upgradeMod.lua +2 -2
- package/dist/src/decorators.d.ts +1 -0
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.lua +7 -2
- package/dist/src/functions/tstlClass.d.ts +0 -2
- package/dist/src/functions/tstlClass.d.ts.map +1 -1
- package/dist/src/functions/tstlClass.lua +0 -19
- package/dist/src/indexLua.d.ts +199 -0
- package/dist/src/indexLua.d.ts.map +1 -0
- package/dist/src/indexLua.lua +1354 -0
- package/dist/src/interfaces/TSTLClassMetatable.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/callbacks.ts +9 -9
- package/src/classes/ModUpgraded.ts +46 -4
- package/src/classes/private/Feature.ts +0 -2
- package/src/core/upgradeMod.ts +2 -2
- package/src/decorators.ts +16 -1
- package/src/functions/tstlClass.ts +0 -15
- package/src/interfaces/TSTLClassMetatable.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -2651,7 +2651,6 @@ declare class Feature {
|
|
|
2651
2651
|
featuresUsed?: ISCFeature[];
|
|
2652
2652
|
callbacksUsed?: CallbackTuple[];
|
|
2653
2653
|
customCallbacksUsed?: CustomCallbackTuple[];
|
|
2654
|
-
exportedMethods: string[];
|
|
2655
2654
|
}
|
|
2656
2655
|
|
|
2657
2656
|
export declare function fillLevelWithRedRooms(): void;
|
|
@@ -5911,8 +5910,6 @@ export declare function getTrinketTypes(): TrinketType[];
|
|
|
5911
5910
|
*/
|
|
5912
5911
|
export declare function getTSTLClassConstructor(object: unknown): TSTLClassMetatable["constructor"] | undefined;
|
|
5913
5912
|
|
|
5914
|
-
export declare function getTSTLClassMethods(object: unknown): FunctionTuple[];
|
|
5915
|
-
|
|
5916
5913
|
/**
|
|
5917
5914
|
* Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
|
|
5918
5915
|
*
|
|
@@ -9520,8 +9517,8 @@ export declare class ModUpgraded implements Mod {
|
|
|
9520
9517
|
*/
|
|
9521
9518
|
RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
|
|
9522
9519
|
/**
|
|
9523
|
-
* This method should only be used by the `upgradeMod` function. Returns the
|
|
9524
|
-
* the features that were added.
|
|
9520
|
+
* This method should only be used by the `upgradeMod` function. Returns the names of the exported
|
|
9521
|
+
* class methods from the features that were added.
|
|
9525
9522
|
*/
|
|
9526
9523
|
initOptionalFeature(feature: ISCFeature): FunctionTuple[];
|
|
9527
9524
|
/** This is used to initialize both custom callbacks and "extra features". */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 14.1.
|
|
3
|
+
isaacscript-common 14.1.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -16939,18 +16939,12 @@ return ____exports
|
|
|
16939
16939
|
end,
|
|
16940
16940
|
["src.interfaces.TSTLClassMetatable"] = function(...)
|
|
16941
16941
|
local ____exports = {}
|
|
16942
|
-
return ____exports
|
|
16943
|
-
end,
|
|
16944
|
-
["src.types.FunctionTuple"] = function(...)
|
|
16945
|
-
local ____exports = {}
|
|
16946
16942
|
return ____exports
|
|
16947
16943
|
end,
|
|
16948
16944
|
["src.functions.tstlClass"] = function(...)
|
|
16949
16945
|
local ____lualib = require("lualib_bundle")
|
|
16950
16946
|
local Set = ____lualib.Set
|
|
16951
16947
|
local __TS__New = ____lualib.__TS__New
|
|
16952
|
-
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
16953
|
-
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
16954
16948
|
local ____exports = {}
|
|
16955
16949
|
local VANILLA_TSTL_CLASSES
|
|
16956
16950
|
local ____types = require("src.functions.types")
|
|
@@ -16982,23 +16976,6 @@ function ____exports.isVanillaTSTLClass(self, object)
|
|
|
16982
16976
|
end
|
|
16983
16977
|
VANILLA_TSTL_CLASSES = __TS__New(Set, {"Map", "Set", "WeakMap", "WeakSet"})
|
|
16984
16978
|
local TSTL_CLASS_METATABLE_KEYS = __TS__New(Set, {"____constructor", "__index", "constructor"})
|
|
16985
|
-
function ____exports.getTSTLClassMethods(self, object)
|
|
16986
|
-
local constructor = ____exports.getTSTLClassConstructor(nil, object)
|
|
16987
|
-
if constructor == nil then
|
|
16988
|
-
return {}
|
|
16989
|
-
end
|
|
16990
|
-
local classEntries = __TS__ObjectEntries(constructor.prototype)
|
|
16991
|
-
return __TS__ArrayFilter(
|
|
16992
|
-
classEntries,
|
|
16993
|
-
function(____, ____bindingPattern0)
|
|
16994
|
-
local value
|
|
16995
|
-
local key
|
|
16996
|
-
key = ____bindingPattern0[1]
|
|
16997
|
-
value = ____bindingPattern0[2]
|
|
16998
|
-
return not TSTL_CLASS_METATABLE_KEYS:has(key) and type(value) == "function"
|
|
16999
|
-
end
|
|
17000
|
-
)
|
|
17001
|
-
end
|
|
17002
16979
|
function ____exports.isDefaultMap(self, object)
|
|
17003
16980
|
local className = ____exports.getTSTLClassName(nil, object)
|
|
17004
16981
|
return className == "DefaultMap"
|
|
@@ -27124,7 +27101,6 @@ local Feature = ____exports.Feature
|
|
|
27124
27101
|
Feature.name = "Feature"
|
|
27125
27102
|
function Feature.prototype.____constructor(self)
|
|
27126
27103
|
self.initialized = false
|
|
27127
|
-
self.exportedMethods = {}
|
|
27128
27104
|
end
|
|
27129
27105
|
return ____exports
|
|
27130
27106
|
end,
|
|
@@ -30763,9 +30739,7 @@ return ____exports
|
|
|
30763
30739
|
end,
|
|
30764
30740
|
["src.callbacks"] = function(...)
|
|
30765
30741
|
local ____lualib = require("lualib_bundle")
|
|
30766
|
-
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
30767
30742
|
local __TS__New = ____lualib.__TS__New
|
|
30768
|
-
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
30769
30743
|
local ____exports = {}
|
|
30770
30744
|
local ____PostAmbushFinished = require("src.classes.callbacks.PostAmbushFinished")
|
|
30771
30745
|
local PostAmbushFinished = ____PostAmbushFinished.PostAmbushFinished
|
|
@@ -30867,6 +30841,8 @@ local ____PreCustomRevive = require("src.classes.callbacks.PreCustomRevive")
|
|
|
30867
30841
|
local PreCustomRevive = ____PreCustomRevive.PreCustomRevive
|
|
30868
30842
|
local ____ModCallbackCustom2 = require("src.enums.ModCallbackCustom2")
|
|
30869
30843
|
local ModCallbackCustom2 = ____ModCallbackCustom2.ModCallbackCustom2
|
|
30844
|
+
local ____enums = require("src.functions.enums")
|
|
30845
|
+
local getEnumValues = ____enums.getEnumValues
|
|
30870
30846
|
local ____utils = require("src.functions.utils")
|
|
30871
30847
|
local newObjectWithEnumKeys = ____utils.newObjectWithEnumKeys
|
|
30872
30848
|
local MOD_CALLBACK_CUSTOM_TO_CLASS = newObjectWithEnumKeys(nil, ModCallbackCustom2, {
|
|
@@ -30921,30 +30897,26 @@ local MOD_CALLBACK_CUSTOM_TO_CLASS = newObjectWithEnumKeys(nil, ModCallbackCusto
|
|
|
30921
30897
|
[ModCallbackCustom2.PRE_CUSTOM_REVIVE] = PreCustomRevive
|
|
30922
30898
|
})
|
|
30923
30899
|
function ____exports.getCallbacks(self)
|
|
30924
|
-
local
|
|
30925
|
-
|
|
30926
|
-
|
|
30927
|
-
|
|
30928
|
-
|
|
30929
|
-
local modCallbackCustom
|
|
30930
|
-
modCallbackCustom = ____bindingPattern0[1]
|
|
30931
|
-
constructor = ____bindingPattern0[2]
|
|
30932
|
-
return {
|
|
30933
|
-
modCallbackCustom,
|
|
30934
|
-
__TS__New(constructor)
|
|
30935
|
-
}
|
|
30936
|
-
end
|
|
30937
|
-
)
|
|
30900
|
+
local instantiatedClasses = {}
|
|
30901
|
+
for ____, modCallbackCustom in ipairs(getEnumValues(nil, ModCallbackCustom2)) do
|
|
30902
|
+
local constructor = MOD_CALLBACK_CUSTOM_TO_CLASS[modCallbackCustom]
|
|
30903
|
+
instantiatedClasses[modCallbackCustom] = __TS__New(constructor)
|
|
30904
|
+
end
|
|
30938
30905
|
return instantiatedClasses
|
|
30939
30906
|
end
|
|
30940
30907
|
return ____exports
|
|
30941
30908
|
end,
|
|
30942
30909
|
["src.decorators"] = function(...)
|
|
30943
30910
|
local ____exports = {}
|
|
30911
|
+
____exports.EXPORTED_METHOD_NAMES_KEY = "__exportedMethodNames"
|
|
30944
30912
|
function ____exports.Exported(self)
|
|
30945
30913
|
return function(____, target, propertyKey)
|
|
30946
|
-
local
|
|
30947
|
-
|
|
30914
|
+
local constructor = target.constructor
|
|
30915
|
+
if not (constructor[____exports.EXPORTED_METHOD_NAMES_KEY] ~= nil) then
|
|
30916
|
+
constructor[____exports.EXPORTED_METHOD_NAMES_KEY] = {}
|
|
30917
|
+
end
|
|
30918
|
+
local exportedMethodNames = constructor[____exports.EXPORTED_METHOD_NAMES_KEY]
|
|
30919
|
+
exportedMethodNames[#exportedMethodNames + 1] = propertyKey
|
|
30948
30920
|
end
|
|
30949
30921
|
end
|
|
30950
30922
|
return ____exports
|
|
@@ -34849,17 +34821,25 @@ ____exports.CALLBACK_REGISTER_FUNCTIONS = {
|
|
|
34849
34821
|
[ModCallbackCustom.PRE_ITEM_PICKUP] = preItemPickupRegister,
|
|
34850
34822
|
[ModCallbackCustom.PRE_NEW_LEVEL] = preNewLevelRegister
|
|
34851
34823
|
}
|
|
34824
|
+
return ____exports
|
|
34825
|
+
end,
|
|
34826
|
+
["src.types.FunctionTuple"] = function(...)
|
|
34827
|
+
local ____exports = {}
|
|
34852
34828
|
return ____exports
|
|
34853
34829
|
end,
|
|
34854
34830
|
["src.classes.ModUpgraded"] = function(...)
|
|
34855
34831
|
local ____lualib = require("lualib_bundle")
|
|
34856
34832
|
local __TS__Class = ____lualib.__TS__Class
|
|
34857
34833
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
34834
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
34858
34835
|
local ____exports = {}
|
|
34836
|
+
local getExportedMethodsFromFeature
|
|
34859
34837
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
34860
34838
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
34861
34839
|
local ____callbacks = require("src.callbacks")
|
|
34862
34840
|
local getCallbacks = ____callbacks.getCallbacks
|
|
34841
|
+
local ____decorators = require("src.decorators")
|
|
34842
|
+
local EXPORTED_METHOD_NAMES_KEY = ____decorators.EXPORTED_METHOD_NAMES_KEY
|
|
34863
34843
|
local ____features = require("src.features")
|
|
34864
34844
|
local getFeatures = ____features.getFeatures
|
|
34865
34845
|
local ____exports = require("src.features.saveDataManager.exports")
|
|
@@ -34870,10 +34850,28 @@ local getTime = ____debugFunctions.getTime
|
|
|
34870
34850
|
local ____log = require("src.functions.log")
|
|
34871
34851
|
local getParentFunctionDescription = ____log.getParentFunctionDescription
|
|
34872
34852
|
local ____tstlClass = require("src.functions.tstlClass")
|
|
34873
|
-
local
|
|
34853
|
+
local getTSTLClassConstructor = ____tstlClass.getTSTLClassConstructor
|
|
34874
34854
|
local getTSTLClassName = ____tstlClass.getTSTLClassName
|
|
34875
34855
|
local ____callbackRegisterFunctions = require("src.objects.callbackRegisterFunctions")
|
|
34876
34856
|
local CALLBACK_REGISTER_FUNCTIONS = ____callbackRegisterFunctions.CALLBACK_REGISTER_FUNCTIONS
|
|
34857
|
+
function getExportedMethodsFromFeature(self, featureClass)
|
|
34858
|
+
local constructor = getTSTLClassConstructor(nil, featureClass)
|
|
34859
|
+
local exportedMethodNames = constructor[EXPORTED_METHOD_NAMES_KEY]
|
|
34860
|
+
return __TS__ArrayMap(
|
|
34861
|
+
exportedMethodNames,
|
|
34862
|
+
function(____, name)
|
|
34863
|
+
local featureClassRecord = featureClass
|
|
34864
|
+
local method = featureClassRecord[name]
|
|
34865
|
+
if method == nil then
|
|
34866
|
+
error("Failed to find a decorated exported method: " .. name)
|
|
34867
|
+
end
|
|
34868
|
+
local function wrappedMethod(____, ...)
|
|
34869
|
+
return featureClassRecord[name](featureClassRecord, ...)
|
|
34870
|
+
end
|
|
34871
|
+
return {name, wrappedMethod}
|
|
34872
|
+
end
|
|
34873
|
+
)
|
|
34874
|
+
end
|
|
34877
34875
|
____exports.ModUpgraded = __TS__Class()
|
|
34878
34876
|
local ModUpgraded = ____exports.ModUpgraded
|
|
34879
34877
|
ModUpgraded.name = "ModUpgraded"
|
|
@@ -34952,7 +34950,7 @@ end
|
|
|
34952
34950
|
function ModUpgraded.prototype.initOptionalFeature(self, feature)
|
|
34953
34951
|
local featureClass = self.features[feature]
|
|
34954
34952
|
self:initFeature(featureClass)
|
|
34955
|
-
return
|
|
34953
|
+
return getExportedMethodsFromFeature(nil, featureClass)
|
|
34956
34954
|
end
|
|
34957
34955
|
function ModUpgraded.prototype.initFeature(self, feature)
|
|
34958
34956
|
if feature.initialized then
|
|
@@ -46717,9 +46715,9 @@ function ____exports.upgradeMod(self, modVanilla, features, ____debug, timeThres
|
|
|
46717
46715
|
loadShaderCrashFix(nil, modVanilla)
|
|
46718
46716
|
legacyInit(nil, mod)
|
|
46719
46717
|
for ____, feature in ipairs(features) do
|
|
46720
|
-
local
|
|
46718
|
+
local exportedMethodTuples = mod:initOptionalFeature(feature)
|
|
46721
46719
|
local modRecord = mod
|
|
46722
|
-
for ____, ____value in ipairs(
|
|
46720
|
+
for ____, ____value in ipairs(exportedMethodTuples) do
|
|
46723
46721
|
local funcName = ____value[1]
|
|
46724
46722
|
local func = ____value[2]
|
|
46725
46723
|
modRecord[funcName] = func
|
package/dist/src/callbacks.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ declare const MOD_CALLBACK_CUSTOM_TO_CLASS: {
|
|
|
99
99
|
readonly 48: typeof PreCustomRevive;
|
|
100
100
|
};
|
|
101
101
|
export declare type ModCallbackCustomToClass = {
|
|
102
|
-
[
|
|
102
|
+
readonly [key in keyof typeof MOD_CALLBACK_CUSTOM_TO_CLASS]: InstanceType<typeof MOD_CALLBACK_CUSTOM_TO_CLASS[key]>;
|
|
103
103
|
};
|
|
104
104
|
export declare function getCallbacks(): ModCallbackCustomToClass;
|
|
105
105
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../src/callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAA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}
|
package/dist/src/callbacks.lua
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
5
3
|
local ____exports = {}
|
|
6
4
|
local ____PostAmbushFinished = require("src.classes.callbacks.PostAmbushFinished")
|
|
7
5
|
local PostAmbushFinished = ____PostAmbushFinished.PostAmbushFinished
|
|
@@ -103,6 +101,8 @@ local ____PreCustomRevive = require("src.classes.callbacks.PreCustomRevive")
|
|
|
103
101
|
local PreCustomRevive = ____PreCustomRevive.PreCustomRevive
|
|
104
102
|
local ____ModCallbackCustom2 = require("src.enums.ModCallbackCustom2")
|
|
105
103
|
local ModCallbackCustom2 = ____ModCallbackCustom2.ModCallbackCustom2
|
|
104
|
+
local ____enums = require("src.functions.enums")
|
|
105
|
+
local getEnumValues = ____enums.getEnumValues
|
|
106
106
|
local ____utils = require("src.functions.utils")
|
|
107
107
|
local newObjectWithEnumKeys = ____utils.newObjectWithEnumKeys
|
|
108
108
|
local MOD_CALLBACK_CUSTOM_TO_CLASS = newObjectWithEnumKeys(nil, ModCallbackCustom2, {
|
|
@@ -157,20 +157,11 @@ local MOD_CALLBACK_CUSTOM_TO_CLASS = newObjectWithEnumKeys(nil, ModCallbackCusto
|
|
|
157
157
|
[ModCallbackCustom2.PRE_CUSTOM_REVIVE] = PreCustomRevive
|
|
158
158
|
})
|
|
159
159
|
function ____exports.getCallbacks(self)
|
|
160
|
-
local
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
local modCallbackCustom
|
|
166
|
-
modCallbackCustom = ____bindingPattern0[1]
|
|
167
|
-
constructor = ____bindingPattern0[2]
|
|
168
|
-
return {
|
|
169
|
-
modCallbackCustom,
|
|
170
|
-
__TS__New(constructor)
|
|
171
|
-
}
|
|
172
|
-
end
|
|
173
|
-
)
|
|
160
|
+
local instantiatedClasses = {}
|
|
161
|
+
for ____, modCallbackCustom in ipairs(getEnumValues(nil, ModCallbackCustom2)) do
|
|
162
|
+
local constructor = MOD_CALLBACK_CUSTOM_TO_CLASS[modCallbackCustom]
|
|
163
|
+
instantiatedClasses[modCallbackCustom] = __TS__New(constructor)
|
|
164
|
+
end
|
|
174
165
|
return instantiatedClasses
|
|
175
166
|
end
|
|
176
167
|
return ____exports
|
|
@@ -66,8 +66,8 @@ export declare class ModUpgraded implements Mod {
|
|
|
66
66
|
*/
|
|
67
67
|
RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
|
|
68
68
|
/**
|
|
69
|
-
* This method should only be used by the `upgradeMod` function. Returns the
|
|
70
|
-
* the features that were added.
|
|
69
|
+
* This method should only be used by the `upgradeMod` function. Returns the names of the exported
|
|
70
|
+
* class methods from the features that were added.
|
|
71
71
|
*/
|
|
72
72
|
initOptionalFeature(feature: ISCFeature): FunctionTuple[];
|
|
73
73
|
/** This is used to initialize both custom callbacks and "extra features". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/classes/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/classes/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAA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AkB,EACtD,iBAAiB,EAAE,CAAC,EACpB,QAAQ,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC3C,IAAI;IASP;;;OAGG;IACI,mBAAmB,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,EAAE;IAWhE,6EAA6E;IAC7E,OAAO,CAAC,WAAW;IAoCnB,OAAO,CAAC,aAAa;CAqCtB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
4
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
4
5
|
local ____exports = {}
|
|
6
|
+
local getExportedMethodsFromFeature
|
|
5
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
8
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
7
9
|
local ____callbacks = require("src.callbacks")
|
|
8
10
|
local getCallbacks = ____callbacks.getCallbacks
|
|
11
|
+
local ____decorators = require("src.decorators")
|
|
12
|
+
local EXPORTED_METHOD_NAMES_KEY = ____decorators.EXPORTED_METHOD_NAMES_KEY
|
|
9
13
|
local ____features = require("src.features")
|
|
10
14
|
local getFeatures = ____features.getFeatures
|
|
11
15
|
local ____exports = require("src.features.saveDataManager.exports")
|
|
@@ -16,10 +20,28 @@ local getTime = ____debugFunctions.getTime
|
|
|
16
20
|
local ____log = require("src.functions.log")
|
|
17
21
|
local getParentFunctionDescription = ____log.getParentFunctionDescription
|
|
18
22
|
local ____tstlClass = require("src.functions.tstlClass")
|
|
19
|
-
local
|
|
23
|
+
local getTSTLClassConstructor = ____tstlClass.getTSTLClassConstructor
|
|
20
24
|
local getTSTLClassName = ____tstlClass.getTSTLClassName
|
|
21
25
|
local ____callbackRegisterFunctions = require("src.objects.callbackRegisterFunctions")
|
|
22
26
|
local CALLBACK_REGISTER_FUNCTIONS = ____callbackRegisterFunctions.CALLBACK_REGISTER_FUNCTIONS
|
|
27
|
+
function getExportedMethodsFromFeature(self, featureClass)
|
|
28
|
+
local constructor = getTSTLClassConstructor(nil, featureClass)
|
|
29
|
+
local exportedMethodNames = constructor[EXPORTED_METHOD_NAMES_KEY]
|
|
30
|
+
return __TS__ArrayMap(
|
|
31
|
+
exportedMethodNames,
|
|
32
|
+
function(____, name)
|
|
33
|
+
local featureClassRecord = featureClass
|
|
34
|
+
local method = featureClassRecord[name]
|
|
35
|
+
if method == nil then
|
|
36
|
+
error("Failed to find a decorated exported method: " .. name)
|
|
37
|
+
end
|
|
38
|
+
local function wrappedMethod(____, ...)
|
|
39
|
+
return featureClassRecord[name](featureClassRecord, ...)
|
|
40
|
+
end
|
|
41
|
+
return {name, wrappedMethod}
|
|
42
|
+
end
|
|
43
|
+
)
|
|
44
|
+
end
|
|
23
45
|
--- `isaacscript-common` has many custom callbacks that you can use in your mods. Instead of
|
|
24
46
|
-- hijacking the vanilla `Mod` object, we provide a `ModUpgraded` object for you to use, which
|
|
25
47
|
-- extends the base class and adds a new method of `AddCallbackCustom`.
|
|
@@ -105,7 +127,7 @@ end
|
|
|
105
127
|
function ModUpgraded.prototype.initOptionalFeature(self, feature)
|
|
106
128
|
local featureClass = self.features[feature]
|
|
107
129
|
self:initFeature(featureClass)
|
|
108
|
-
return
|
|
130
|
+
return getExportedMethodsFromFeature(nil, featureClass)
|
|
109
131
|
end
|
|
110
132
|
function ModUpgraded.prototype.initFeature(self, feature)
|
|
111
133
|
if feature.initialized then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["../../../../src/classes/private/Feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EACL,aAAa,EACb,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAE3C;;;;;;GAMG;AACH,qBAAa,OAAO;IACX,WAAW,UAAS;IAEpB,CAAC,CAAC,EAAE,QAAQ,CAAC;IACb,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["../../../../src/classes/private/Feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EACL,aAAa,EACb,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAE3C;;;;;;GAMG;AACH,qBAAa,OAAO;IACX,WAAW,UAAS;IAEpB,CAAC,CAAC,EAAE,QAAQ,CAAC;IACb,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACpD"}
|
|
@@ -82,9 +82,9 @@ function ____exports.upgradeMod(self, modVanilla, features, ____debug, timeThres
|
|
|
82
82
|
loadShaderCrashFix(nil, modVanilla)
|
|
83
83
|
legacyInit(nil, mod)
|
|
84
84
|
for ____, feature in ipairs(features) do
|
|
85
|
-
local
|
|
85
|
+
local exportedMethodTuples = mod:initOptionalFeature(feature)
|
|
86
86
|
local modRecord = mod
|
|
87
|
-
for ____, ____value in ipairs(
|
|
87
|
+
for ____, ____value in ipairs(exportedMethodTuples) do
|
|
88
88
|
local funcName = ____value[1]
|
|
89
89
|
local func = ____value[2]
|
|
90
90
|
modRecord[funcName] = func
|
package/dist/src/decorators.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,QAAQ,4DACuC,IAAI,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,eAAO,MAAM,yBAAyB,0BAA0B,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,QAAQ,4DACuC,IAAI,CAgBlE"}
|
package/dist/src/decorators.lua
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
+
____exports.EXPORTED_METHOD_NAMES_KEY = "__exportedMethodNames"
|
|
2
3
|
--- A decorator function that signifies that the decorated class method should be added to the
|
|
3
4
|
-- `ModUpgraded` object.
|
|
4
5
|
--
|
|
5
6
|
-- This is only meant to be used internally.
|
|
6
7
|
function ____exports.Exported(self)
|
|
7
8
|
return function(____, target, propertyKey)
|
|
8
|
-
local
|
|
9
|
-
|
|
9
|
+
local constructor = target.constructor
|
|
10
|
+
if not (constructor[____exports.EXPORTED_METHOD_NAMES_KEY] ~= nil) then
|
|
11
|
+
constructor[____exports.EXPORTED_METHOD_NAMES_KEY] = {}
|
|
12
|
+
end
|
|
13
|
+
local exportedMethodNames = constructor[____exports.EXPORTED_METHOD_NAMES_KEY]
|
|
14
|
+
exportedMethodNames[#exportedMethodNames + 1] = propertyKey
|
|
10
15
|
end
|
|
11
16
|
end
|
|
12
17
|
return ____exports
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
2
|
import { DefaultMap } from "../classes/DefaultMap";
|
|
3
3
|
import { TSTLClassMetatable } from "../interfaces/TSTLClassMetatable";
|
|
4
|
-
import { FunctionTuple } from "../types/FunctionTuple";
|
|
5
4
|
import { TSTLClass } from "../types/TSTLClass";
|
|
6
5
|
/**
|
|
7
6
|
* Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
|
|
@@ -10,7 +9,6 @@ import { TSTLClass } from "../types/TSTLClass";
|
|
|
10
9
|
* Returns undefined if passed a non-table or if the provided table does not have a metatable.
|
|
11
10
|
*/
|
|
12
11
|
export declare function getTSTLClassConstructor(object: unknown): TSTLClassMetatable["constructor"] | undefined;
|
|
13
|
-
export declare function getTSTLClassMethods(object: unknown): FunctionTuple[];
|
|
14
12
|
/**
|
|
15
13
|
* Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
|
|
16
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tstlClass.d.ts","sourceRoot":"","sources":["../../../src/functions/tstlClass.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tstlClass.d.ts","sourceRoot":"","sources":["../../../src/functions/tstlClass.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAW/C;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,GACd,kBAAkB,CAAC,aAAa,CAAC,GAAG,SAAS,CAW/C;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAG1C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,CAGnE;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CA4B3E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAiB3D"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
5
|
-
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
4
|
local ____exports = {}
|
|
7
5
|
local VANILLA_TSTL_CLASSES
|
|
8
6
|
local ____types = require("src.functions.types")
|
|
@@ -48,23 +46,6 @@ function ____exports.isVanillaTSTLClass(self, object)
|
|
|
48
46
|
end
|
|
49
47
|
VANILLA_TSTL_CLASSES = __TS__New(Set, {"Map", "Set", "WeakMap", "WeakSet"})
|
|
50
48
|
local TSTL_CLASS_METATABLE_KEYS = __TS__New(Set, {"____constructor", "__index", "constructor"})
|
|
51
|
-
function ____exports.getTSTLClassMethods(self, object)
|
|
52
|
-
local constructor = ____exports.getTSTLClassConstructor(nil, object)
|
|
53
|
-
if constructor == nil then
|
|
54
|
-
return {}
|
|
55
|
-
end
|
|
56
|
-
local classEntries = __TS__ObjectEntries(constructor.prototype)
|
|
57
|
-
return __TS__ArrayFilter(
|
|
58
|
-
classEntries,
|
|
59
|
-
function(____, ____bindingPattern0)
|
|
60
|
-
local value
|
|
61
|
-
local key
|
|
62
|
-
key = ____bindingPattern0[1]
|
|
63
|
-
value = ____bindingPattern0[2]
|
|
64
|
-
return not TSTL_CLASS_METATABLE_KEYS:has(key) and type(value) == "function"
|
|
65
|
-
end
|
|
66
|
-
)
|
|
67
|
-
end
|
|
68
49
|
--- Helper function to determine if a given object is a TypeScriptToLua `Map`.
|
|
69
50
|
--
|
|
70
51
|
-- It is not reliable to use the `instanceof` operator to determine this because each Lua module has
|