chore: convert guest-view-manager.js to TypeScript (#25825)
This commit is contained in:
parent
d78d7b3a55
commit
f827acc3be
8 changed files with 86 additions and 67 deletions
18
typings/internal-electron.d.ts
vendored
18
typings/internal-electron.d.ts
vendored
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue