mirror of
https://github.com/denoland/deno.git
synced 2025-09-30 22:21:15 +00:00
feat(unstable): add Deno.consoleSize (#6520)
This commit is contained in:
parent
dc6b3ef714
commit
1bcc35b84a
5 changed files with 115 additions and 3 deletions
15
cli/js/lib.deno.unstable.d.ts
vendored
15
cli/js/lib.deno.unstable.d.ts
vendored
|
@ -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";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue