/**
 * DB factor — Node worker thread.
 *
 * Owns the SQLite handle and FileMessageStore. Serves the UI-read surface
 * (getFolders, getMessages, getUnifiedInbox, getMessage, searchMessages,
 * searchContacts, getThreadMessages) over `mailx-bus`. Subscribes to write
 * events from the sync factor (Phase 2) and emits `db:messageAdded` /
 * `db:messageRemoved` / `db:flagChanged` so the UI can update incrementally
 * without re-asking.
 *
 * **Why a worker.** Until now every UI click had to traverse the same Node
 * event loop the sync code runs on. A 14-minute synchronous freeze in the
 * sync path (Dovecot SELECT hang, Prefirst.OIA backfill loop) starved every
 * UI read. The IPC pipe handler couldn't even be scheduled. From the user's
 * perspective: Sent shows empty, message bodies never load, autocomplete
 * dies, drafts can't save. All of those have one cause: the read path
 * shares an event loop with the write/sync path.
 *
 * In this worker, the read path is on its own thread. Sync can freeze for
 * an hour and the user's click still gets a 5 ms answer from local SQLite.
 *
 * **Topology**. Main thread spawns this worker once, holds a `WorkerBus` over
 * the `parentPort`. The worker also holds a `WorkerBus` over `parentPort` and
 * registers its handlers. Two ends of the same channel, mirror APIs.
 *
 * **DB connection**. `better-sqlite3` is in-process synchronous, so the
 * worker opens its OWN connection to the same `.db` file. WAL mode (set in
 * `MailxDB`) makes concurrent readers safe; writes still happen on the main
 * thread for Phase 1 and the worker sees committed rows immediately.
 * Phase 2 moves writes to the sync worker, which routes through this worker
 * for any UI-visible mutation so the LRU/cache here can update in lock-step.
 *
 * **No mailparser here.** Body parsing is the parse-worker's job. This
 * worker reads the .eml bytes off disk and delegates parsing via
 * `parseSerial` (which already postMessages to its own worker). Two workers
 * either side of this thread; the read coordinator is purely an indexer.
 */
export {};
//# sourceMappingURL=db-worker.d.ts.map