Skip to content

Commit

Permalink
refactor: cleanup global variable declarations (#38410)
Browse files Browse the repository at this point in the history
refactor: eliminate duplicate isolatedApi typing

Co-authored-by: Milan Burda <miburda@microsoft.com>
  • Loading branch information
miniak and Milan Burda committed May 24, 2023
1 parent 2f8e68f commit a043a60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
5 changes: 3 additions & 2 deletions lib/isolated_renderer/init.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 6 additions & 1 deletion lib/sandboxed_renderer/init.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
10 changes: 0 additions & 10 deletions typings/internal-ambient.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit a043a60

Please sign in to comment.