From fbb37f35806bf494708030a4ce5fd1581dbdf029 Mon Sep 17 00:00:00 2001
From: licui
Date: Tue, 30 Oct 2018 12:23:26 -0400
Subject: [PATCH] update host specs shape
---
types/openfin/_v2/api/system/host-specs.d.ts | 8 ++-
types/openfin/_v2/api/system/system.d.ts | 58 +++++++++++++++-----
types/openfin/index.d.ts | 58 +-------------------
3 files changed, 52 insertions(+), 72 deletions(-)
diff --git a/types/openfin/_v2/api/system/host-specs.d.ts b/types/openfin/_v2/api/system/host-specs.d.ts
index 2c5a134aea..dfd3e665fd 100644
--- a/types/openfin/_v2/api/system/host-specs.d.ts
+++ b/types/openfin/_v2/api/system/host-specs.d.ts
@@ -14,9 +14,11 @@ export interface GpuInfo {
name: string;
}
export interface HostSpecs {
- cpu: CpuInfo[];
- memory: number;
+ aeroGlassEnabled?: boolean;
arch: string;
- name: string;
+ cpus: CpuInfo[];
gpu: GpuInfo;
+ memory: number;
+ name: string;
+ screenSaver?: boolean;
}
diff --git a/types/openfin/_v2/api/system/system.d.ts b/types/openfin/_v2/api/system/system.d.ts
index 497bd5f358..aa0467f340 100644
--- a/types/openfin/_v2/api/system/system.d.ts
+++ b/types/openfin/_v2/api/system/system.d.ts
@@ -65,6 +65,13 @@ import { SystemEvents } from '../events/system';
* @typedef { Object } CookieOption
* @property { string } name The name of the cookie
*/
+/**
+ * CpuInfo interface
+ * @typedef { Object } CpuInfo
+ * @property { string } model The model of the cpu
+ * @property { number } speed The number in MHz
+ * @property { Time } times The numbers of milliseconds the CPU has spent in different modes.
+ */
/**
* CrashReporterOption interface
* @typedef { Object } CrashReporterOption
@@ -107,19 +114,35 @@ import { SystemEvents } from '../events/system';
* @property { string } uuid The uuid of the external connection
*/
/**
-* ExternalProcessRequestType interface
-* @typedef { Object } ExternalProcessRequestType
-* @property { string } path The file path to where the running application resides
-* @property { string } arguments The argument passed to the running application
-* @property { Object } listener This is described in the {LaunchExternalProcessListner} type definition
-*/
+ * ExternalProcessRequestType interface
+ * @typedef { Object } ExternalProcessRequestType
+ * @property { string } path The file path to where the running application resides
+ * @property { string } arguments The argument passed to the running application
+ * @property { Object } listener This is described in the {LaunchExternalProcessListner} type definition
+ */
/**
-* GetLogRequestType interface
-* @typedef { Object } GetLogRequestType
-* @property { string } name The name of the running application
-* @property { number } endFile The file length of the log file
-* @property { number } sizeLimit The set size limit of the log file
-*/
+ * GetLogRequestType interface
+ * @typedef { Object } GetLogRequestType
+ * @property { string } name The name of the running application
+ * @property { number } endFile The file length of the log file
+ * @property { number } sizeLimit The set size limit of the log file
+ */
+/**
+ * GpuInfo interface
+ * @typedef { Object } GpuInfo
+ * @property { string } name The graphics card name
+ */
+/**
+ * HostSpecs interface
+ * @typedef { Object } HostSpecs
+ * @property { boolean } aeroGlassEnabled Value to check if Aero Glass theme is supported on Windows platforms
+ * @property { string } arch "x86" for 32-bit or "x86_64" for 64-bit
+ * @property { Array } cpus The same payload as Node's os.cpus()
+ * @property { GpuInfo } gpu The graphics card name
+ * @property { number } memory The same payload as Node's os.totalmem()
+ * @property { string } name The OS name and version/edition
+ * @property { boolean } screenSaver Value to check if screensaver is running. Supported on Windows only
+ */
/**
* Identity interface
* @typedef { Object } Identity
@@ -183,6 +206,15 @@ import { SystemEvents } from '../events/system';
* @property { number } timeout Time out period before the running application terminates
* @property { boolean } killtree Value to terminate the running application
*/
+/**
+ * Time interface
+ * @typedef { Object } Time
+ * @property { number } user The number of milliseconds the CPU has spent in user mode
+ * @property { number } nice The number of milliseconds the CPU has spent in nice mode
+ * @property { number } sys The number of milliseconds the CPU has spent in sys mode
+ * @property { number } idle The number of milliseconds the CPU has spent in idle mode
+ * @property { number } irq The number of milliseconds the CPU has spent in irq mode
+ */
/**
* WindowDetail interface
* @typedef { Object } WindowDetail
@@ -372,7 +404,7 @@ export default class System extends EmitterBase {
getRvmInfo(): Promise;
/**
* Retrieves system information.
- * @return {Promise.}
+ * @return {Promise.}
* @tutorial System.getHostSpecs
*/
getHostSpecs(): Promise;
diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts
index fb9a6fdc1d..fbde514cb0 100644
--- a/types/openfin/index.d.ts
+++ b/types/openfin/index.d.ts
@@ -33,6 +33,7 @@ import { CookieInfo, CookieOption } from './_v2/api/system/cookie';
import { AppAssetInfo, AppAssetRequest, RuntimeDownloadOptions, RuntimeDownloadProgress } from './_v2/api/system/download-asset';
import { DownloadPreloadInfo, DownloadPreloadOption } from './_v2/api/system/download-preload';
import { EntityInfo } from './_v2/api/system/entity';
+import { HostSpecs } from './_v2/api/system/host-specs';
import { ProcessInfo } from './_v2/api/system/process';
import { RegistryInfo } from './_v2/api/system/registry-info';
import { WindowDetail, WindowInfo } from './_v2/api/system/window';
@@ -718,7 +719,7 @@ declare namespace fin {
/**
* Retrieves system information.
*/
- getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void;
+ getHostSpecs(callback?: (info: HostSpecs) => void, errorCallback?: (reason: string) => void): void;
/**
* Retrieves the contents of the log with the specified filename.
*/
@@ -832,61 +833,6 @@ declare namespace fin {
updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void;
}
- interface HostSpecInfo {
- /**
- * "x86" for 32-bit or "x86_64" for 64-bit
- */
- arch: string;
- /**
- * Same payload as Node's os.cpus()
- */
- cpus: NodeCpuInfo[];
- gpu: {
- /**
- * Graphics card name
- */
- name: string;
- };
- /**
- * Same payload as Node's os.totalmem()
- */
- memory: number;
- /**
- * OS name and version/edition
- */
- name: string;
- }
-
- interface NodeCpuInfo {
- model: string;
- /**
- * in MHz
- */
- speed: number;
- times: {
- /**
- * The number of milliseconds the CPU has spent in user mode.
- */
- user: number;
- /**
- * The number of milliseconds the CPU has spent in nice mode.
- */
- nice: number;
- /**
- * The number of milliseconds the CPU has spent in sys mode.
- */
- sys: number;
- /**
- * The number of milliseconds the CPU has spent in idle mode.
- */
- idle: number;
- /**
- * The number of milliseconds the CPU has spent in irq mode.
- */
- irq: number;
- };
- }
-
interface LogInfo {
/**
* the filename of the log