electron/spec-main/ambient.d.ts
Cheng Zhao ca947307db
chore: make WebContentsView take webPreferences as parameter (#22997)
* chore: add WebContentsView.webContents helper

* chore: no need to handle webContents option

* chore: Create WebContentsView in C++

* chore: make WebContentsView accept web_preferences

* fix: nativeWindowOpen still passes WebContents to BrowserWindow

* chore: no more need of WebContentsViewRelay

* test: WebContentsView now takes options

* fix: avoid creating 2 constructors
2020-04-09 16:01:16 +09:00

40 lines
912 B
TypeScript

declare let standardScheme: string;
declare namespace Electron {
interface Menu {
_executeCommand(event: any, id: number): void;
_menuWillShow(): void;
getAcceleratorTextAt(index: number): string;
}
interface MenuItem {
getDefaultRoleAccelerator(): Accelerator | undefined;
}
interface WebContents {
getOwnerBrowserWindow(): BrowserWindow;
getWebPreferences(): any;
}
interface Session {
destroy(): void;
}
// Experimental views API
class TopLevelWindow {
constructor(args: {show: boolean})
setContentView(view: View): void
}
class View {}
class WebContentsView {
constructor(options: BrowserWindowConstructorOptions)
}
namespace Main {
class TopLevelWindow extends Electron.TopLevelWindow {}
class View extends Electron.View {}
class WebContentsView extends Electron.WebContentsView {}
}
}
declare module 'dbus-native';