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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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