-
Notifications
You must be signed in to change notification settings - Fork 36
fix: compilation error with @types/node@13 (which is now latest) #164
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refer to EventEmitter as events.EventEmitter instead of NodeJS.EventEmitter
Contributor
Author
|
Here is the diff: --- electron-old.d.ts 2019-12-31 08:33:14.292119971 -0800
+++ electron-new.d.ts 2019-12-31 08:32:47.624105280 -0800
@@ -4,10 +4,13 @@
// Definitions: https://github.com/electron/electron-typescript-definitions
/// <reference types="node" />
+import events = require('events');
type GlobalEvent = Event;
-declare namespace Electron {
+declare global {
+
+namespace Electron {
class Accelerator extends String {
}
@@ -106,7 +109,7 @@
const webFrame: WebFrame;
const webviewTag: WebviewTag;
- interface App extends NodeJS.EventEmitter {
+ interface App extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/app
@@ -1487,7 +1490,7 @@
userAgentFallback: string;
}
- interface AutoUpdater extends NodeJS.EventEmitter {
+ interface AutoUpdater extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/auto-updater
@@ -1645,7 +1648,7 @@
webContents: WebContents;
}
- class BrowserWindow extends NodeJS.EventEmitter {
+ class BrowserWindow extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/browser-window
@@ -3025,7 +3028,7 @@
state: string;
}
- class ClientRequest extends NodeJS.EventEmitter {
+ class ClientRequest extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/client-request
@@ -3412,7 +3415,7 @@
stopRecording(resultFilePath?: string): Promise<string>;
}
- interface ContextBridge extends NodeJS.EventEmitter {
+ interface ContextBridge extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/context-bridge
@@ -3465,7 +3468,7 @@
value: string;
}
- class Cookies extends NodeJS.EventEmitter {
+ class Cookies extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/cookies
@@ -3622,7 +3625,7 @@
scheme: string;
}
- class Debugger extends NodeJS.EventEmitter {
+ class Debugger extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/debugger
@@ -4151,7 +4154,7 @@
show(): Promise<void>;
}
- class DownloadItem extends NodeJS.EventEmitter {
+ class DownloadItem extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/download-item
@@ -4481,7 +4484,7 @@
webgl2: string;
}
- interface InAppPurchase extends NodeJS.EventEmitter {
+ interface InAppPurchase extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/in-app-purchase
@@ -4530,7 +4533,7 @@
restoreCompletedTransactions(): void;
}
- class IncomingMessage extends NodeJS.EventEmitter {
+ class IncomingMessage extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/incoming-message
@@ -4636,7 +4639,7 @@
writeTransferCount: number;
}
- interface IpcMain extends NodeJS.EventEmitter {
+ interface IpcMain extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/ipc-main
@@ -4722,7 +4725,7 @@
sender: WebContents;
}
- interface IpcRenderer extends NodeJS.EventEmitter {
+ interface IpcRenderer extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/ipc-renderer
@@ -5273,7 +5276,7 @@
isMacTemplateImage: boolean;
}
- interface NativeTheme extends NodeJS.EventEmitter {
+ interface NativeTheme extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/native-theme
@@ -5391,7 +5394,7 @@
readonly currentlyLoggingPath: string;
}
- class Notification extends NodeJS.EventEmitter {
+ class Notification extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/notification
@@ -5524,7 +5527,7 @@
y: number;
}
- interface PowerMonitor extends NodeJS.EventEmitter {
+ interface PowerMonitor extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/power-monitor
@@ -6131,7 +6134,7 @@
username?: string;
}
- interface Screen extends NodeJS.EventEmitter {
+ interface Screen extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/screen
@@ -6258,7 +6261,7 @@
label?: string;
}
- class Session extends NodeJS.EventEmitter {
+ class Session extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/session
@@ -6714,7 +6717,7 @@
mimeType?: string;
}
- interface SystemPreferences extends NodeJS.EventEmitter {
+ interface SystemPreferences extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/system-preferences
@@ -7250,7 +7253,7 @@
label: string;
}
- class TouchBarColorPicker extends NodeJS.EventEmitter {
+ class TouchBarColorPicker extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-color-picker
@@ -7262,7 +7265,7 @@
selectedColor: string;
}
- class TouchBarGroup extends NodeJS.EventEmitter {
+ class TouchBarGroup extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-group
@@ -7272,7 +7275,7 @@
constructor(options: TouchBarGroupConstructorOptions);
}
- class TouchBarLabel extends NodeJS.EventEmitter {
+ class TouchBarLabel extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-label
@@ -7285,7 +7288,7 @@
textColor: string;
}
- class TouchBarPopover extends NodeJS.EventEmitter {
+ class TouchBarPopover extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-popover
@@ -7297,7 +7300,7 @@
label: string;
}
- class TouchBarScrubber extends NodeJS.EventEmitter {
+ class TouchBarScrubber extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-scrubber
@@ -7313,7 +7316,7 @@
showArrowButtons: boolean;
}
- class TouchBarSegmentedControl extends NodeJS.EventEmitter {
+ class TouchBarSegmentedControl extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-segmented-control
@@ -7326,7 +7329,7 @@
selectedIndex: number;
}
- class TouchBarSlider extends NodeJS.EventEmitter {
+ class TouchBarSlider extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-slider
@@ -7340,7 +7343,7 @@
value: number;
}
- class TouchBarSpacer extends NodeJS.EventEmitter {
+ class TouchBarSpacer extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/touch-bar-spacer
@@ -7461,7 +7464,7 @@
transactionState: ('purchasing' | 'purchased' | 'failed' | 'restored' | 'deferred');
}
- class Tray extends NodeJS.EventEmitter {
+ class Tray extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/tray
@@ -7911,7 +7914,7 @@
type: string;
}
- class WebContents extends NodeJS.EventEmitter {
+ class WebContents extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/web-contents
@@ -9622,7 +9625,7 @@
zoomLevel: number;
}
- interface WebFrame extends NodeJS.EventEmitter {
+ interface WebFrame extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/web-frame
@@ -13342,32 +13345,10 @@
}
-declare module 'electron' {
- export = Electron;
-}
-
-interface NodeRequireFunction {
- (moduleName: 'electron'): typeof Electron;
-}
-
-interface File {
- /**
- * The real path to the file on the users filesystem
- */
- path: string;
-}
-
-declare module 'original-fs' {
- import * as fs from 'fs';
- export = fs;
-}
-
-interface Document {
- createElement(tagName: 'webview'): Electron.WebviewTag;
-}
-declare namespace NodeJS {
- interface Process extends NodeJS.EventEmitter {
+namespace NodeJS {
+ interface ReadableStream {}
+ interface Process extends events.EventEmitter {
// Docs: http://electronjs.org/docs/api/process
@@ -13564,4 +13545,31 @@
readonly electron: string;
readonly chrome: string;
}
-}
\ No newline at end of file
+}
+
+interface NodeRequireFunction {
+ (moduleName: 'electron'): typeof Electron;
+}
+
+interface File {
+ /**
+ * The real path to the file on the users filesystem
+ */
+ path: string;
+}
+
+interface Document {
+ createElement(tagName: 'webview'): Electron.WebviewTag;
+}
+
+}
+
+declare module 'electron' {
+ export = Electron;
+}
+
+declare module 'original-fs' {
+ import * as fs from 'fs';
+ export = fs;
+}
+ |
3 tasks
Member
|
I don't think this diff is worth supporting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Like #163, but compatible with versions of Typescript before 2.9. The diff is larger and uglier, however.
import events = require('events')declare global {except pre-existing ambient modules 'electron' and 'original-fs'.