refactor: re-implement desktop-capturer in TypeScript (#18580)

This commit is contained in:
Milan Burda 2019-06-15 12:44:18 +02:00 committed by Cheng Zhao
parent 4ef8de69ef
commit 370e9522b4
9 changed files with 127 additions and 144 deletions

View file

@ -47,11 +47,6 @@ declare namespace Electron {
allFrames: boolean
}
interface RendererProcessPreference {
contentScripts: Array<ContentScript>
extensionId: string;
}
interface IpcRendererInternal extends Electron.IpcRenderer {
sendToAll(webContentsId: number, channel: string, ...args: any[]): void
}
@ -88,6 +83,26 @@ declare namespace ElectronInternal {
promisifyMultiArg<T extends (...args: any[]) => any>(fn: T, /*convertPromiseValue: (v: any) => any*/): T;
}
interface DesktopCapturer {
startHandling(captureWindow: boolean, captureScreen: boolean, thumbnailSize: Electron.Size, fetchWindowIcons: boolean): void;
emit: typeof NodeJS.EventEmitter.prototype.emit | null;
}
interface GetSourcesOptions {
captureWindow: boolean;
captureScreen: boolean;
thumbnailSize: Electron.Size;
fetchWindowIcons: boolean;
}
interface GetSourcesResult {
id: string;
name: string;
thumbnail: string;
display_id: string;
appIcon: string | null;
}
// Internal IPC has _replyInternal and NO reply method
interface IpcMainInternalEvent extends Omit<Electron.IpcMainEvent, 'reply'> {
_replyInternal(...args: any[]): void;