diff options
author | Chris Knight <cknight1234@gmail.com> | 2020-03-26 19:52:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 15:52:47 -0400 |
commit | 8bcdb422e387a88075126d80e1612a30f5a7d89e (patch) | |
tree | f8b3cc5148619f63ffe0692ab9aae267560c832f /cli/js/lib.deno.ns.d.ts | |
parent | a053462566874f699fa7f27961143e5f6ff070d3 (diff) |
Improve isatty and kill API docs; Deno.kill() - throw on Windows (#4497)
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index ed109b817..781387f51 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -743,12 +743,21 @@ declare namespace Deno { */ export type OpenMode = "r" | "r+" | "w" | "w+" | "a" | "a+" | "x" | "x+"; - /** **UNSTABLE**: newly added API + /** **UNSTABLE**: new API, yet to be vetted * - * Check if a given resource is TTY. */ + * Check if a given resource id (`rid`) is a TTY. + * + * //This example is system and context specific + * const nonTTYRid = Deno.openSync("my_file.txt").rid; + * const ttyRid = Deno.openSync("/dev/tty6").rid; + * console.log(Deno.isatty(nonTTYRid)); // false + * console.log(Deno.isatty(ttyRid)); // true + * Deno.close(nonTTYRid); + * Deno.close(ttyRid); + */ export function isatty(rid: number): boolean; - /** **UNSTABLE**: newly added API + /** **UNSTABLE**: new API, yet to be vetted * * Set TTY to be under raw mode or not. */ export function setRaw(rid: number, mode: boolean): void; @@ -1876,15 +1885,22 @@ declare namespace Deno { * the stream to `/dev/null`. */ type ProcessStdio = "inherit" | "piped" | "null"; - /** **UNSTABLE**: the `signo` argument maybe shouldn't be number. Should throw - * on Windows instead of silently succeeding. + /** **UNSTABLE**: The `signo` argument may change to require the Deno.Signal + * enum. * - * Send a signal to process under given `pid`. Linux/Mac OS only currently. + * Send a signal to process under given `pid`. This functionality currently + * only works on Linux and Mac OS. * * If `pid` is negative, the signal will be sent to the process group * identified by `pid`. * - * Currently no-op on Windows. + * const p = Deno.run({ + * cmd: ["python", "-c", "from time import sleep; sleep(10000)"] + * }); + * + * Deno.kill(p.pid, Deno.Signal.SIGINT); + * + * Throws Error (not yet implemented) on Windows * * Requires `allow-run` permission. */ export function kill(pid: number, signo: number): void; |