chore: remove bunch of usages of any (#27512)

This commit is contained in:
Milan Burda 2021-01-29 21:41:59 +01:00 committed by GitHub
parent c7aa35a519
commit 79b3393768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 101 additions and 81 deletions

View file

@ -37,8 +37,12 @@ declare namespace Electron {
removeListener(event: '-touch-bar-interaction', listener: (event: Event, itemID: string, details: any) => void): this;
}
interface BrowserWindowConstructorOptions {
webContents?: WebContents;
}
interface ContextBridge {
internalContextBridge: {
internalContextBridge?: {
contextIsolationEnabled: boolean;
overrideGlobalValueFromIsolatedWorld(keys: string[], value: any): void;
overrideGlobalValueWithDynamicPropsFromIsolatedWorld(keys: string[], value: any): void;
@ -88,6 +92,7 @@ declare namespace Electron {
}
interface WebFrame {
_executeJavaScript(code: string, userGesture?: boolean): Promise<any>;
getWebFrameId(window: Window): number;
allowGuestViewElementDefinition(window: Window, context: any): void;
}
@ -100,7 +105,7 @@ declare namespace Electron {
interface WebPreferences {
guestInstanceId?: number;
openerId?: number;
openerId?: number | null;
disablePopups?: boolean;
preloadURL?: string;
embedder?: Electron.WebContents;
@ -147,9 +152,14 @@ declare namespace Electron {
acceleratorWorksWhenHidden?: boolean;
}
interface IpcMainEvent {
sendReply(value: any): void;
}
interface IpcMainInvokeEvent {
sendReply(value: any): void;
_reply(value: any): void;
_throw(error: Error): void;
_throw(error: Error | string): void;
}
const deprecate: ElectronInternal.DeprecationUtil;
@ -250,10 +260,26 @@ declare namespace ElectronInternal {
once(channel: string, listener: (event: IpcMainInternalEvent, ...args: any[]) => void): this;
}
interface Event extends Electron.Event {
sender: WebContents;
}
interface LoadURLOptions extends Electron.LoadURLOptions {
reloadIgnoringCache?: boolean;
}
interface WebContentsPrintOptions extends Electron.WebContentsPrintOptions {
mediaSize?: MediaSize;
}
type MediaSize = {
name: string,
custom_display_name: string,
height_microns: number,
width_microns: number,
is_default?: 'true',
}
type ModuleLoader = () => any;
interface ModuleEntry {