Make process.spawn result a global type

This commit is contained in:
Filip Tibell 2023-02-09 23:23:16 +01:00
parent be39ecc00a
commit f3cb4f2ce0
No known key found for this signature in database
2 changed files with 9 additions and 6 deletions

View file

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Setting `cwd` in the options for `process.spawn` to a path starting with a tilde (`~`) will now use a path relative to the platform-specific home / user directory. - Setting `cwd` in the options for `process.spawn` to a path starting with a tilde (`~`) will now use a path relative to the platform-specific home / user directory.
- Added a global type `ProcessSpawnOptions` for the return type of `process.spawn`
### Changed ### Changed

View file

@ -213,6 +213,13 @@ export type ProcessSpawnOptions = {
stdio: ProcessSpawnOptionsStdio?, stdio: ProcessSpawnOptionsStdio?,
} }
export type ProcessSpawnResult = {
ok: boolean,
code: number,
stdout: string,
stderr: string,
}
--[=[ --[=[
@class process @class process
@ -274,12 +281,7 @@ declare process: {
program: string, program: string,
params: { string }?, params: { string }?,
options: ProcessSpawnOptions? options: ProcessSpawnOptions?
) -> { ) -> ProcessSpawnResult,
ok: boolean,
code: number,
stdout: string,
stderr: string,
},
} }
--[=[ --[=[