chore: convert guest-view-manager.js to TypeScript (#25825)

This commit is contained in:
Milan Burda 2020-10-13 03:29:08 +02:00 committed by GitHub
parent d78d7b3a55
commit f827acc3be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 67 deletions

View file

@ -1,6 +1,6 @@
/// <reference path="../electron.d.ts" />
/**
/**
* This file augments the Electron TS namespace with the internal APIs
* that are not documented but are used by Electron internally
*/
@ -77,6 +77,13 @@ declare namespace Electron {
canGoToIndex(index: number): boolean;
getActiveIndex(): number;
length(): number;
destroy(): void;
// <webview>
attachToIframe(embedderWebContents: Electron.WebContents, embedderFrameId: number): void;
detachFromOuterFrame(): void;
setEmbedder(embedder: Electron.WebContents): void;
attachParams?: Record<string, any>;
viewInstanceId: number;
}
interface WebFrame {
@ -87,7 +94,10 @@ declare namespace Electron {
interface WebPreferences {
guestInstanceId?: number;
openerId?: number;
disablePopups?: boolean
disablePopups?: boolean;
preloadURL?: string;
embedder?: Electron.WebContents;
type?: 'backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen';
}
interface Menu {
@ -266,6 +276,10 @@ declare namespace ElectronInternal {
public getWebContentsId(): number;
public capturePage(rect?: Electron.Rectangle): Promise<Electron.NativeImage>;
}
class WebContents extends Electron.WebContents {
static create(opts: Electron.WebPreferences): Electron.WebContents;
}
}
declare namespace Chrome {