feat(unstable): add Deno.consoleSize (#6520)

This commit is contained in:
Sebastien Filion 2020-07-10 10:07:12 -04:00 committed by GitHub
parent dc6b3ef714
commit 1bcc35b84a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 115 additions and 3 deletions

View file

@ -43,6 +43,21 @@ declare namespace Deno {
* Requires `allow-read` and `allow-write` permissions. */
export function link(oldpath: string, newpath: string): Promise<void>;
/** **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";
};