/** * keyboard.ts — Provider-neutral inline-keyboard spec builder and compact * callback_data codec for approval checkpoints and upload opt-in. * No grammy import — provider-agnostic (principles.md:28). grammy types stay in bot.ts. * * Telegram callback_data limit: 64 bytes (UTF-8). * Codec: ":" where code ∈ {a=approve, j=adjust, r=reject, y=confirm, n=cancel}. * Budget: 2 bytes for ":" + byteLength(checkpointId). * Known checkpointId formats are well under budget: * "promote-<16hex>" = 24 bytes → 26 bytes total * "calendar-" = well under 64 bytes for any realistic planId * message_id (int) = ≤10 bytes → 12 bytes total * Never truncate checkpointId — truncation breaks pendingExists lookup silently. */ export type CallbackAction = "approve" | "adjust" | "reject" | "confirm" | "cancel"; /** Provider-neutral inline keyboard: rows of {text, data} buttons. */ export type InlineKeyboardSpec = { text: string; data: string; }[][]; /** * Encode {action, checkpointId} into a compact callback_data string. * Result is ":" (e.g. "a:calendar-mon-plan"). * Always ≤ 64 bytes for all current checkpointId formats. */ export declare function encodeCallback(action: CallbackAction, checkpointId: string): string; /** * Decode a callback_data string back to {action, checkpointId}. * Returns null for unrecognised or malformed data. * Decodes by splitting on the first ":" only — checkpointIds may contain colons. */ export declare function decodeCallback(data: string): { action: CallbackAction; checkpointId: string; } | null; /** * Build an approval inline keyboard for a single checkpoint. * Returns a one-row spec with Approve / Adjust / Reject buttons. * The spec is provider-neutral; GrammyTransport in bot.ts converts it to InlineKeyboard. */ export declare function buildApprovalKeyboard(checkpointId: string): InlineKeyboardSpec; /** * Build a per-upload opt-in keyboard for document uploads. * Returns a one-row spec with Yes / No buttons. * uploadId should be the message_id string (short, well within the 64-byte limit). */ export declare function buildUploadKeyboard(uploadId: string): InlineKeyboardSpec; //# sourceMappingURL=keyboard.d.ts.map