{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/fs",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 101
          },
          "is_method": false,
          "signature": "fs.open(path: string, mode: string?) → File",
          "owner": "fs",
          "desc": "Opens a file and returns a `File` handle.\nMode: `\"r\"` (default), `\"w\"`, `\"a\"`, `\"r+\"`, `\"w+\"`, `\"a+\"`.",
          "tags": [
            "Yields"
          ],
          "name": "open",
          "return_str": "File",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "File",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "string?",
              "name": "mode",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 106
          },
          "is_method": false,
          "signature": "fs.openSync(path: string, mode: string?) → File",
          "owner": "fs",
          "desc": "Opens a file and returns a `File` handle.\nMode: `\"r\"` (default), `\"w\"`, `\"a\"`, `\"r+\"`, `\"w+\"`, `\"a+\"`.",
          "tags": [],
          "name": "openSync",
          "return_str": "File",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "File",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "string?",
              "name": "mode",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 111
          },
          "is_method": false,
          "signature": "fs.exists(path: string) → boolean",
          "owner": "fs",
          "desc": "Returns `true` if the path exists on disk.",
          "tags": [],
          "name": "exists",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 115
          },
          "is_method": false,
          "signature": "fs.isFile(path: string) → boolean",
          "owner": "fs",
          "desc": "Returns `true` if the path is a regular file.",
          "tags": [],
          "name": "isFile",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 119
          },
          "is_method": false,
          "signature": "fs.isDirectory(path: string) → boolean",
          "owner": "fs",
          "desc": "Returns `true` if the path is a directory.",
          "tags": [],
          "name": "isDirectory",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 123
          },
          "is_method": false,
          "signature": "fs.mkdir(path: string) → boolean",
          "owner": "fs",
          "desc": "Creates a directory (and any missing parents). Returns `true` on success.",
          "tags": [],
          "name": "mkdir",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 127
          },
          "is_method": false,
          "signature": "fs.remove(path: string) → boolean",
          "owner": "fs",
          "desc": "Recursively removes a file or directory. Returns `true` on success.",
          "tags": [],
          "name": "remove",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 131
          },
          "is_method": false,
          "signature": "fs.rename(oldPath: string, newPath: string) → ()",
          "owner": "fs",
          "desc": "Atomically renames (moves) a file or directory.",
          "tags": [],
          "name": "rename",
          "return_str": "()",
          "function_type": "Function",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "oldPath",
              "desc": ""
            },
            {
              "lua_type": "string",
              "name": "newPath",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 135
          },
          "is_method": false,
          "signature": "fs.copy(src: string, dst: string) → ()",
          "owner": "fs",
          "desc": "Copies a file or directory (recursively). Overwrites existing destinations.",
          "tags": [],
          "name": "copy",
          "return_str": "()",
          "function_type": "Function",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "src",
              "desc": ""
            },
            {
              "lua_type": "string",
              "name": "dst",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 139
          },
          "is_method": false,
          "signature": "fs.listDir(path: string) → { string }",
          "owner": "fs",
          "desc": "Returns an array of filenames in the given directory.",
          "tags": [],
          "name": "listDir",
          "return_str": "{ string }",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "{ string }",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 145
          },
          "is_method": false,
          "signature": "fs.symlink(target: string, link: string, type: (\"file\" | \"directory\")?) → ()",
          "owner": "fs",
          "desc": "Creates a symlink at `link` pointing to `target`.\n`type`: `\"file\"` (default) or `\"directory\"`. Auto-detected from target if omitted.\nOn Windows, creating symlinks requires Developer Mode or administrator privileges.",
          "tags": [],
          "name": "symlink",
          "return_str": "()",
          "function_type": "Function",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "target",
              "desc": ""
            },
            {
              "lua_type": "string",
              "name": "link",
              "desc": ""
            },
            {
              "lua_type": "(\"file\" | \"directory\")?",
              "name": "type",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 149
          },
          "is_method": false,
          "signature": "fs.readlink(path: string) → string",
          "owner": "fs",
          "desc": "Reads the target of a symlink.",
          "tags": [],
          "name": "readlink",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 153
          },
          "is_method": false,
          "signature": "fs.isSymlink(path: string) → boolean",
          "owner": "fs",
          "desc": "Returns `true` if the path is a symbolic link (does not follow the link).",
          "tags": [],
          "name": "isSymlink",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 158
          },
          "is_method": false,
          "signature": "fs.stat(path: string, followSymlinks: boolean?) → { size: number?, mtime: number?, isFile: boolean?, isDirectory: boolean?, isSymlink: boolean? }",
          "owner": "fs",
          "desc": "Returns file metadata. Set `followSymlinks` to `false` to inspect the link itself.\nThe result always includes `isSymlink` regardless of `followSymlinks`.",
          "tags": [],
          "name": "stat",
          "return_str": "{ size: number?, mtime: number?, isFile: boolean?, isDirectory: boolean?, isSymlink: boolean? }",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "{ size: number?, mtime: number?, isFile: boolean?, isDirectory: boolean?, isSymlink: boolean? }",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "boolean?",
              "name": "followSymlinks",
              "desc": ""
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "File system operations and file handle I/O.\n\nUse `open()` / `openSync()` to get a `File` handle with read, write, seek,\ntruncate, and other operations. Most `File` methods yield by default; use\nthe `Sync` suffix for non-yielding variants (e.g. `readSync`, `writeSync`).\n\nPure path manipulation lives under `fs.path.*`.\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 11
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "path: string",
          "name": "path",
          "desc": "The file path passed to `open`."
        },
        {
          "tags": [],
          "lua_type": "fd: number",
          "name": "fd",
          "desc": "The underlying file descriptor number."
        },
        {
          "tags": [],
          "lua_type": "isOpen: boolean",
          "name": "isOpen",
          "desc": "`true` if the file has not been closed."
        },
        {
          "tags": [],
          "lua_type": "readable: boolean",
          "name": "readable",
          "desc": "`true` if the file was opened for reading."
        },
        {
          "tags": [],
          "lua_type": "writable: boolean",
          "name": "writable",
          "desc": "`true` if the file was opened for writing."
        }
      ],
      "desc": "",
      "name": "File",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 25
          },
          "is_method": true,
          "signature": "File:read(size: number?) → string",
          "desc": "Reads up to `size` bytes as a string. Pass `nil` to read remaining.",
          "tags": [
            "Yields"
          ],
          "name": "read",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "size",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 27
          },
          "is_method": true,
          "signature": "File:readSync(size: number?) → string",
          "desc": "Reads up to `size` bytes as a string. Pass `nil` to read remaining.",
          "tags": [],
          "name": "readSync",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "size",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 30
          },
          "is_method": true,
          "signature": "File:readBuffer(size: number?) → buffer",
          "desc": "Reads up to `size` bytes as a buffer. Pass `nil` to read remaining.",
          "tags": [
            "Yields"
          ],
          "name": "readBuffer",
          "return_str": "buffer",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "size",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 32
          },
          "is_method": true,
          "signature": "File:readBufferSync(size: number?) → buffer",
          "desc": "Reads up to `size` bytes as a buffer. Pass `nil` to read remaining.",
          "tags": [],
          "name": "readBufferSync",
          "return_str": "buffer",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "number?",
              "name": "size",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 36
          },
          "is_method": true,
          "signature": "File:write(data: string) → number",
          "desc": "Writes a string to the file, returns bytes written.",
          "tags": [
            "Yields"
          ],
          "name": "write",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 38
          },
          "is_method": true,
          "signature": "File:writeSync(data: string) → number",
          "desc": "Writes a string to the file, returns bytes written.",
          "tags": [],
          "name": "writeSync",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 41
          },
          "is_method": true,
          "signature": "File:writeBuffer(data: buffer) → number",
          "desc": "Writes a buffer to the file, returns bytes written.",
          "tags": [
            "Yields"
          ],
          "name": "writeBuffer",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 43
          },
          "is_method": true,
          "signature": "File:writeBufferSync(data: buffer) → number",
          "desc": "Writes a buffer to the file, returns bytes written.",
          "tags": [],
          "name": "writeBufferSync",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 48
          },
          "is_method": true,
          "signature": "File:seek(\n    offset: number,\n    whence: (\"set\" | \"cur\" | \"end\")?  -- string: `set` is default if unspecified, and treats `offset` as an absolute position. `cur` treats `offset` as relative from the current position. `end` seeks relative to the end of the file.\n) → (\n      -- number: The new file offset\n)",
          "desc": "Moves the file cursor.",
          "tags": [],
          "name": "seek",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": "number: The new file offset"
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "offset",
              "desc": ""
            },
            {
              "lua_type": "(\"set\" | \"cur\" | \"end\")?",
              "name": "whence",
              "desc": "string: `set` is default if unspecified, and treats `offset` as an absolute position. `cur` treats `offset` as relative from the current position. `end` seeks relative to the end of the file."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 50
          },
          "is_method": true,
          "signature": "File:tell() → number",
          "desc": "Returns the current file cursor position.",
          "tags": [],
          "name": "tell",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 52
          },
          "is_method": true,
          "signature": "File:truncate(size: number?) → ()",
          "desc": "Truncates the file to `size` bytes, or at the current position if `nil`.",
          "tags": [],
          "name": "truncate",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "number?",
              "name": "size",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 54
          },
          "is_method": true,
          "signature": "File:size() → number",
          "desc": "Returns the file size in bytes.",
          "tags": [],
          "name": "size",
          "return_str": "number",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "number",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 58
          },
          "is_method": true,
          "signature": "File:flush() → ()",
          "desc": "Flushes buffered writes to disk.",
          "tags": [
            "Yields"
          ],
          "name": "flush",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 60
          },
          "is_method": true,
          "signature": "File:flushSync() → ()",
          "desc": "Flushes buffered writes to disk.",
          "tags": [],
          "name": "flushSync",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 63
          },
          "is_method": true,
          "signature": "File:close() → ()",
          "desc": "Closes the file. Yield is due to the implicit file flush.",
          "tags": [
            "Yields"
          ],
          "name": "close",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 65
          },
          "is_method": true,
          "signature": "File:closeSync() → ()",
          "desc": "Closes the file.",
          "tags": [],
          "name": "closeSync",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}