mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
node: strict platform value (#14134)
* node: strict platform value From: https://nodejs.org/api/os.html#os_os_platform > Currently possible values are: > > - 'aix' > - 'darwin' > - 'freebsd' > - 'linux' > - 'openbsd' > - 'sunos' > - 'win32' > > Equivalent to process.platform. * node: add missing 'android' to platforms * node: improve platform strings also in v7
This commit is contained in:
Vendored
+11
-2
@@ -347,6 +347,15 @@ declare namespace NodeJS {
|
||||
openssl: string;
|
||||
}
|
||||
|
||||
type Platform = 'aix'
|
||||
| 'android'
|
||||
| 'darwin'
|
||||
| 'freebsd'
|
||||
| 'linux'
|
||||
| 'openbsd'
|
||||
| 'sunos'
|
||||
| 'win32';
|
||||
|
||||
export interface Process extends EventEmitter {
|
||||
stdout: WritableStream;
|
||||
stderr: WritableStream;
|
||||
@@ -399,7 +408,7 @@ declare namespace NodeJS {
|
||||
pid: number;
|
||||
title: string;
|
||||
arch: string;
|
||||
platform: string;
|
||||
platform: Platform;
|
||||
mainModule?: NodeModule;
|
||||
memoryUsage(): MemoryUsage;
|
||||
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
||||
@@ -1311,7 +1320,7 @@ declare module "os" {
|
||||
},
|
||||
};
|
||||
export function arch(): string;
|
||||
export function platform(): string;
|
||||
export function platform(): NodeJS.Platform;
|
||||
export function tmpdir(): string;
|
||||
export var EOL: string;
|
||||
export function endianness(): "BE" | "LE";
|
||||
|
||||
@@ -1481,7 +1481,6 @@ namespace os_tests {
|
||||
result = os.endianness();
|
||||
result = os.hostname();
|
||||
result = os.type();
|
||||
result = os.platform();
|
||||
result = os.arch();
|
||||
result = os.release();
|
||||
result = os.EOL;
|
||||
|
||||
Vendored
+11
-2
@@ -347,6 +347,15 @@ declare namespace NodeJS {
|
||||
openssl: string;
|
||||
}
|
||||
|
||||
type Platform = 'aix'
|
||||
| 'android'
|
||||
| 'darwin'
|
||||
| 'freebsd'
|
||||
| 'linux'
|
||||
| 'openbsd'
|
||||
| 'sunos'
|
||||
| 'win32';
|
||||
|
||||
export interface Process extends EventEmitter {
|
||||
stdout: WritableStream;
|
||||
stderr: WritableStream;
|
||||
@@ -399,7 +408,7 @@ declare namespace NodeJS {
|
||||
pid: number;
|
||||
title: string;
|
||||
arch: string;
|
||||
platform: string;
|
||||
platform: Platform;
|
||||
mainModule?: NodeModule;
|
||||
memoryUsage(): MemoryUsage;
|
||||
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
||||
@@ -1262,7 +1271,7 @@ declare module "os" {
|
||||
},
|
||||
};
|
||||
export function arch(): string;
|
||||
export function platform(): string;
|
||||
export function platform(): NodeJS.Platform;
|
||||
export function tmpdir(): string;
|
||||
export var EOL: string;
|
||||
export function endianness(): "BE" | "LE";
|
||||
|
||||
Reference in New Issue
Block a user