{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/signal",
      "tags": [],
      "functions": [],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "A lightweight, re-entrant-safe signal/event system using a doubly-linked list\nof connections. Signals allow you to fire events and notify all connected\ncallbacks.\n\nHandlers are invoked via `task.spawn`, so each callback runs in its own\ncoroutine. Disconnecting or connecting handlers during a `Fire` is safe -\nthe handler list is snapshotted before invocation.\n\n```luau\nlocal Signal = require(\"@eryx/signal\")\n\nlocal onDamage = Signal.new()\n\nlocal conn = onDamage:connect(function(amount)\n\tprint(\"Took \" .. amount .. \" damage!\")\nend)\n\nonDamage:fire(25)  --> \"Took 25 damage!\"\n\nconn:disconnect()\nonDamage:fire(10)  --> (nothing, handler was disconnected)\n```\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 34
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "_signal: Signal<T...>",
          "name": "_signal",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_next: Connection<T...>?",
          "name": "_next",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_prev: Connection<T...>?",
          "name": "_prev",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "connected: boolean",
          "name": "connected",
          "desc": ""
        }
      ],
      "desc": "Represents a single subscription to a Signal. Created by `Signal:connect`\nor `Signal:once`. Can be disconnected to stop receiving future events.\n",
      "name": "Connection",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 36
          },
          "is_method": false,
          "signature": "Connection._fn() → ()",
          "desc": "",
          "tags": [],
          "name": "_fn",
          "return_str": "()",
          "function_type": "Function",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 47
          },
          "is_method": true,
          "signature": "Connection:disconnect<T...>() → ()",
          "owner": "Connection",
          "desc": "Disconnects this connection from its signal. Future fires will no longer\ninvoke this connection's callback. Safe to call multiple times - subsequent\ncalls are a no-op.\n",
          "tags": [],
          "name": "disconnect",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 77
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "_head: Connection<T...>?",
          "name": "_head",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_errorSignal: Signal<any, Connection<T...>>?",
          "name": "_errorSignal",
          "desc": ""
        }
      ],
      "desc": "A generic event dispatcher. Supports connecting multiple handlers,\none-shot handlers, yielding until the next fire, and bulk disconnection.\n",
      "name": "Signal",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 91
          },
          "is_method": false,
          "signature": "Signal.new<T...>() → (\n    Signal<T...>  -- A new signal with no connections.  ```luau local onPlayerJoin = Signal.new() ``` \n)",
          "owner": "Signal",
          "desc": "Creates a new Signal.\n",
          "tags": [],
          "name": "new",
          "return_str": "Signal<T...>",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "Signal<T...>",
              "desc": "A new signal with no connections.  ```luau local onPlayerJoin = Signal.new() ``` "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 115
          },
          "is_method": true,
          "signature": "Signal:fire<T...>(\n    ...  -- Arguments to pass to each connected handler.\n) → (\n    boolean  -- `true` if at least one handler was invoked, `false` otherwise.  ```luau local sig = Signal.new() sig:connect(function(msg) print(msg) end) sig:fire(\"hello\") --> \"hello\", returns true ``` \n)",
          "owner": "Signal",
          "desc": "Fires the signal, invoking all connected callbacks with the given arguments.\nEach handler runs in its own coroutine via `task.spawn`. The handler list\nis snapshotted before invocation, so connects/disconnects during callbacks\nare safe.\n",
          "tags": [],
          "name": "fire",
          "return_str": "boolean",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": "`true` if at least one handler was invoked, `false` otherwise.  ```luau local sig = Signal.new() sig:connect(function(msg) print(msg) end) sig:fire(\"hello\") --> \"hello\", returns true ``` "
            }
          ],
          "params": [
            {
              "lua_type": "",
              "name": "...",
              "desc": "Arguments to pass to each connected handler."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 167
          },
          "is_method": true,
          "signature": "Signal:wait<T...>() → (\n    T...  -- The arguments passed to the next `Fire` call.  ```luau -- In a coroutine: local damage = onDamage:wait() print(\"Waited and received:\", damage) ``` \n)",
          "owner": "Signal",
          "desc": "Yields the current coroutine until the signal is next fired, then returns\nthe fired arguments.\n",
          "tags": [],
          "name": "wait",
          "return_str": "T...",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "T...",
              "desc": "The arguments passed to the next `Fire` call.  ```luau -- In a coroutine: local damage = onDamage:wait() print(\"Waited and received:\", damage) ``` "
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 179
          },
          "is_method": true,
          "signature": "Signal:disconnectAll<T...>() → ()",
          "owner": "Signal",
          "desc": "Disconnects all connections from this signal. All existing Connection\nobjects will have their `connected` property set to `false`.\n",
          "tags": [],
          "name": "disconnectAll",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 206
          },
          "is_method": true,
          "signature": "Signal:errorSignal<T...>() → Signal<any, Connection<T...>>",
          "owner": "Signal",
          "desc": "Returns a lazily-created signal that fires when any handler connected to\nthis signal raises an error. The error signal fires with `(err, connection)`.\n\nIf no error handlers are connected, handler errors are re-thrown so they\nremain visible rather than being silently swallowed.\n\n```luau\nlocal sig = Signal.new()\n\nsig:errorSignal():connect(function(err)\n\twarn(\"signal handler failed:\", err)\nend)\n```\n",
          "tags": [],
          "name": "errorSignal",
          "return_str": "Signal<any, Connection<T...>>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Signal<any, Connection<T...>>",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 218
          },
          "is_method": true,
          "signature": "Signal:connectError<T...>(callback: ((err: any, connection: Connection<T...>) → ())) → Connection<any, Connection<T...>>",
          "owner": "Signal",
          "desc": "Connects a callback that will be invoked whenever one of this signal's\nhandlers raises an error. The callback receives the thrown value and the\nconnection whose handler failed.\n",
          "tags": [],
          "name": "connectError",
          "return_str": "Connection<any, Connection<T...>>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Connection<any, Connection<T...>>",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "((err: any, connection: Connection<T...>) → ())",
              "name": "callback",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 240
          },
          "is_method": true,
          "signature": "Signal:connect<T...>(\n    callback: ((T...) → ())  -- The function to call when the signal fires.\n) → (\n    Connection<T...>  -- A connection that can be used to disconnect later.  ```luau local conn = signal:connect(function(value) print(\"Got:\", value) end) -- Later: conn:disconnect() ``` \n)",
          "owner": "Signal",
          "desc": "Connects a callback to this signal. The callback will be invoked each time\nthe signal is fired, until the returned Connection is disconnected.\n",
          "tags": [],
          "name": "connect",
          "return_str": "Connection<T...>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Connection<T...>",
              "desc": "A connection that can be used to disconnect later.  ```luau local conn = signal:connect(function(value) print(\"Got:\", value) end) -- Later: conn:disconnect() ``` "
            }
          ],
          "params": [
            {
              "lua_type": "((T...) → ())",
              "name": "callback",
              "desc": "The function to call when the signal fires."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 270
          },
          "is_method": true,
          "signature": "Signal:once<T...>(\n    callback: ((T...) → ())  -- The function to call on the next fire.\n) → (\n    Connection<T...>  -- A connection that can be manually disconnected before it fires.  ```luau signal:once(function(value) print(\"Fired once with:\", value) end) ``` \n)",
          "owner": "Signal",
          "desc": "Connects a callback that will only fire once. The connection automatically\ndisconnects itself before invoking the callback.\n",
          "tags": [],
          "name": "once",
          "return_str": "Connection<T...>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Connection<T...>",
              "desc": "A connection that can be manually disconnected before it fires.  ```luau signal:once(function(value) print(\"Fired once with:\", value) end) ``` "
            }
          ],
          "params": [
            {
              "lua_type": "((T...) → ())",
              "name": "callback",
              "desc": "The function to call on the next fire."
            }
          ]
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}