import type { RequestHandler } from '@sveltejs/kit'; import type { RateLimitConfig } from '../../../types.js'; import type { NotificationPreferenceRepository } from '../../adapters/types.js'; import type { NotificationRegistry } from '../registry.js'; export interface PreferencesHandlerOptions { /** * Rate limit for the mutating `PUT`, keyed by the authenticated user id * (the endpoint requires a session, and a per-user key can't be dodged by * IP rotation). Default 30/min; pass `null` to disable. */ rateLimit?: RateLimitConfig | null; } /** * Preferences CRUD for the authenticated user. The `registry` is required: * `PUT` rejects a `typeKey` that isn't a registered notification type (400). * Without that gate the upsert would persist a row for ANY ≤256-char string, * letting an authenticated user grow the preference table without bound — * validated, the per-user row count is capped by the number of registered * types (preferences for types nobody can `send()` are meaningless anyway). */ export declare function createPreferencesHandler(repo: NotificationPreferenceRepository, registry: NotificationRegistry, options?: PreferencesHandlerOptions): { GET: RequestHandler; PUT: RequestHandler; };