UNPKG

@vonage/voice

Version:

The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.

59 lines 2.2 kB
import { NCCOActions } from '../../enums'; import { DTMFSettings } from '../../types'; import { InputAction } from '../../types'; import { SpeechSettings } from '../../types'; import { Serializable } from '../../ncco'; /** * Represents an Input action in the Nexmo Call Control Object (NCCO) for gathering user input. */ export declare class Input implements Pick<InputAction, 'action' | 'type' | 'dtmf' | 'speech' | 'eventUrl' | 'eventMethod' | 'mode'>, Serializable { /** * The action type, which is always 'input'. */ action: NCCOActions.INPUT; /** * An array of input types ('dtmf' and/or 'speech'). */ type: string[]; /** * DTMF input settings. */ dtmf?: DTMFSettings; /** * Speech input settings. */ speech?: SpeechSettings; /** * An array of URLs to send events to asynchronously. */ eventUrl?: string[]; /** * The HTTP method used to send events (e.g., 'POST' or 'GET'). */ eventMethod?: string; /** * Input processing mode, currently only applicable to DTMF. Valid values are * synchronous (the default) and asynchronous. If set to asynchronous, all * DTMF settings must be left blank. In asynchronous mode, digits are sent one * at a time to the event webhook in real time. In the default synchronous * mode, this is controlled by the DTMF settings instead and the inputs are * sent in batch. */ mode?: 'asynchronous' | 'synchronous'; /** * Create a new Input instance. * * @param {DTMFSettings} dtmf - DTMF input settings. * @param {SpeechSettings} speech - Speech input settings. * @param {string} eventUrl - URL to send events to asynchronously. * @param {string} eventMethod - The HTTP method used to send events. */ constructor(dtmf?: DTMFSettings, speech?: SpeechSettings, eventUrl?: string, eventMethod?: string, mode?: 'asynchronous' | 'synchronous'); /** * Serialize the Input action to a Nexmo Call Control Object (NCCO) format. * * @return {InputAction} - The serialized Input action. */ serializeToNCCO(): InputAction; } //# sourceMappingURL=Input.d.ts.map