From 1bcc35b84a78fb052b8092b7ed57c2ce763f5d4b Mon Sep 17 00:00:00 2001 From: Sebastien Filion Date: Fri, 10 Jul 2020 10:07:12 -0400 Subject: feat(unstable): add Deno.consoleSize (#6520) --- cli/js/lib.deno.unstable.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cli/js/lib.deno.unstable.d.ts') diff --git a/cli/js/lib.deno.unstable.d.ts b/cli/js/lib.deno.unstable.d.ts index f237cd4be..a6547ebca 100644 --- a/cli/js/lib.deno.unstable.d.ts +++ b/cli/js/lib.deno.unstable.d.ts @@ -43,6 +43,21 @@ declare namespace Deno { * Requires `allow-read` and `allow-write` permissions. */ export function link(oldpath: string, newpath: string): Promise; + /** **UNSTABLE**: New API, yet to be vetted. + * + * Gets the size of the console as columns/rows. + * + * ```ts + * const { columns, rows } = await Deno.consoleSize(Deno.stdout.rid); + * ``` + */ + export function consoleSize( + rid: number + ): { + columns: number; + rows: number; + }; + export type SymlinkOptions = { type: "file" | "dir"; }; -- cgit v1.2.3