{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type WatchOptions = {\n    recursive: boolean?,\n    debounce: number?,\n}",
          "name": "WatchOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 35
          },
          "fields": [
            {
              "lua_type": "recursive: boolean?",
              "name": "recursive",
              "desc": "Watch subdirectories recursively (supported on Windows and macOS;\non Linux you may need individual watchers per subdirectory)."
            },
            {
              "lua_type": "debounce: number?",
              "name": "debounce",
              "desc": "Debounce interval in seconds. When set, rapid-fire OS events for the\nsame file are coalesced - only the last event fires after the interval\nelapses with no new events. Set to `0` or `nil` to disable."
            }
          ],
          "desc": ""
        }
      ],
      "name": "@eryx/fs_watch",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 72
          },
          "is_method": false,
          "signature": "fs_watch.watchFile(path: string, options: WatchOptions?) → FileWatcher",
          "owner": "fs_watch",
          "desc": "Watches a single file for changes.\nReturns a `FileWatcher` whose `changed` signal fires with `(eventType)`.",
          "tags": [],
          "name": "watchFile",
          "return_str": "FileWatcher",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "FileWatcher",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "WatchOptions?",
              "name": "options",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 118
          },
          "is_method": false,
          "signature": "fs_watch.watchDir(path: string, options: WatchOptions?) → DirWatcher",
          "owner": "fs_watch",
          "desc": "Watches a directory for changes.\nReturns a `DirWatcher` whose `changed` signal fires with `(filename, eventType)`.",
          "tags": [],
          "name": "watchDir",
          "return_str": "DirWatcher",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "DirWatcher",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "WatchOptions?",
              "name": "options",
              "desc": ""
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Filesystem watcher with Signal-based event delivery.\n\nWatch a single file:\n```luau\nlocal fsWatch = require(\"@eryx/fs_watch\")\n\nlocal watcher = fsWatch.watchFile(\"config.json\")\nwatcher.changed:connect(function(eventType)\n\tprint(\"config.json:\", eventType) -- \"change\" or \"rename\"\nend)\n\n-- later:\nwatcher:stop()\n```\n\nWatch a directory (with debounce to coalesce rapid OS events):\n```luau\nlocal watcher = fsWatch.watchDir(\"src/\", { recursive = true, debounce = 0.1 })\nwatcher.changed:connect(function(filename, eventType)\n\tprint(filename, eventType)\nend)\n\nwatcher:stop()\n```\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 45
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "changed: Signal<string>",
          "name": "changed",
          "desc": "Fires when the watched file changes.\nReceives `(eventType)` where eventType is `\"change\"` or `\"rename\"`."
        }
      ],
      "desc": "",
      "name": "FileWatcher",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 50
          },
          "is_method": true,
          "signature": "FileWatcher:stop() → ()",
          "desc": "Stops the watcher and disconnects all signal handlers.",
          "tags": [],
          "name": "stop",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 52
          },
          "is_method": true,
          "signature": "FileWatcher:ref() → ()",
          "desc": "Makes this watcher keep the event loop alive (watchers are unref'd by default).",
          "tags": [],
          "name": "ref",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 54
          },
          "is_method": true,
          "signature": "FileWatcher:unref() → ()",
          "desc": "Allows the event loop to exit while this watcher is active (the default).",
          "tags": [],
          "name": "unref",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 57
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "changed: Signal<string, string>",
          "name": "changed",
          "desc": "Fires when any file in the watched directory changes.\nReceives `(filename, eventType)`.  `filename` is the path of the\nchanged file relative to the watched directory."
        }
      ],
      "desc": "",
      "name": "DirWatcher",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 63
          },
          "is_method": true,
          "signature": "DirWatcher:stop() → ()",
          "desc": "Stops the watcher and disconnects all signal handlers.",
          "tags": [],
          "name": "stop",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 65
          },
          "is_method": true,
          "signature": "DirWatcher:ref() → ()",
          "desc": "Makes this watcher keep the event loop alive (watchers are unref'd by default).",
          "tags": [],
          "name": "ref",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 67
          },
          "is_method": true,
          "signature": "DirWatcher:unref() → ()",
          "desc": "Allows the event loop to exit while this watcher is active (the default).",
          "tags": [],
          "name": "unref",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": []
        }
      ],
      "metamethods": [],
      "types": []
    }
  ]
}