From bf140ce89a657bc18596cc909c991e3688481c28 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 28 Jul 2016 17:24:22 +0200 Subject: [PATCH] Add Electron specific versions to process.versions (#10320) --- github-electron/github-electron-main-tests.ts | 2 ++ github-electron/github-electron.d.ts | 12 ++++++++++ node/node.d.ts | 22 ++++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 9f79e6590f..0b928138e4 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -766,6 +766,8 @@ let image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png'); // process // https://github.com/electron/electron/blob/master/docs/api/process.md +console.log(process.versions.electron); +console.log(process.versions.chrome); console.log(process.type); console.log(process.resourcesPath); console.log(process.mas); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 217e230d9c..0cd51c1601 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -5107,6 +5107,18 @@ interface File { // https://github.com/electron/electron/blob/master/docs/api/process.md declare namespace NodeJS { + + interface ProcessVersions { + /** + * Electron's version string. + */ + electron: string; + /** + * Chrome's version string. + */ + chrome: string; + } + interface Process { /** * Setting this to true can disable the support for asar archives in Node's built-in modules. diff --git a/node/node.d.ts b/node/node.d.ts index bad534cdd7..359f1679c5 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -301,6 +301,17 @@ declare namespace NodeJS { heapUsed: number; } + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + export interface Process extends EventEmitter { stdout: WritableStream; stderr: WritableStream; @@ -320,16 +331,7 @@ declare namespace NodeJS { setuid(id: number): void; setuid(id: string): void; version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - }; + versions: ProcessVersions; config: { target_defaults: { cflags: any[];