import { useContext } from 'react';
import { TerminalSizeContext } from '../components/TerminalSizeContext.js';
const writeToProcessStdout = (chunk) => {
    process.stdout.write(chunk);
};
const useStdout = () => {
    const size = useContext(TerminalSizeContext);
    const columns = size?.columns ?? process.stdout.columns ?? 80;
    const rows = size?.rows ?? process.stdout.rows ?? 24;
    return {
        stdout: { columns, rows, write: writeToProcessStdout },
        write: writeToProcessStdout,
    };
};
export default useStdout;
//# sourceMappingURL=use-stdout.js.map