import { ChannelName, NotificationChannels } from "./types.mjs"; import { Channel } from "./contracts/channel.contract.mjs"; import { PreferenceProvider } from "./contracts/preference-provider.contract.mjs"; import { QueueDispatcher } from "./contracts/queue-dispatcher.contract.mjs"; import { RateLimiter } from "./contracts/rate-limiter.contract.mjs"; //#region ../notifications/src/config.d.ts /** * Channel registry — each key is a registered channel name, each value the * channel whose payload type matches the registry. Typed as a partial map * over `ChannelName` so `setNotificationConfig` rejects a channel whose * payload doesn't line up with its registry entry, AND so a custom channel * (declaration-merged into `NotificationChannels`) is accepted with its real * payload type rather than `any`. */ type ChannelMap = Partial<{ [C in ChannelName]: Channel }>; /** * Runtime configuration the dispatcher reads on every send. `queue`, * `preferences`, and `rateLimit` are all OPTIONAL slots — the package * reserves their shape but ships no defaults. */ type NotificationConfig = { /** Channel registry — keys correlate to `NotificationChannels` payloads. */channels: ChannelMap; /** Async dispatcher backing `.queue()`. Phase 2 ships a herald impl. */ queue?: QueueDispatcher; /** Pre-send gate: drops channels the recipient opted out of. */ preferences?: PreferenceProvider; /** Pre-send gate: drops channels exceeding per-recipient budgets. */ rateLimit?: RateLimiter; }; /** * Set the active notifications configuration. In a Warlock app the * notifications connector calls this at boot with the default export of * `src/config/notifications.ts`. Subsequent calls REPLACE the active config * (does not merge) — pass the complete config, not a partial. */ declare function setNotificationConfig(config: NotificationConfig): void; /** * Get the active notifications configuration. Throws if not yet configured — * fail loudly at the first send rather than silently doing nothing. */ declare function getNotificationConfig(): NotificationConfig; /** * Clear the active configuration. Intended for tests; not part of the runtime * surface. Production code should never call this. */ declare function resetNotificationConfig(): void; //#endregion export { ChannelMap, NotificationConfig, getNotificationConfig, resetNotificationConfig, setNotificationConfig }; //# sourceMappingURL=config.d.mts.map