/** * TwiML Generation Utilities * * Generates Twilio Markup Language (TwiML) XML for voice and SMS responses. * * Every helper escapes what it interpolates. Callers pass plain text and * never pre-escape: an already-escaped string would be double-escaped here * and read out as "ampersand a m p semicolon". */ import type { Context } from "hono"; import type { TalkerConfig } from "../types"; /** * Send a TwiML response with the headers Twilio expects. Every route handler * that returns TwiML goes through this - a bare `c.text(xml, 200, {...})` at * each call site is how the content-type header drifted before. */ export declare function twimlResponse(c: Context, xml: string, status?: 200 | 429): Response; /** * Generate TwiML for a speech gather with response. * * `prompt` is stored unescaped as the last prompt so the no-speech retry can * re-speak it (and re-escape it) without stacking entities. `Say` is nested * inside `Gather` so speech recognition starts as soon as the prompt begins * playing, letting a caller barge in instead of waiting it out. */ export declare function gatherTwiml(prompt: string, language: string, config: TalkerConfig, phoneNumber?: string): string; /** * Generate TwiML for a simple say */ export declare function sayTwiml(message: string, language: string, config: TalkerConfig): string; /** * Generate TwiML for transferring to a human. * Pass `message` when the caller already resolved the phrase (e.g. to tap * the exact text delivered) - otherwise it's looked up here, which can pick * a different variant than a caller-side lookup when the phrase rotates. */ export declare function transferTwiml(language: string, config: TalkerConfig, message?: string): string; /** * Generate TwiML for the "one moment please" acknowledgment. * See `transferTwiml` for the `message` override rationale. */ export declare function acknowledgmentTwiml(language: string, config: TalkerConfig, message?: string): string; /** * Generate TwiML for ending a call with a farewell. * See `transferTwiml` for the `message` override rationale. */ export declare function farewellTwiml(language: string, config: TalkerConfig, message?: string): string; /** * Generate TwiML for an SMS response */ export declare function messageTwiml(message: string): string;