Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update index.d.ts #102

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import * as Electron from 'electron';

import * as Main from 'electron/main'
// Taken from `RemoteMainInterface`
export var app: Electron.App;
export var autoUpdater: Electron.AutoUpdater;
export var BrowserView: typeof Electron.BrowserView;
export var BrowserWindow: typeof Electron.BrowserWindow;
Comment on lines 6 to 7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused why not update all of these?

Suggested change
export var BrowserView: typeof Electron.BrowserView;
export var BrowserWindow: typeof Electron.BrowserWindow;
export var BrowserView: Main.BrowserView;
export var BrowserWindow: Main.BrowserWindow;

etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review.

I tried.

export var BrowserWindow: Main.BrowserWindow;

However, an error occurs because the static member of BrowserWindow cannot be referenced.

code&error

import * as _remote from '@electron/remote';
_remote.BrowserWindow.getAllWindows();
                      ~~~~~~~~~~~~~~~
                      ^ Property 'getAllWindows' is a static member of type 'BrowserWindow'.

export var ClientRequest: typeof Electron.ClientRequest;
export var ClientRequest: Main.ClientRequest;
export var clipboard: Electron.Clipboard;
export var CommandLine: typeof Electron.CommandLine;
export var CommandLine: Main.CommandLine;
export var contentTracing: Electron.ContentTracing;
export var Cookies: typeof Electron.Cookies;
export var Cookies: Main.Cookies;
export var crashReporter: Electron.CrashReporter;
export var Debugger: typeof Electron.Debugger;
export var Debugger: Main.Debugger;
export var desktopCapturer: Electron.DesktopCapturer;
export var dialog: Electron.Dialog;
export var Dock: typeof Electron.Dock;
export var DownloadItem: typeof Electron.DownloadItem;
export var Dock: Main.Dock;
export var DownloadItem: Main.DownloadItem;
export var globalShortcut: Electron.GlobalShortcut;
export var inAppPurchase: Electron.InAppPurchase;
export var IncomingMessage: typeof Electron.IncomingMessage;
export var IncomingMessage: Main.IncomingMessage;
export var ipcMain: Electron.IpcMain;
export var Menu: typeof Electron.Menu;
export var MenuItem: typeof Electron.MenuItem;
export var MessageChannelMain: typeof Electron.MessageChannelMain;
export var MessagePortMain: typeof Electron.MessagePortMain;
export var nativeImage: typeof Electron.NativeImage;
export var MessagePortMain: Main.MessagePortMain;
export var nativeImage: Electron.NativeImage;
export var nativeTheme: Electron.NativeTheme;
export var net: Electron.Net;
export var netLog: Electron.NetLog;
Expand All @@ -33,24 +33,24 @@ export var powerMonitor: Electron.PowerMonitor;
export var powerSaveBlocker: Electron.PowerSaveBlocker;
export var protocol: Electron.Protocol;
export var screen: Electron.Screen;
export var ServiceWorkers: typeof Electron.ServiceWorkers;
export var session: typeof Electron.Session;
export var ServiceWorkers: Main.ServiceWorkers;
export var session: Main.Session;
export var shell: Electron.Shell;
export var systemPreferences: Electron.SystemPreferences;
export var TouchBar: typeof Electron.TouchBar;
export var TouchBarButton: typeof Electron.TouchBarButton;
export var TouchBarColorPicker: typeof Electron.TouchBarColorPicker;
export var TouchBarGroup: typeof Electron.TouchBarGroup;
export var TouchBarLabel: typeof Electron.TouchBarLabel;
export var TouchBarOtherItemsProxy: typeof Electron.TouchBarOtherItemsProxy;
export var TouchBarPopover: typeof Electron.TouchBarPopover;
export var TouchBarScrubber: typeof Electron.TouchBarScrubber;
export var TouchBarSegmentedControl: typeof Electron.TouchBarSegmentedControl;
export var TouchBarSlider: typeof Electron.TouchBarSlider;
export var TouchBarSpacer: typeof Electron.TouchBarSpacer;
export var TouchBarButton: Main.TouchBarButton;
export var TouchBarColorPicker: Main.TouchBarColorPicker;
export var TouchBarGroup: Main.TouchBarGroup;
export var TouchBarLabel: Main.TouchBarLabel;
export var TouchBarOtherItemsProxy: Main.TouchBarOtherItemsProxy;
export var TouchBarPopover: Main.TouchBarPopover;
export var TouchBarScrubber: Main.TouchBarScrubber;
export var TouchBarSegmentedControl: Main.TouchBarSegmentedControl;
export var TouchBarSlider: Main.TouchBarSlider;
export var TouchBarSpacer: Main.TouchBarSpacer;
export var Tray: typeof Electron.Tray;
export var webContents: typeof Electron.WebContents;
export var WebRequest: typeof Electron.WebRequest;
export var webContents: typeof Electron.webContents;
export var WebRequest: Main.WebRequest;

// Taken from `Remote`
export function getCurrentWebContents(): Electron.WebContents;
Expand Down