/** * Pending Queries * * Manages async query state for the "one moment please" acknowledgment pattern. * When a query is processing in the background, the pending promise is stored * here and resolved when processing completes. */ export interface PendingQuery { speechResult: string; promise: Promise<{ twiml: string; }>; resolve: (value: { twiml: string; }) => void; createdAt: number; } export type PendingQueryInput = Omit; export declare function setPending(phoneNumber: string, query: PendingQueryInput): void; export declare function getPending(phoneNumber: string): PendingQuery | undefined; export declare function deletePending(phoneNumber: string): void; /** * Delete pending queries older than `ttlMs`. A caller (Twilio hanging up * before requesting /call/answer, a client that never follows the redirect) * can leave an entry that nothing ever resolves or deletes; without a sweep * it — and its unresolved promise — would leak for the process lifetime. */ export declare function sweepPending(ttlMs: number): void;