refactor: cleanup global variable declarations (#38410)

refactor: eliminate duplicate isolatedApi typing

Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
Milan Burda 2023-05-24 20:01:07 +02:00 коммит произвёл GitHub
Родитель 2f8e68f8b3
Коммит a043a60b89
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -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 поставляемый
Просмотреть файл

@ -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;