refactor: simplify events (#37099)

This commit is contained in:
Jeremy Rose 2023-02-13 13:39:18 -08:00 committed by GitHub
parent 8b3e498436
commit 71944f2c3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 290 additions and 409 deletions

View file

@ -110,7 +110,7 @@ declare namespace Electron {
_shouldRegisterAcceleratorForCommandId(id: string): boolean;
_getSharingItemForCommandId(id: string): SharingItem | null;
_callMenuWillShow(): void;
_executeCommand(event: any, id: number): void;
_executeCommand(event: KeyboardEvent, id: number): void;
_menuWillShow(): void;
commandsMap: Record<string, MenuItem>;
groupsMap: Record<string, MenuItem[]>;
@ -138,14 +138,16 @@ declare namespace Electron {
acceleratorWorksWhenHidden?: boolean;
}
interface IpcMainEvent {
interface ReplyChannel {
sendReply(value: any): void;
}
interface IpcMainEvent {
_replyChannel: ReplyChannel;
}
interface IpcMainInvokeEvent {
sendReply(value: any): void;
_reply(value: any): void;
_throw(error: Error | string): void;
_replyChannel: ReplyChannel;
}
class View {}
@ -222,10 +224,6 @@ 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;
}