refactor: replace a few any-s with proper types (#25681)

This commit is contained in:
Milan Burda 2020-10-08 03:01:23 +02:00 committed by GitHub
parent 603f9242d9
commit fb11a12d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 170 additions and 53 deletions

View file

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

View file

@ -34,7 +34,7 @@ const objectMap = function (source: Object, mapper: (value: any) => any) {
return Object.fromEntries(targetEntries);
};
function serializeNativeImage (image: any) {
function serializeNativeImage (image: Electron.NativeImage) {
const representations = [];
const scaleFactors = image.getScaleFactors();