import { Phone } from '../phone'; import { PhoneDetails } from '../phone-details'; import { Sip } from '../sip'; import { SipDetails } from '../sip-details'; import { SipFrom } from '../sip-from'; import { SipFromDetails } from '../sip-from-details'; import { Stream } from '../stream'; import { StreamDetails } from '../stream-details'; import { VoiceRelay } from '../voice-relay'; import { VoiceRelayDetails } from '../voice-relay-details'; /** * Shared SIP destination. `of('sip:')` and `of('sips:')` return this shape: * `type` and `endpoint` only. `sip` and `sipFrom` extend it with optional fields. */ export declare abstract class SipEndpoint { readonly type: 'SIP'; abstract readonly sip: { endpoint: string; }; } /** SIP destination with `type` and `endpoint` only. */ export declare class GenericSipEndpoint extends SipEndpoint { readonly sip: { endpoint: string; }; constructor(endpoint: string); } /** Phone destination. `number` is the E.164 value, without a `phone:` prefix. */ export declare class DestinationPhone implements Phone { readonly type: 'PHONE'; readonly phone: PhoneDetails; constructor(number: string); } /** SIP destination. Transport and headers are copied when present. */ export declare class DestinationSip extends GenericSipEndpoint implements Sip { readonly sip: SipDetails; constructor(sip: SipDetails); } /** SIP origin. Display name is copied when present. */ export declare class DestinationSipFrom extends GenericSipEndpoint implements SipFrom { readonly sip: SipFromDetails; constructor(sip: SipFromDetails); } /** Stream destination. Options and headers are copied when present. */ export declare class DestinationStream implements Stream { readonly type: 'STREAM'; readonly stream: StreamDetails; constructor(stream: StreamDetails); } /** * Value produced by {@link Destination.of}: a phone, a SIP endpoint with `type` and * `endpoint` only, or a stream. Phone and SIP can be used as a dial `from` or `to`. */ export type BaseDestination = DestinationPhone | SipEndpoint | DestinationStream; /** Voice relay destination. */ export declare class DestinationVoiceRelay implements VoiceRelay { readonly type: 'VOICE_RELAY'; readonly voiceRelay: VoiceRelayDetails; constructor(voiceRelay: VoiceRelayDetails); } /** * Destination factories for Voice v2 call `to` and `from` values. * * `of('sip:')` and `of('sips:')` return a {@link SipEndpoint} with `type` and `endpoint` only. * Endpoint strings are copied as given. `sip` takes a {@link SipDetails}. * `sipFrom` takes a {@link SipFromDetails}. */ export declare const Destination: { phone(number: string): DestinationPhone; sip(sip: SipDetails): DestinationSip; sipFrom(sip: SipFromDetails): DestinationSipFrom; /** * Sets `stream.endpoint`. Pass a string, or a {@link StreamDetails}. * Voice and language belong on {@link Destination.voiceRelay}. */ stream(endpointOrDetails: string | StreamDetails): DestinationStream; voiceRelay(voiceRelay: VoiceRelayDetails): DestinationVoiceRelay; /** * Builds a phone, SIP, or stream destination from a string. * `sip:` and `sips:` stay on the endpoint and can be used for `from` or `to`. * `stream:` is removed. `phone:` is removed. * Any other value, including a bare number such as `76367472`, is a phone destination and is kept as is. * Voice relay is not built here; it requires `ttsVoice` and `sttLanguage`. */ of(destination: string): BaseDestination; };