chore: tsify extensions shim (#24355)

This commit is contained in:
Jeremy Rose
2020-06-30 12:49:08 -07:00
committed by GitHub
parent ee61eb9aa4
commit 451086d7f2
4 changed files with 8 additions and 10 deletions

View File

@@ -55,12 +55,12 @@ const deprecate: ElectronInternal.DeprecationUtil = {
};
},
moveAPI: (fn: Function, oldUsage: string, newUsage: string) => {
moveAPI<T extends Function> (fn: T, oldUsage: string, newUsage: string): T {
const warn = warnOnce(oldUsage, newUsage);
return function (this: any) {
warn();
return fn.apply(this, arguments);
};
} as any;
},
// change the name of an event