import { CallDestination } from '../call-destination'; import { CallOrigin } from '../call-origin'; import { AnswerCommand } from '../svaml-commands/answer-command'; import { BridgeCallCommand } from '../svaml-commands/bridge-call-command'; import { DialCommand } from '../svaml-commands/dial-command'; import { HangupCommand } from '../svaml-commands/hangup-command'; import { PauseCommand } from '../svaml-commands/pause-command'; import { BaseDestination } from './destination-helper'; import { CommandInput } from './command-input'; export interface HangupParameters { /** Name of the call leg to end. Maps to `callName`. */ name?: string; } /** Parameters for one `dial` command. `to` is required. */ export interface DialParameters { /** Call destination. */ to: CallDestination; /** Call origin, or a {@link BaseDestination} from `Destination.of`. */ from?: CallOrigin | BaseDestination; /** Name of the call leg. Maps to `callName`. */ name?: string; /** Maps to `dialTimeoutDurationSeconds`. */ timeoutDurationSeconds?: number; /** Maps to `maxCallDurationSeconds`. */ maxDurationSeconds?: number; /** Commands to run when the call is answered. */ onAnswer?: CommandInput; /** Commands to run when the call is busy. */ onBusy?: CommandInput; /** Commands to run when the call is rejected. */ onReject?: CommandInput; /** Commands to run when the call times out. */ onTimeout?: CommandInput; /** Commands to run when the call is hung up. */ onHangup?: CommandInput; /** Commands to run when the call fails. */ onFailure?: CommandInput; } /** * Builds a `dial` command. `to` is required. */ export declare class DialCreator { private toDestination; private fromOrigin; private callNameValue; private dialTimeout; private maxDuration; private readonly events; to(to: CallDestination): this; /** Accepts a call origin, or a {@link BaseDestination} from `Destination.of`. */ from(from: CallOrigin | BaseDestination): this; /** Maps to `callName` on the dial command. */ name(name: string): this; /** Maps to `dialTimeoutDurationSeconds` on the dial command. */ timeoutDurationSeconds(seconds: number): this; /** Maps to `maxCallDurationSeconds` on the dial command. */ maxDurationSeconds(seconds: number): this; onAnswer(build: CommandInput): this; onBusy(build: CommandInput): this; onReject(build: CommandInput): this; onTimeout(build: CommandInput): this; onHangup(build: CommandInput): this; onFailure(build: CommandInput): this; build(): DialCommand; } /** * Builds one call-control command. * Each method returns a single command. Pass it wherever a handler accepts one command * or a list, including request `commands` and nested handlers such as `onFinish`. */ export declare const Calls: { /** Answers the current call leg. */ answer(): AnswerCommand; /** Joins a bridge. `name` is written to `bridgeName`. */ bridgeCall(name: string): BridgeCallCommand; /** * Dials a new call leg. * `name` is written to `callName`. Event handlers accept one command, a list, or a sequence callback. */ dial(parameters: DialParameters): DialCommand; /** * Ends a call leg. * `name` is written to `callName`. Omit it to end the current leg. */ hangup(parameters?: HangupParameters): HangupCommand; /** Pauses the sequence. `durationMilliseconds` is required by the command. */ pause(durationMilliseconds: number): PauseCommand; };