chore: tsify browser-window (#24326)
* chore: tsify browser-window * fix focus * also tsify top-level-window
This commit is contained in:
parent
1c49e4e376
commit
80e5007c47
8 changed files with 227 additions and 194 deletions
36
typings/internal-electron.d.ts
vendored
36
typings/internal-electron.d.ts
vendored
|
@ -34,6 +34,7 @@ declare namespace Electron {
|
|||
getOwnerBrowserWindow(): Electron.BrowserWindow;
|
||||
getLastWebPreferences(): Electron.WebPreferences;
|
||||
_getPreloadPaths(): string[];
|
||||
equal(other: WebContents): boolean;
|
||||
}
|
||||
|
||||
interface WebPreferences {
|
||||
|
@ -96,6 +97,41 @@ declare namespace Electron {
|
|||
}
|
||||
|
||||
class View {}
|
||||
|
||||
// Experimental views API
|
||||
class TopLevelWindow {
|
||||
constructor(args: {show: boolean})
|
||||
setContentView(view: View): void
|
||||
static fromId(id: number): TopLevelWindow;
|
||||
static getAllWindows(): TopLevelWindow[];
|
||||
isFocused(): boolean;
|
||||
static getFocusedWindow(): TopLevelWindow | undefined;
|
||||
}
|
||||
class WebContentsView {
|
||||
constructor(options: BrowserWindowConstructorOptions)
|
||||
}
|
||||
|
||||
// Deprecated / undocumented BrowserWindow methods
|
||||
interface BrowserWindow {
|
||||
getURL(): string;
|
||||
send(channel: string, ...args: any[]): void;
|
||||
openDevTools(options?: Electron.OpenDevToolsOptions): void;
|
||||
closeDevTools(): void;
|
||||
isDevToolsOpened(): void;
|
||||
isDevToolsFocused(): void;
|
||||
toggleDevTools(): void;
|
||||
inspectElement(x: number, y: number): void;
|
||||
inspectSharedWorker(): void;
|
||||
inspectServiceWorker(): void;
|
||||
getBackgroundThrottling(): void;
|
||||
setBackgroundThrottling(allowed: boolean): void;
|
||||
}
|
||||
|
||||
namespace Main {
|
||||
class TopLevelWindow extends Electron.TopLevelWindow {}
|
||||
class View extends Electron.View {}
|
||||
class WebContentsView extends Electron.WebContentsView {}
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ElectronInternal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue