From f3cb4f2ce01f86de2c4c9a775c7318460b389195 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Thu, 9 Feb 2023 23:23:16 +0100 Subject: [PATCH] Make process.spawn result a global type --- CHANGELOG.md | 1 + luneTypes.d.luau | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f173f8..9799178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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. +- Added a global type `ProcessSpawnOptions` for the return type of `process.spawn` ### Changed diff --git a/luneTypes.d.luau b/luneTypes.d.luau index 39f561e..8c936a2 100644 --- a/luneTypes.d.luau +++ b/luneTypes.d.luau @@ -213,6 +213,13 @@ export type ProcessSpawnOptions = { stdio: ProcessSpawnOptionsStdio?, } +export type ProcessSpawnResult = { + ok: boolean, + code: number, + stdout: string, + stderr: string, +} + --[=[ @class process @@ -274,12 +281,7 @@ declare process: { program: string, params: { string }?, options: ProcessSpawnOptions? - ) -> { - ok: boolean, - code: number, - stdout: string, - stderr: string, - }, + ) -> ProcessSpawnResult, } --[=[