UNPKG

@signalwire/realtime-api

Version:
58 lines 1.65 kB
import { MessagingMessageState } from '@signalwire/core'; /** * An object representing an SMS or MMS message. */ export interface MessageContract { /** The unique identifier of the message. */ id: string; /** The current state of the message. */ state: MessagingMessageState; /** The context of the message. */ context: string; /** The phone number the message comes from. */ from: string; /** The destination number of the message. */ to: string; /** The direction of the message: `inbound` or `outbound`. */ direction: string; /** Array of strings with message tags. */ tags: string[]; /** Body of the message */ body: string; /** Array of URLs media. */ media: string[]; /** Number of segments of the message. */ segments: number; /** Reason why the message was not sent. This is present only in case of failure. */ reason?: string; } interface MessageOptions { message_id: string; message_state: MessagingMessageState; context: string; from_number: string; to_number: string; direction: 'inbound' | 'outbound'; tags: string[]; body: string; media: string[]; segments: number; reason?: string; } /** @internal */ export declare class Message implements MessageContract { id: string; state: MessagingMessageState; context: string; from: string; to: string; body: string; direction: 'inbound' | 'outbound'; media: string[]; segments: number; tags: string[]; reason?: string; constructor(options: MessageOptions); } export {}; //# sourceMappingURL=Message.d.ts.map