diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index dab3b0c5d9..cd771ff805 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Microsoft TypeScript // DefinitelyTyped // Sebastian Silbermann +// Sander Koenders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -407,6 +408,10 @@ declare namespace NodeJS { isTTY?: true; } + export interface ProcessEnv { + [key: string]: string | undefined; + } + export interface Process extends EventEmitter { stdout: Socket; stderr: Socket; @@ -418,7 +423,7 @@ declare namespace NodeJS { chdir(directory: string): void; cwd(): string; debugPort: number; - env: any; + env: ProcessEnv; exit(code?: number): void; exitCode: number; getgid(): number; diff --git a/types/node/v4/node-tests.ts b/types/node/v4/node-tests.ts index 6409e83e18..8de12003cf 100644 --- a/types/node/v4/node-tests.ts +++ b/types/node/v4/node-tests.ts @@ -734,19 +734,7 @@ namespace path_tests { // returns // ['foo', 'bar', 'baz'] - console.log(process.env.PATH) - // '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' - - process.env.PATH.split(path.delimiter) - // returns - // ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] - - console.log(process.env.PATH) - // 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' - - process.env.PATH.split(path.delimiter) - // returns - // ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + process.env["PATH"]; // $ExpectType string path.parse('/home/user/dir/file.txt') // returns diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 570e668c53..baf0776dcf 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -7,6 +7,7 @@ // Sebastian Silbermann // Alorel // Hoàng Văn Khải +// Sander Koenders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -460,6 +461,10 @@ declare namespace NodeJS { isTTY?: true; } + export interface ProcessEnv { + [key: string]: string | undefined; + } + export interface WriteStream extends Socket { columns?: number; rows?: number; @@ -482,7 +487,7 @@ declare namespace NodeJS { cwd(): string; debugPort: number; emitWarning(warning: string | Error, name?: string, ctor?: Function): void; - env: any; + env: ProcessEnv; exit(code?: number): void; exitCode: number; getgid(): number; diff --git a/types/node/v6/node-tests.ts b/types/node/v6/node-tests.ts index 4457f83492..789fc5c744 100644 --- a/types/node/v6/node-tests.ts +++ b/types/node/v6/node-tests.ts @@ -1364,19 +1364,7 @@ namespace path_tests { // returns // ['foo', 'bar', 'baz'] - console.log(process.env.PATH) - // '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' - - process.env.PATH.split(path.delimiter) - // returns - // ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] - - console.log(process.env.PATH) - // 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' - - process.env.PATH.split(path.delimiter) - // returns - // ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + process.env["PATH"]; // $ExpectType string path.parse('/home/user/dir/file.txt') // returns diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 055933977d..18442291a1 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -7,6 +7,7 @@ // Wilco Bakker // Sebastian Silbermann // Hoàng Văn Khải +// Sander Koenders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -456,6 +457,10 @@ declare namespace NodeJS { isTTY?: true; } + export interface ProcessEnv { + [key: string]: string | undefined; + } + export interface WriteStream extends Socket { columns?: number; rows?: number; @@ -479,7 +484,7 @@ declare namespace NodeJS { cwd(): string; debugPort: number; emitWarning(warning: string | Error, name?: string, ctor?: Function): void; - env: any; + env: ProcessEnv; exit(code?: number): never; exitCode: number; getgid(): number; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index 0ea05066b4..8d6f0af1e3 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -1346,19 +1346,7 @@ namespace path_tests { // returns // ['foo', 'bar', 'baz'] - console.log(process.env.PATH) - // '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' - - process.env.PATH.split(path.delimiter) - // returns - // ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] - - console.log(process.env.PATH) - // 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' - - process.env.PATH.split(path.delimiter) - // returns - // ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + process.env["PATH"]; // $ExpectType string path.parse('/home/user/dir/file.txt') // returns