chore: cleanup typings/internal-electron.d.ts (#25711)
This commit is contained in:
parent
17c7c5cfdd
commit
8df4faa8f0
6 changed files with 25 additions and 76 deletions
|
@ -4,7 +4,7 @@ const { ipc } = process._linkedBinding('electron_renderer_ipc');
|
|||
|
||||
const internal = true;
|
||||
|
||||
const ipcRendererInternal = new EventEmitter() as any as Electron.IpcRendererInternal;
|
||||
const ipcRendererInternal = new EventEmitter() as any as ElectronInternal.IpcRendererInternal;
|
||||
ipcRendererInternal.send = function (channel, ...args) {
|
||||
return ipc.send(internal, channel, args);
|
||||
};
|
||||
|
|
|
@ -99,7 +99,7 @@ export function createGuest (params: Record<string, any>): Promise<number> {
|
|||
export function attachGuest (
|
||||
elementInstanceId: number, guestInstanceId: number, params: Record<string, any>, contentWindow: Window
|
||||
) {
|
||||
const embedderFrameId = (webFrame as ElectronInternal.WebFrameInternal).getWebFrameId(contentWindow);
|
||||
const embedderFrameId = webFrame.getWebFrameId(contentWindow);
|
||||
if (embedderFrameId < 0) { // this error should not happen.
|
||||
throw new Error('Invalid embedder frame');
|
||||
}
|
||||
|
|
|
@ -85,8 +85,7 @@ const registerWebViewElement = (v8Util: NodeJS.V8UtilBinding, webViewImpl: typeo
|
|||
webViewImpl.setupMethods(WebViewElement);
|
||||
|
||||
// The customElements.define has to be called in a special scope.
|
||||
const webFrame = webViewImpl.webFrame as ElectronInternal.WebFrameInternal;
|
||||
webFrame.allowGuestViewElementDefinition(window, () => {
|
||||
webViewImpl.webFrame.allowGuestViewElementDefinition(window, () => {
|
||||
window.customElements.define('webview', WebViewElement);
|
||||
(window as any).WebView = WebViewElement;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue