diff --git a/node/index.d.ts b/node/index.d.ts index 1f32030db7..32d3f5a203 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -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"; diff --git a/node/node-tests.ts b/node/node-tests.ts index adcadb1a60..2844ca8e6e 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -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; diff --git a/node/v6/index.d.ts b/node/v6/index.d.ts index ba3a7685fc..ed07d1cad1 100644 --- a/node/v6/index.d.ts +++ b/node/v6/index.d.ts @@ -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";