/** * Preference store — decides whether `(recipient, category)` is * allowed to receive a message. Mirrors the Novu/Knock/Courier * primitive, scoped to the narrow "preference center" use case. * * @module */ import type { MaybePromise } from "../types.mjs"; export interface PreferenceRecord { recipient: string; category: string; allowed: boolean; updatedAt: Date; } export interface PreferenceStore { /** Defaults to allowed=true when no record exists. */ allows: (recipient: string, category: string) => MaybePromise; set: (recipient: string, category: string, allowed: boolean) => MaybePromise; list?: (recipient: string) => MaybePromise>; } export interface MemoryPreferenceStoreOptions { now?: () => number; /** Default value when no record exists. Defaults to true (allow). */ defaultAllowed?: boolean; } export declare function memoryPreferenceStore(opts?: MemoryPreferenceStoreOptions): PreferenceStore;