refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574)
This commit is contained in:
parent
698120daf0
commit
81e9dab52f
29 changed files with 195 additions and 164 deletions
2
typings/internal-ambient.d.ts
vendored
2
typings/internal-ambient.d.ts
vendored
|
@ -20,7 +20,7 @@ declare namespace NodeJS {
|
|||
sendSync(internal: boolean, channel: string, args: any[]): any;
|
||||
sendToHost(channel: string, args: any[]): void;
|
||||
sendTo(internal: boolean, sendToAll: boolean, webContentsId: number, channel: string, args: any[]): void;
|
||||
invoke<T>(channel: string, args: any[]): Promise<{ error: string, result: T }>;
|
||||
invoke<T>(internal: boolean, channel: string, args: any[]): Promise<{ error: string, result: T }>;
|
||||
}
|
||||
|
||||
interface V8UtilBinding {
|
||||
|
|
2
typings/internal-electron.d.ts
vendored
2
typings/internal-electron.d.ts
vendored
|
@ -63,6 +63,7 @@ declare namespace Electron {
|
|||
}
|
||||
|
||||
interface IpcRendererInternal extends Electron.IpcRenderer {
|
||||
invoke<T>(channel: string, ...args: any[]): Promise<T>;
|
||||
sendToAll(webContentsId: number, channel: string, ...args: any[]): void
|
||||
}
|
||||
|
||||
|
@ -126,6 +127,7 @@ declare namespace ElectronInternal {
|
|||
}
|
||||
|
||||
interface IpcMainInternal extends NodeJS.EventEmitter {
|
||||
handle(channel: string, listener: (event: Electron.IpcMainInvokeEvent, ...args: any[]) => Promise<any> | any): void;
|
||||
on(channel: string, listener: (event: IpcMainInternalEvent, ...args: any[]) => void): this;
|
||||
once(channel: string, listener: (event: IpcMainInternalEvent, ...args: any[]) => void): this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue