/** * Unsubscribe Logic * * Shared server-side logic for processing newsletter unsubscribe requests. * Used by property-specific +page.server.ts files. * * @packageDocumentation */ import type { UnsubscribeResult } from './types.js'; /** * D1 Database interface (minimal) */ interface D1Database { prepare(query: string): D1PreparedStatement; } interface D1PreparedStatement { bind(...args: unknown[]): D1PreparedStatement; run(): Promise; } interface D1Result { success: boolean; } /** * Process an unsubscribe request from a URL token. * * Token format: base64(email:timestamp) * * @example * ```typescript * // In +page.server.ts * import { processUnsubscribe } from '@create-something/components/newsletter'; * * export const load: PageServerLoad = async ({ url, platform }) => { * const token = url.searchParams.get('token'); * return processUnsubscribe(token, platform?.env?.DB); * }; * ``` */ export declare function processUnsubscribe(token: string | null, db: D1Database | undefined): Promise; export {};