mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 15:14:33 +00:00
feat: Stabilize Deno.consoleSize() API (#15933)
This commit stabilizes "Deno.consoleSize()" API. There is one change compared to previous unstable API, in that the API doesn't accept any arguments. Console size is established by querying syscalls for stdio streams at fd 0, 1 and 2.
This commit is contained in:
parent
af62e0833d
commit
ab0c33ebf8
9 changed files with 77 additions and 70 deletions
13
cli/dts/lib.deno.ns.d.ts
vendored
13
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -1901,6 +1901,19 @@ declare namespace Deno {
|
|||
*/
|
||||
export const File: typeof FsFile;
|
||||
|
||||
/** Gets the size of the console as columns/rows.
|
||||
*
|
||||
* ```ts
|
||||
* const { columns, rows } = Deno.consoleSize();
|
||||
* ```
|
||||
*
|
||||
* @category I/O
|
||||
*/
|
||||
export function consoleSize(): {
|
||||
columns: number;
|
||||
rows: number;
|
||||
};
|
||||
|
||||
/** @category I/O */
|
||||
export interface SetRawOptions {
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue