Skip to content

Commit

Permalink
fix(patcher): why the hell did i do it that way
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jun 20, 2022
1 parent 32d1303 commit 2afb7f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function fakeRenderComponent(fun: Function): any {
return res;
}

export function beforePatch(obj: any, name: string, fnc: Function): void {
export function beforePatch(obj: any, name: string, fnc: (args: any[]) => any): void {
const orig = obj[name];
obj[name] = function (...args: any[]) {
fnc.call(this, args);
Expand All @@ -53,7 +53,7 @@ export function beforePatch(obj: any, name: string, fnc: Function): void {
obj[name].__deckyOrig = orig;
}

export function afterPatch(obj: any, name: string, fnc: Function): void {
export function afterPatch(obj: any, name: string, fnc: (args: any[], ret: any) => any): void {
const orig = obj[name];
obj[name] = function (...args: any[]) {
let ret = orig.call(this, ...args);
Expand All @@ -65,7 +65,7 @@ export function afterPatch(obj: any, name: string, fnc: Function): void {
obj[name].__deckyOrig = orig;
}

export function replacePatch(obj: any, name: string, fnc: Function): void {
export function replacePatch(obj: any, name: string, fnc: (args: any[]) => any): void {
const orig = obj[name];
obj[name] = function (...args: any[]) {
const ret = fnc.call(this, args);
Expand Down

0 comments on commit 2afb7f1

Please sign in to comment.