refactor: simplify events (#37099)
This commit is contained in:
parent
8b3e498436
commit
71944f2c3b
32 changed files with 290 additions and 409 deletions
16
typings/internal-electron.d.ts
vendored
16
typings/internal-electron.d.ts
vendored
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue