{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type SessionRecord = {\n    data: { [string]: any },\n    expiresAt: number?,\n}",
          "name": "SessionRecord",
          "tags": [],
          "source": {
            "path": "",
            "line": 19
          },
          "fields": [
            {
              "lua_type": "data: { [string]: any }",
              "name": "data",
              "desc": ""
            },
            {
              "lua_type": "expiresAt: number?",
              "name": "expiresAt",
              "desc": ""
            }
          ],
          "desc": ""
        },
        {
          "lua_type": "type SessionCookieOptions = {\n    path: string?,\n    domain: string?,\n    secure: boolean?,\n    httpOnly: boolean?,\n    sameSite: \"Strict\" | \"Lax\" | \"None\"?,\n}",
          "name": "SessionCookieOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 31
          },
          "fields": [
            {
              "lua_type": "path: string?",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "domain: string?",
              "name": "domain",
              "desc": ""
            },
            {
              "lua_type": "secure: boolean?",
              "name": "secure",
              "desc": ""
            },
            {
              "lua_type": "httpOnly: boolean?",
              "name": "httpOnly",
              "desc": ""
            },
            {
              "lua_type": "sameSite: \"Strict\" | \"Lax\" | \"None\"?",
              "name": "sameSite",
              "desc": ""
            }
          ],
          "desc": ""
        },
        {
          "lua_type": "type SessionOptions = {\n    store: SessionStore?,\n    cookieName: string?,\n    ttl: number?,\n    rolling: boolean?,\n    cookie: SessionCookieOptions?,\n}",
          "name": "SessionOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 39
          },
          "fields": [
            {
              "lua_type": "store: SessionStore?",
              "name": "store",
              "desc": ""
            },
            {
              "lua_type": "cookieName: string?",
              "name": "cookieName",
              "desc": ""
            },
            {
              "lua_type": "ttl: number?",
              "name": "ttl",
              "desc": ""
            },
            {
              "lua_type": "rolling: boolean?",
              "name": "rolling",
              "desc": ""
            },
            {
              "lua_type": "cookie: SessionCookieOptions?",
              "name": "cookie",
              "desc": ""
            }
          ],
          "desc": ""
        }
      ],
      "name": "@eryx/http/ServerSession",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 103
          },
          "is_method": true,
          "signature": "SessionMethods:get(key: string) → any",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "get",
          "return_str": "any",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "any",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 107
          },
          "is_method": true,
          "signature": "SessionMethods:set(key: string, value: any) → ()",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "set",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            },
            {
              "lua_type": "any",
              "name": "value",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 116
          },
          "is_method": true,
          "signature": "SessionMethods:delete(key: string) → ()",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "delete",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 124
          },
          "is_method": true,
          "signature": "SessionMethods:clear() → ()",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "clear",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 135
          },
          "is_method": true,
          "signature": "SessionMethods:regenerate() → string",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "regenerate",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 144
          },
          "is_method": true,
          "signature": "SessionMethods:destroy() → ()",
          "owner": "SessionMethods",
          "desc": "",
          "tags": [],
          "name": "destroy",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 166
          },
          "is_method": true,
          "signature": "MemoryStoreMethods:get(id: string) → SessionRecord?",
          "owner": "MemoryStoreMethods",
          "desc": "",
          "tags": [],
          "name": "get",
          "return_str": "SessionRecord?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "SessionRecord?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 181
          },
          "is_method": true,
          "signature": "MemoryStoreMethods:set(id: string, data: { [string]: any }, expiresAt: number?) → ()",
          "owner": "MemoryStoreMethods",
          "desc": "",
          "tags": [],
          "name": "set",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "{ [string]: any }",
              "name": "data",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 188
          },
          "is_method": true,
          "signature": "MemoryStoreMethods:delete(id: string) → ()",
          "owner": "MemoryStoreMethods",
          "desc": "",
          "tags": [],
          "name": "delete",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 192
          },
          "is_method": true,
          "signature": "MemoryStoreMethods:touch(id: string, expiresAt: number?) → ()",
          "owner": "MemoryStoreMethods",
          "desc": "",
          "tags": [],
          "name": "touch",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 199
          },
          "is_method": true,
          "signature": "FileStoreMethods:_pathFor(id: string) → string",
          "owner": "FileStoreMethods",
          "desc": "",
          "tags": [],
          "name": "_pathFor",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 203
          },
          "is_method": true,
          "signature": "FileStoreMethods:get(id: string) → SessionRecord?",
          "owner": "FileStoreMethods",
          "desc": "",
          "tags": [],
          "name": "get",
          "return_str": "SessionRecord?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "SessionRecord?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 223
          },
          "is_method": true,
          "signature": "FileStoreMethods:set(id: string, data: { [string]: any }, expiresAt: number?) → ()",
          "owner": "FileStoreMethods",
          "desc": "",
          "tags": [],
          "name": "set",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "{ [string]: any }",
              "name": "data",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 234
          },
          "is_method": true,
          "signature": "FileStoreMethods:delete(id: string) → ()",
          "owner": "FileStoreMethods",
          "desc": "",
          "tags": [],
          "name": "delete",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 241
          },
          "is_method": true,
          "signature": "FileStoreMethods:touch(id: string, expiresAt: number?) → ()",
          "owner": "FileStoreMethods",
          "desc": "",
          "tags": [],
          "name": "touch",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 256
          },
          "is_method": true,
          "signature": "SqliteStoreMethods:get(id: string) → SessionRecord?",
          "owner": "SqliteStoreMethods",
          "desc": "",
          "tags": [],
          "name": "get",
          "return_str": "SessionRecord?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "SessionRecord?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 273
          },
          "is_method": true,
          "signature": "SqliteStoreMethods:set(id: string, data: { [string]: any }, expiresAt: number?) → ()",
          "owner": "SqliteStoreMethods",
          "desc": "",
          "tags": [],
          "name": "set",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "{ [string]: any }",
              "name": "data",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 285
          },
          "is_method": true,
          "signature": "SqliteStoreMethods:delete(id: string) → ()",
          "owner": "SqliteStoreMethods",
          "desc": "",
          "tags": [],
          "name": "delete",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 289
          },
          "is_method": true,
          "signature": "SqliteStoreMethods:touch(id: string, expiresAt: number?) → ()",
          "owner": "SqliteStoreMethods",
          "desc": "",
          "tags": [],
          "name": "touch",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 298
          },
          "is_method": false,
          "signature": "ServerSession.memoryStore() → (\n      -- SessionStore \n)",
          "owner": "ServerSession",
          "desc": "Creates an in-memory session store.\n",
          "tags": [],
          "name": "memoryStore",
          "return_str": "SessionStore",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "SessionStore",
              "desc": "SessionStore "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 310
          },
          "is_method": false,
          "signature": "ServerSession.fileStore(\n    directory: string  -- Directory used for session files.\n) → (\n      -- SessionStore \n)",
          "owner": "ServerSession",
          "desc": "Creates a filesystem-backed session store where each session is stored as JSON.\n",
          "tags": [],
          "name": "fileStore",
          "return_str": "SessionStore",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "SessionStore",
              "desc": "SessionStore "
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "directory",
              "desc": "Directory used for session files."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 324
          },
          "is_method": false,
          "signature": "ServerSession.sqliteStore(\n    database: string | sqlite3.Database,  -- Either a path string or an open `@eryx/sqlite3` database.\n    tableName: string?  -- Optional table name. Defaults to `\"http_sessions\"`.\n) → (\n      -- SessionStore \n)",
          "owner": "ServerSession",
          "desc": "Creates an SQLite-backed session store.\n",
          "tags": [],
          "name": "sqliteStore",
          "return_str": "SessionStore",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "SessionStore",
              "desc": "SessionStore "
            }
          ],
          "params": [
            {
              "lua_type": "string | sqlite3.Database",
              "name": "database",
              "desc": "Either a path string or an open `@eryx/sqlite3` database."
            },
            {
              "lua_type": "string?",
              "name": "tableName",
              "desc": "Optional table name. Defaults to `\"http_sessions\"`."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 361
          },
          "is_method": false,
          "signature": "ServerSession.middleware(\n    options: SessionOptions?  -- Session configuration and backing store.\n) → (\n      -- (ctx: any, next: () -> any) -> any \n)",
          "owner": "ServerSession",
          "desc": "Creates app middleware that attaches a server-side session to `ctx.session`.\n\nThe middleware loads the session from a cookie before the handler runs and\npersists it back to the configured store after the handler completes.\n",
          "tags": [],
          "name": "middleware",
          "return_str": "((ctx: any, next: (() → any)) → any)",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "((ctx: any, next: (() → any)) → any)",
              "desc": "(ctx: any, next: () -> any) -> any "
            }
          ],
          "params": [
            {
              "lua_type": "SessionOptions?",
              "name": "options",
              "desc": "Session configuration and backing store."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": ""
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 24
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "touch: (((self: SessionStore, id: string, expiresAt: number?) → ()))?",
          "name": "touch",
          "desc": ""
        }
      ],
      "desc": "",
      "name": "SessionStore",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 25
          },
          "is_method": true,
          "signature": "SessionStore:get(id: string) → SessionRecord?",
          "desc": "",
          "tags": [],
          "name": "get",
          "return_str": "SessionRecord?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "SessionRecord?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 26
          },
          "is_method": true,
          "signature": "SessionStore:set(id: string, data: { [string]: any }, expiresAt: number?) → ()",
          "desc": "",
          "tags": [],
          "name": "set",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            },
            {
              "lua_type": "{ [string]: any }",
              "name": "data",
              "desc": ""
            },
            {
              "lua_type": "number?",
              "name": "expiresAt",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 27
          },
          "is_method": true,
          "signature": "SessionStore:delete(id: string) → ()",
          "desc": "",
          "tags": [],
          "name": "delete",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "id",
              "desc": ""
            }
          ]
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 47
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "id: string?",
          "name": "id",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "data: { [string]: any }",
          "name": "data",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "isNew: boolean",
          "name": "isNew",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "destroyed: boolean",
          "name": "destroyed",
          "desc": ""
        }
      ],
      "desc": "",
      "name": "Session",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 53
          },
          "is_method": true,
          "signature": "Session:get(key: string) → any",
          "desc": "Returns a value from the session data table.",
          "tags": [],
          "name": "get",
          "return_str": "any",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "any",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 55
          },
          "is_method": true,
          "signature": "Session:set(key: string, value: any) → ()",
          "desc": "Sets a value and marks the session dirty for persistence.",
          "tags": [],
          "name": "set",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            },
            {
              "lua_type": "any",
              "name": "value",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 57
          },
          "is_method": true,
          "signature": "Session:delete(key: string) → ()",
          "desc": "Removes a value and marks the session dirty.",
          "tags": [],
          "name": "delete",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "key",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 59
          },
          "is_method": true,
          "signature": "Session:clear() → ()",
          "desc": "Clears all session data.",
          "tags": [],
          "name": "clear",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 61
          },
          "is_method": true,
          "signature": "Session:regenerate() → string",
          "desc": "Assigns a fresh session id and preserves the current data.",
          "tags": [],
          "name": "regenerate",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 63
          },
          "is_method": true,
          "signature": "Session:destroy() → ()",
          "desc": "Deletes the session from the backing store and clears the cookie.",
          "tags": [],
          "name": "destroy",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}