Skip to content
Myr

Avoid using NodeJS global type (#1032)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent fee011d · Browse files · 4 files+13 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>

Diff stats

4 files+13 added−8 removed

  • other:+13 added−8 removed

4 files+13 added−8 removed

modified:test-d/return/result-main.test-d.ts+5 added-4 removed
modified:types/arguments/options.d.ts+4 added-2 removed
1import type {SignalConstants} from 'node:os';2import type {env} from 'node:process';3import type {Readable} from 'node:stream';4import type {Unless} from '../utils.js';5import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionsProperty} from '../stdio/type.js';6import type {FdGenericOption} from './specific.js';
67 unmodified lines
74 Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).7576 @default [process.env](https://nodejs.org/api/process.html#processenv)77 */76 readonly env?: NodeJS.ProcessEnv;78 readonly env?: typeof env;7980 /**81 If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).82 If `false`, only the `env` option is used, not `process.env`.
196 unmodified lines
279 This can be either a name (like `'SIGTERM'`) or a number (like `9`).280281 @default 'SIGTERM'282 */281 readonly killSignal?: NodeJS.Signals | number;283 readonly killSignal?: keyof SignalConstants | number;284285 /**286 Run the subprocess independently from the current process.287
85 unmodified lines
modified:types/return/result.d.ts+2 added-1 removed
1import type {SignalConstants} from 'node:os';2import type {Unless} from '../utils.js';3import type {CommonOptions, Options, SyncOptions} from '../arguments/options.js';4import type {ErrorProperties} from './final-error.js';5import type {ResultAll} from './result-all.js';
111 unmodified lines
117 - Another process. This case is [not supported on Windows](https://nodejs.org/api/process.html#signal-events).118119 If a signal terminated the subprocess, this property is defined and included in the error message. Otherwise it is `undefined`.120 */120 signal?: NodeJS.Signals;121 signal?: keyof SignalConstants;122123 /**124 A human-friendly description of the signal that was used to terminate the subprocess.125
65 unmodified lines
modified:types/subprocess/subprocess.d.ts+2 added-1 removed
1import type {ChildProcess} from 'node:child_process';2import type {SignalConstants} from 'node:os';3import type {Readable, Writable, Duplex} from 'node:stream';4import type {StdioOptionsArray} from '../stdio/type.js';5import type {Options} from '../arguments/options.js';6import type {Result} from '../return/result.js';
79 unmodified lines
86 When an error is passed as argument, it is set to the subprocess' `error.cause`. The subprocess is then terminated with the default signal. This does not emit the [`error` event](https://nodejs.org/api/child_process.html#event-error).8788 [More info.](https://nodejs.org/api/child_process.html#subprocesskillsignal)89 */89 kill(signal?: NodeJS.Signals | number, error?: Error): boolean;90 kill(signal?: keyof SignalConstants | number, error?: Error): boolean;91 kill(error?: Error): boolean;9293 /**94 Subprocesses are [async iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator). They iterate over each output line.
39 unmodified lines