{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/webui",
      "tags": [],
      "functions": [],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "WebUi is a simple wrapper on top of [[webview]] that provides utilities\nfor message passing and event binding.\n\n```luau\nlocal ui = webui.new(\"IPC Demo\")\n\nui.win:navigateToString(fs.open(\"web.html\")):read())\nui.win:show()\n\nui:on(\"chat\"):connect(function(data)\n\tui:post(\"chat\", { message = `Echo: {data.message}` })\nend)\n\nui:onJsEvent(\"#clickme\", \"click\"):connect(function()\n\tprint(\"Button clicked\")\nend)\n```\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 28
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "win: wv.WebViewHandle",
          "name": "win",
          "desc": "The WebView window"
        },
        {
          "tags": [],
          "lua_type": "_handlers: { { event: string, sig: Signal.Signal<{}> } }",
          "name": "_handlers",
          "desc": ""
        },
        {
          "tags": [],
          "lua_type": "_eventHandlers: { Signal.Signal<()> }",
          "name": "_eventHandlers",
          "desc": ""
        }
      ],
      "desc": "",
      "name": "WebUi",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 40
          },
          "is_method": false,
          "signature": "WebUi.new(\n    title: string  -- The window title\n) → WebUi",
          "owner": "WebUi",
          "desc": "Create a new WebUi",
          "tags": [],
          "name": "new",
          "return_str": "WebUi",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "WebUi",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "title",
              "desc": "The window title"
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 71
          },
          "is_method": true,
          "signature": "WebUi:onJsEvent(\n    selector: string,  -- CSS element selector, such as `\"#foo\"`\n    event: string  -- JavaScript event, such as `\"click\"`\n) → (\n      -- A signal that fires every time the event occurs\n)",
          "owner": "WebUi",
          "desc": "Bind to a JavaScript event",
          "tags": [],
          "name": "onJsEvent",
          "return_str": "Signal.Signal<()>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Signal.Signal<()>",
              "desc": "A signal that fires every time the event occurs"
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "selector",
              "desc": "CSS element selector, such as `\"#foo\"`"
            },
            {
              "lua_type": "string",
              "name": "event",
              "desc": "JavaScript event, such as `\"click\"`"
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 89
          },
          "is_method": true,
          "signature": "WebUi:on(\n    event: string  -- The event to bind to\n) → (\n      -- A signal that fires every time the event is posted\n)",
          "owner": "WebUi",
          "desc": "Bind to an `eryx.post` event",
          "tags": [],
          "name": "on",
          "return_str": "Signal.Signal<{}>",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "Signal.Signal<{}>",
              "desc": "A signal that fires every time the event is posted"
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "event",
              "desc": "The event to bind to"
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 100
          },
          "is_method": true,
          "signature": "WebUi:post(\n    event: string,  -- The event to send\n    data: { [any]: any }?  -- The data to post\n) → ()",
          "owner": "WebUi",
          "desc": "Post a message to an `eryx.on` listener",
          "tags": [],
          "name": "post",
          "return_str": "",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "event",
              "desc": "The event to send"
            },
            {
              "lua_type": "{ [any]: any }?",
              "name": "data",
              "desc": "The data to post"
            }
          ]
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}