"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

//#region src/stdio/_internal.ts
/**
* @private
*
* @file Shared TTY primitives for stdio/stdout.ts + stdio/stderr.ts.
*/
/**
* Clear the current line on the given stream. Only works in TTY environments.
*
* @private
*/
function clearLineOn(stream) {
	if (stream.isTTY) {
		stream.cursorTo(0);
		stream.clearLine(0);
	}
}
/**
* Move cursor to specific position on the given stream. Only works in TTY
* environments.
*
* @private
*/
function cursorToOn(stream, x, y) {
	if (stream.isTTY) stream.cursorTo(x, y);
}
/**
* Get the number of columns on the given stream (or 80 fallback).
*
* @private
*/
function getColumnsOf(stream) {
	return stream.columns || 80;
}
/**
* Get the number of rows on the given stream (or 24 fallback).
*
* @private
*/
function getRowsOf(stream) {
	return stream.rows || 24;
}
/**
* Check if the given stream is connected to a TTY.
*
* @private
*/
function isTTYOf(stream) {
	return stream.isTTY || false;
}

//#endregion
exports.clearLineOn = clearLineOn;
exports.cursorToOn = cursorToOn;
exports.getColumnsOf = getColumnsOf;
exports.getRowsOf = getRowsOf;
exports.isTTYOf = isTTYOf;