UNPKG

ivr-tester

Version:

An automated testing framework for IVR call flows

17 lines (16 loc) 936 B
import { Step } from "../../configuration/scenario/Step"; import { CallFlowInstructions } from "./CallFlowInstructions"; import { Call } from "../../call/Call"; import { PromptTranscriptionBuilder } from "../../call/transcription/PromptTranscriptionBuilder"; export interface Prompt { readonly definition: Step; setNext(prompt: Prompt): Prompt; transcriptUpdated(transcriptEvent: PromptTranscriptionBuilder): void; } export declare type MatchedCallback = (prompt: Prompt, transcriptMatched: string) => void; export declare type TimeoutCallback = (prompt: Prompt, transcript: string) => void; export declare type PromptFactory = (definition: Step, call: Call, matchedCallback: MatchedCallback, timeoutCallback: TimeoutCallback) => Prompt | undefined; /** * Creates an ordered prompt collection */ export declare function inOrder(promptDefinitions: ReadonlyArray<Step>, promptFactory?: PromptFactory): CallFlowInstructions;