import type { EventStorage } from './EventStorage.js'; import { type EventMeta } from './subscriber.js'; type Subscriber = { event: string; subscriber: (data: unknown, meta?: EventMeta) => void | Promise; }; type EventProcessorDeps = { storage: Pick; subscribers: Subscriber[]; /** * Optional hook run once per non-empty batch, before its subscribers execute. The * event-manager passes `refreshSetting` here so off-request emails pick up admin setting * changes (locale, store name, address) without a worker restart — this process holds * its own settings cache that only `saveSetting` (in the web process) otherwise * invalidates. A failure is logged and ignored (degrade to cached settings, never drop * events). Omitted in unit tests, so the processor stays DB-free there. */ beforeBatch?: () => Promise; }; /** * Pure event processing logic. Accepts storage and subscribers as dependencies * so both can be replaced with mocks in tests — no real DB or filesystem needed. */ export declare function createEventProcessor({ storage, subscribers, beforeBatch }: EventProcessorDeps): { loadAndProcess: () => Promise; }; export {};