update host specs shape

This commit is contained in:
licui
2018-10-30 12:23:26 -04:00
parent 42c77469c9
commit fbb37f3580
3 changed files with 52 additions and 72 deletions
+5 -3
View File
@@ -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;
}
+45 -13
View File
@@ -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<CpuInfo> } 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<SystemEvents> {
getRvmInfo(): Promise<RVMInfo>;
/**
* Retrieves system information.
* @return {Promise.<Hostspecs>}
* @return {Promise.<HostSpecs>}
* @tutorial System.getHostSpecs
*/
getHostSpecs(): Promise<HostSpecs>;
+2 -56
View File
@@ -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