refactor: re-implement desktop-capturer in TypeScript (#18580)
This commit is contained in:
parent
4ef8de69ef
commit
370e9522b4
9 changed files with 127 additions and 144 deletions
25
typings/internal-electron.d.ts
vendored
25
typings/internal-electron.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue