{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type TtyInfo = {\n    stdin: boolean,\n    stdout: boolean,\n    stderr: boolean,\n}",
          "name": "TtyInfo",
          "tags": [],
          "source": {
            "path": "",
            "line": 31
          },
          "fields": [
            {
              "lua_type": "stdin: boolean",
              "name": "stdin",
              "desc": ""
            },
            {
              "lua_type": "stdout: boolean",
              "name": "stdout",
              "desc": ""
            },
            {
              "lua_type": "stderr: boolean",
              "name": "stderr",
              "desc": ""
            }
          ],
          "desc": "Result of `isatty()` -- indicates which streams are connected to a terminal."
        }
      ],
      "name": "@eryx/stdio",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 43
          },
          "is_method": false,
          "signature": "stdio.read(bytes: number?) → string?",
          "owner": "stdio",
          "desc": "Reads up to `bytes` bytes from stdin (default 4096).\nReturns `nil` on EOF.\n",
          "tags": [],
          "name": "read",
          "return_str": "string?",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "bytes",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 51
          },
          "is_method": false,
          "signature": "stdio.readline() → string?",
          "owner": "stdio",
          "desc": "Reads one line from stdin, stripping the trailing newline.\nReturns `nil` on EOF.\n",
          "tags": [],
          "name": "readline",
          "return_str": "string?",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string?",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 56
          },
          "is_method": false,
          "signature": "stdio.write(data: string) → ()",
          "owner": "stdio",
          "desc": "Writes a string to stdout.",
          "tags": [],
          "name": "write",
          "return_str": "",
          "function_type": "Function",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 59
          },
          "is_method": false,
          "signature": "stdio.writeerr(data: string) → ()",
          "owner": "stdio",
          "desc": "Writes a string to stderr.",
          "tags": [],
          "name": "writeerr",
          "return_str": "",
          "function_type": "Function",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 62
          },
          "is_method": false,
          "signature": "stdio.flush() → ()",
          "owner": "stdio",
          "desc": "Flushes the stdout buffer.",
          "tags": [],
          "name": "flush",
          "return_str": "",
          "function_type": "Function",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 65
          },
          "is_method": false,
          "signature": "stdio.flusherr() → ()",
          "owner": "stdio",
          "desc": "Flushes the stderr buffer.",
          "tags": [],
          "name": "flusherr",
          "return_str": "",
          "function_type": "Function",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 74
          },
          "is_method": false,
          "signature": "stdio.readasync(bytes: number?) → string?",
          "owner": "stdio",
          "desc": "Yields the current coroutine until data is available on stdin,\nthen returns up to `bytes` bytes (default 4096).\nReturns `nil` on EOF.  Only one `readasync` may be pending at a time.\n",
          "tags": [],
          "name": "readasync",
          "return_str": "string?",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "bytes",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 84
          },
          "is_method": false,
          "signature": "stdio.isatty() → TtyInfo",
          "owner": "stdio",
          "desc": "Returns a table indicating whether each standard stream is connected\nto a terminal (TTY).\n",
          "tags": [],
          "name": "isatty",
          "return_str": "TtyInfo",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "TtyInfo",
              "desc": ""
            }
          ],
          "params": []
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Standard I/O module -- read/write access to stdin, stdout, and stderr.\n\nProvides both synchronous (blocking) and asynchronous (yielding) APIs\nfor interacting with the process's standard streams.\n\n## Quick start\n```luau\nlocal stdio = require(\"@eryx/stdio\")\n\n-- Prompt the user\nstdio.write(\"Enter your name: \")\nstdio.flush()\nlocal name = stdio.readln()\nstdio.write(\"Hello, \" .. (name or \"stranger\") .. \"!\\n\")\n\n-- Write to stderr\nstdio.writeerr(\"warning: something happened\\n\")\n\n-- Check if running in a terminal\nlocal tty = stdio.isatty()\nif tty.stdin then\n    print(\"stdin is a terminal\")\nend\n```\n"
    }
  ]
}