refactor: convert ipc-renderer.ts to TypeScript (#19556)

* refactor: convert ipc-renderer.ts to TypeScript

* Update typings/internal-ambient.d.ts

Co-Authored-By: Samuel Attard <sattard@slack-corp.com>
This commit is contained in:
Milan Burda
2019-08-02 21:35:04 +02:00
committed by Charles Kerr
parent ee64c6ab86
commit 3011a0f14f
6 changed files with 25 additions and 23 deletions

View File

@@ -14,6 +14,14 @@ declare namespace NodeJS {
isComponentBuild(): boolean;
}
interface IpcBinding {
send(internal: boolean, channel: string, args: any[]): void;
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 }>;
}
interface V8UtilBinding {
getHiddenValue<T>(obj: any, key: string): T;
setHiddenValue<T>(obj: any, key: string, value: T): void;
@@ -28,6 +36,7 @@ declare namespace NodeJS {
_linkedBinding(name: string): any;
electronBinding(name: string): any;
electronBinding(name: 'features'): FeaturesBinding;
electronBinding(name: 'ipc'): { ipc: IpcBinding };
electronBinding(name: 'v8_util'): V8UtilBinding;
electronBinding(name: 'app'): { app: Electron.App, App: Function };
electronBinding(name: 'command_line'): Electron.CommandLine;