MCPcopy Create free account
hub / github.com/denoland/std / constructor

Method constructor

cli/unstable_static_line.ts:55–66  ·  view source on GitHub ↗

* Constructs a new instance. * * @param on What side of the terminal the line should be on.

(on: "top" | "bottom" = "bottom")

Source from the content-addressed store, hash-verified

53 * @param on What side of the terminal the line should be on.
54 */
55 constructor(on: "top" | "bottom" = "bottom") {
56 this.#atTop = on === "top";
57 this.#lines = this.#atTop ? linesAtTop : linesAtBottom;
58 this.#lines.push(this.#id);
59 const top = linesAtTop.length + 1;
60 const bottom = getRows() - linesAtBottom.length;
61 write(
62 (this.#atTop ? "" : Ansi.shiftUpAndInsert()) +
63 Ansi.setScrollableRegion(top, bottom) +
64 Ansi.setCursorPosition(bottom),
65 );
66 }
67
68 /**
69 * Overwrites the contents of the line.

Callers

nothing calls this directly

Calls 2

writeFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected