import type { RequestHandler } from '@sveltejs/kit'; import type { AuthDeps } from '../deps.js'; import type { ChangeEmailNoticeContext, MailBuilder } from '../email/builders.js'; export interface ChangeEmailHandlerOptions { /** * Build the confirmation mail sent to the NEW address (carries the verify * link). Receives the resolved context (`name`, confirm `url`, `appName`, * `from`, `t`) and returns `{ subject, html, text }`. Defaults to a localized * template. */ verifyEmailChangeEmail?: MailBuilder; /** * Build the awareness notice sent to the OLD address (no link — just informs * the current owner a change was requested). Receives the same context plus * the pending `newEmail`. Defaults to a localized template. */ changeEmailEmail?: MailBuilder; } /** * Request an email change. Re-auth gated; verification is sent to the NEW * address (proving control of it) plus a notice to the OLD one. The response is * always `{ success: true }` after re-auth and the token/mail work runs * decoupled, so neither content nor timing reveals whether the target address * already belongs to an account (account-enumeration defense). The change only * takes effect once confirmed via {@link createVerifyEmailChangeHandler}. */ export declare function createChangeEmailHandler(deps: AuthDeps, options?: ChangeEmailHandlerOptions): { POST: RequestHandler; };