diff --git a/src/Manager/Plugins.ts b/src/Manager/Plugins.ts index 48069e02..09dd25fb 100644 --- a/src/Manager/Plugins.ts +++ b/src/Manager/Plugins.ts @@ -10,10 +10,12 @@ import { IO, Paths, Constants, Utils } from "../Common"; import { System } from "../index"; +type ClassMethod = (this:T["prototype"], ...args:Parameters) => ReturnType + /** @class * The class who handles plugins of RPG Paper Maker. * @static - * @author Nio Kasgami, Wano + * @author Nio Kasgami, Wano, Trico Everfire */ class Plugins { @@ -182,8 +184,6 @@ class Plugins { */ } - - /** * @static * @usage This function is used to inject/overwrite original class methods and variables. @@ -195,8 +195,8 @@ class Plugins { * @param overwrite (METHODS ONLY) Should call original method's code or overwrite original method. (DEFAULT: false) * @param loadBefore (METHODS ONLY) Should original method's code be executed before or after your code (NOTE: This is obviously disabled if param overwrite is set to true.) (DEFAULT: true) */ - static inject( - classObject: T, prototypeName: LT | TR | M, prototype:T["prototype"][LT] + static inject, TR = string, LM = NewableFunction>( + classObject: T, prototypeName: LT | TR | M, prototype:CXT | T[M] | LM, staticType :boolean = false, overwrite: boolean = false, loadOriginalBefore: boolean = true) { let TheAnyPrototype:any = prototype; //force any type, system will not accept otherwise!