From 9ebfbf0296547999416028461dd76572bbcf9bbd Mon Sep 17 00:00:00 2001 From: Ludea Date: Thu, 17 Oct 2024 13:44:43 +0200 Subject: [PATCH] typescript api --- plugins/shell/guest-js/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/shell/guest-js/index.ts b/plugins/shell/guest-js/index.ts index 1ed2ac5d..36ff695f 100644 --- a/plugins/shell/guest-js/index.ts +++ b/plugins/shell/guest-js/index.ts @@ -339,6 +339,20 @@ class Child { pid: this.pid }) } + + /** + * Waits for the child to exit completely, returning the status that it exited with. + * + * @returns A promise with ExitStatus. + * + * @since 2.0.2 + */ + async wait(): Promise { + await invoke('plugin:shell|wait', { + cmd: 'waitChild', + pid: this.pid + }) + } } interface CommandEvents {