refactor: cleanup global variable declarations (#38410)
refactor: eliminate duplicate isolatedApi typing Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
2f8e68f8b3
commit
a043a60b89
3 changed files with 9 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
/* global isolatedApi */
|
||||
|
||||
import type * as webViewElementModule from '@electron/internal/renderer/web-view/web-view-element';
|
||||
import type { WebViewImplHooks } from '@electron/internal/renderer/web-view/web-view-impl';
|
||||
|
||||
declare const isolatedApi: WebViewImplHooks;
|
||||
|
||||
if (isolatedApi.guestViewInternal) {
|
||||
// Must setup the WebView element in main world.
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
/* global binding */
|
||||
import * as events from 'events';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
import type * as ipcRendererInternalModule from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
|
||||
declare const binding: {
|
||||
get: (name: string) => any;
|
||||
process: NodeJS.Process;
|
||||
createPreloadScript: (src: string) => Function
|
||||
};
|
||||
|
||||
const { EventEmitter } = events;
|
||||
|
||||
process._linkedBinding = binding.get;
|
||||
|
|
10
typings/internal-ambient.d.ts
vendored
10
typings/internal-ambient.d.ts
vendored
|
@ -1,13 +1,3 @@
|
|||
/* eslint-disable no-var */
|
||||
declare var internalBinding: any;
|
||||
declare var binding: { get: (name: string) => any; process: NodeJS.Process; createPreloadScript: (src: string) => Function };
|
||||
|
||||
declare var isolatedApi: {
|
||||
guestViewInternal: any;
|
||||
allowGuestViewElementDefinition: NodeJS.InternalWebFrame['allowGuestViewElementDefinition'];
|
||||
setIsWebView: (iframe: HTMLIFrameElement) => void;
|
||||
}
|
||||
|
||||
declare const BUILDFLAG: (flag: boolean) => boolean;
|
||||
|
||||
declare const ENABLE_DESKTOP_CAPTURER: boolean;
|
||||
|
|
Loading…
Reference in a new issue