summaryrefslogtreecommitdiff
path: root/cli/dts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-10-10 09:48:26 -0400
committerGitHub <noreply@github.com>2021-10-10 15:48:26 +0200
commit6ac0337165d5e341eee9bff9ff0065894289df69 (patch)
tree9cba4b1ac1f271dfc8a80aa8688a398e7cc91eb6 /cli/dts
parentffea0f198c27368405541e5a871deccc132c7ad9 (diff)
feat: Stabilize Deno.kill and Deno.Process.kill (#12375)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Diffstat (limited to 'cli/dts')
-rw-r--r--cli/dts/lib.deno.ns.d.ts56
-rw-r--r--cli/dts/lib.deno.unstable.d.ts50
2 files changed, 51 insertions, 55 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index 35d02776e..e1c23f10f 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -1956,14 +1956,46 @@ declare namespace Deno {
stderrOutput(): Promise<Uint8Array>;
close(): void;
- /** **UNSTABLE**
- *
- * Send a signal to process. This functionality currently only works on
- * Linux and Mac OS.
+ /** Send a signal to process.
*/
- kill(signo: string): void; // TODO(ry): Use Signal type here once made stable.
+ kill(signo: Signal): void;
}
+ export type Signal =
+ | "SIGABRT"
+ | "SIGALRM"
+ | "SIGBUS"
+ | "SIGCHLD"
+ | "SIGCONT"
+ | "SIGEMT"
+ | "SIGFPE"
+ | "SIGHUP"
+ | "SIGILL"
+ | "SIGINFO"
+ | "SIGINT"
+ | "SIGIO"
+ | "SIGKILL"
+ | "SIGPIPE"
+ | "SIGPROF"
+ | "SIGPWR"
+ | "SIGQUIT"
+ | "SIGSEGV"
+ | "SIGSTKFLT"
+ | "SIGSTOP"
+ | "SIGSYS"
+ | "SIGTERM"
+ | "SIGTRAP"
+ | "SIGTSTP"
+ | "SIGTTIN"
+ | "SIGTTOU"
+ | "SIGURG"
+ | "SIGUSR1"
+ | "SIGUSR2"
+ | "SIGVTALRM"
+ | "SIGWINCH"
+ | "SIGXCPU"
+ | "SIGXFSZ";
+
export type ProcessStatus =
| {
success: true;
@@ -2481,6 +2513,20 @@ declare namespace Deno {
options?: UpgradeWebSocketOptions,
): WebSocketUpgrade;
+ /** Send a signal to process under given `pid`.
+ *
+ * If `pid` is negative, the signal will be sent to the process group
+ * identified by `pid`.
+ *
+ * const p = Deno.run({
+ * cmd: ["sleep", "10000"]
+ * });
+ *
+ * Deno.kill(p.pid, "SIGINT");
+ *
+ * Requires `allow-run` permission. */
+ export function kill(pid: number, signo: Signal): void;
+
/** The type of the resource record.
* Only the listed types are supported currently. */
export type RecordType =
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index a024713a8..b2fe0d9c7 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -562,41 +562,6 @@ declare namespace Deno {
*/
export function applySourceMap(location: Location): Location;
- export type Signal =
- | "SIGABRT"
- | "SIGALRM"
- | "SIGBUS"
- | "SIGCHLD"
- | "SIGCONT"
- | "SIGEMT"
- | "SIGFPE"
- | "SIGHUP"
- | "SIGILL"
- | "SIGINFO"
- | "SIGINT"
- | "SIGIO"
- | "SIGKILL"
- | "SIGPIPE"
- | "SIGPROF"
- | "SIGPWR"
- | "SIGQUIT"
- | "SIGSEGV"
- | "SIGSTKFLT"
- | "SIGSTOP"
- | "SIGSYS"
- | "SIGTERM"
- | "SIGTRAP"
- | "SIGTSTP"
- | "SIGTTIN"
- | "SIGTTOU"
- | "SIGURG"
- | "SIGUSR1"
- | "SIGUSR2"
- | "SIGVTALRM"
- | "SIGWINCH"
- | "SIGXCPU"
- | "SIGXFSZ";
-
/** **UNSTABLE**: new API, yet to be vetted.
*
* Represents the stream of signals, implements both `AsyncIterator` and
@@ -722,21 +687,6 @@ declare namespace Deno {
},
>(opt: T): Process<T>;
- /** **UNSTABLE**: Send a signal to process under given `pid`. This
- * functionality only works on Linux and Mac OS.
- *
- * If `pid` is negative, the signal will be sent to the process group
- * identified by `pid`.
- *
- * const p = Deno.run({
- * cmd: ["sleep", "10000"]
- * });
- *
- * Deno.kill(p.pid, "SIGINT");
- *
- * Requires `allow-run` permission. */
- export function kill(pid: number, signo: Signal): void;
-
/** **UNSTABLE**: New API, yet to be vetted. Additional consideration is still
* necessary around the permissions required.
*