import type { AllowedUsers } from "../whitelist.js"; /** * Map — Adjust/Reject await a follow-up text. * In-memory only; cleared on bot restart. No disk persistence. * bober: single-process map; extend to a shared Redis key-value store if the bot * runs across multiple processes (low-probability at current scale). */ export type PendingCallbackState = Map; export declare function createPendingState(): PendingCallbackState; /** * Handle a button tap from an inline-keyboard approval message. * * Returns: * reply — text to send back via sendSafe (null = nothing to send) * answer — text for answerCallbackQuery (always present to dismiss the spinner) * * Guard chain (mirrors approve.ts:44): * 1. Whitelist re-check on the CALLBACK sender id (sc-4-5). * 2. pendingExists guard — write NOTHING if no .pending.json (sc-4-4). * 3. Approve → saveApproved {approvedAt, approverId}; editDelta key ABSENT. * 4. Adjust → stash in pending map; return prompt for replacement text. * 5. Reject → stash in pending map; return prompt for feedback text. */ export declare function handleApprovalCallback(args: { projectRoot: string; senderId: number; allowed: AllowedUsers; chatId: number; data: string; pending: PendingCallbackState; now?: () => string; }): Promise<{ reply: string | null; answer: string; }>; /** * Check whether the incoming plain-text message is a follow-up to a stashed * Adjust or Reject tap. If so, resolves it and returns a reply string. * Returns null when there is no stash for this chat — the caller falls through * to normal text routing (capture / command dispatch). * * Key invariants: * - Adjust follow-up writes ApprovedMarker with editDelta = text. * - Reject follow-up writes RejectedMarker with rejecterId (NOT rejectorId). * - Both call deletePending after a successful write. * - Non-whitelisted sender: belt-and-suspenders return null without deleting stash * (the outer loop already blocks non-whitelisted messages). */ export declare function handleApprovalFollowup(args: { projectRoot: string; senderId: number; allowed: AllowedUsers; chatId: number; text: string; pending: PendingCallbackState; now?: () => string; }): Promise; //# sourceMappingURL=approvals.d.ts.map