{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/tempfile",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 161
          },
          "is_method": true,
          "signature": "TempFile:close() → ()",
          "owner": "TempFile",
          "desc": "",
          "tags": [],
          "name": "close",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 169
          },
          "is_method": true,
          "signature": "TempDir:close() → ()",
          "owner": "TempDir",
          "desc": "",
          "tags": [],
          "name": "close",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 228
          },
          "is_method": false,
          "signature": "tempfile.tempdir() → (\n      -- string Absolute path to the OS temp directory. \n)",
          "owner": "tempfile",
          "desc": "Returns the process temporary directory.\n",
          "tags": [],
          "name": "tempdir",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "string Absolute path to the OS temp directory. "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 242
          },
          "is_method": false,
          "signature": "tempfile.mktemp(\n    name: string?  -- string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters.\n) → (\n      -- string A unique temp file path that does not exist on return. \n)",
          "owner": "tempfile",
          "desc": "Creates a unique temp file, then immediately closes and deletes it.\n\nThis is useful when you only need a collision-resistant path string.\n",
          "tags": [],
          "name": "mktemp",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "string A unique temp file path that does not exist on return. "
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": "string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 262
          },
          "is_method": false,
          "signature": "tempfile.open(\n    name: string?,  -- string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters.\n    mode: string?  -- string? File mode (`\"r\"`, `\"w\"`, `\"a\"`, `\"r+\"`, `\"w+\"`, `\"a+\"`). Defaults to `\"w+\"`.\n) → (\n      -- TempFile Open temp file handle with explicit cleanup methods. \n)",
          "owner": "tempfile",
          "desc": "Creates and opens a unique temp file.\n\nThe returned handle behaves like `fs.File` and also supports `:close()`\nto close and delete the file path.\n",
          "tags": [],
          "name": "open",
          "return_str": "TempFile",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "TempFile",
              "desc": "TempFile Open temp file handle with explicit cleanup methods. "
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": "string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters."
            },
            {
              "lua_type": "string?",
              "name": "mode",
              "desc": "string? File mode (`\"r\"`, `\"w\"`, `\"a\"`, `\"r+\"`, `\"w+\"`, `\"a+\"`). Defaults to `\"w+\"`."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 274
          },
          "is_method": false,
          "signature": "tempfile.openDir(\n    name: string?  -- string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters.\n) → (\n      -- TempDir Directory handle with `path` and explicit cleanup methods. \n)",
          "owner": "tempfile",
          "desc": "Creates a unique temporary directory.\n",
          "tags": [],
          "name": "openDir",
          "return_str": "TempDir",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "TempDir",
              "desc": "TempDir Directory handle with `path` and explicit cleanup methods. "
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": "string? Optional name/template prefix. If it includes `X` characters, each `X` is replaced with random alphanumeric characters."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 288
          },
          "is_method": false,
          "signature": "tempfile.withTempFile<T>(\n    fn: ((file: TempFile) → ...T),  -- (file: TempFile) -> T Callback that uses the temp file handle.\n    options: { name: string?, mode: string? }?  -- { name: string?, mode: string? }? Optional creation options.\n) → (\n      -- T The callback return value. \n)",
          "owner": "tempfile",
          "desc": "Creates a temp file, calls `fn(file)`, and always cleans it up.\n\n`file:close()` is guaranteed after callback completion, including error\npaths. Any callback error is rethrown.\n",
          "tags": [],
          "name": "withTempFile",
          "return_str": "...T",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "...T",
              "desc": "T The callback return value. "
            }
          ],
          "params": [
            {
              "lua_type": "((file: TempFile) → ...T)",
              "name": "fn",
              "desc": "(file: TempFile) -> T Callback that uses the temp file handle."
            },
            {
              "lua_type": "{ name: string?, mode: string? }?",
              "name": "options",
              "desc": "{ name: string?, mode: string? }? Optional creation options."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 309
          },
          "is_method": false,
          "signature": "tempfile.withTempDir<T>(\n    fn: ((path: string) → ...T),  -- (path: string) -> T Callback that receives the temp directory path.\n    name: string?  -- string? Optional name/template prefix.\n) → (\n      -- T The callback return value. \n)",
          "owner": "tempfile",
          "desc": "Creates a temp directory, calls `fn(path)`, and always removes it.\n\nDirectory cleanup is guaranteed after callback completion, including error\npaths. Any callback error is rethrown.\n",
          "tags": [],
          "name": "withTempDir",
          "return_str": "...T",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "...T",
              "desc": "T The callback return value. "
            }
          ],
          "params": [
            {
              "lua_type": "((path: string) → ...T)",
              "name": "fn",
              "desc": "(path: string) -> T Callback that receives the temp directory path."
            },
            {
              "lua_type": "string?",
              "name": "name",
              "desc": "string? Optional name/template prefix."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Temporary files and directories.\n\n`open()` returns a file-like object with an explicit `:close()` method.\n`openDir()` returns a directory handle with `path` and `:close()`.\n\n:::warning\nTemporary resources are explicit-lifecycle. You must call `:close()`\non returned handles to ensure cleanup.\nUnlike some runtimes, this module does not rely on GC finalizers.\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 28
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "path: string",
          "name": "path",
          "desc": "Absolute path to the temp file."
        },
        {
          "tags": [],
          "lua_type": "file: fs.File",
          "name": "file",
          "desc": "The underlying open file"
        }
      ],
      "desc": "",
      "name": "TempFile",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 32
          },
          "is_method": true,
          "signature": "TempFile:close() → ()",
          "desc": "Closes the file handle (if open) and deletes the file path.",
          "tags": [],
          "name": "close",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 45
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "path: string",
          "name": "path",
          "desc": "Absolute path to the temp directory."
        }
      ],
      "desc": "Represents a temporary directory handle.\n\nUse `path` for filesystem operations and call `:close()` to\nremove it recursively.\n",
      "name": "TempDir",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 49
          },
          "is_method": true,
          "signature": "TempDir:close() → ()",
          "desc": "Removes the directory recursively.",
          "tags": [],
          "name": "close",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}