import { DID } from "./DID"; import { AttachmentBase64, AttachmentDescriptor, AttachmentJsonData } from "./MessageAttachment"; import { JsonString } from "."; import { Pluto } from "../buildingBlocks/Pluto"; import { JsonObj } from "../../utils"; export declare enum MessageDirection { SENT = 0, RECEIVED = 1 } export declare class Message implements Pluto.Storable { readonly id: string; readonly piuri: string; readonly from?: DID | undefined; readonly to?: DID | undefined; readonly attachments: AttachmentDescriptor[]; readonly thid?: string | undefined; readonly extraHeaders: JsonObj; readonly createdTime: number; readonly expiresTimePlus: number; readonly ack: string[]; direction: MessageDirection; readonly fromPrior?: string | undefined; readonly pthid?: string | undefined; uuid: string; readonly body: JsonObj; constructor(body: string | JsonObj, id: string | undefined, piuri: string, from?: DID | undefined, to?: DID | undefined, attachments?: AttachmentDescriptor[], thid?: string | undefined, extraHeaders?: JsonObj, createdTime?: number, expiresTimePlus?: number, ack?: string[], direction?: MessageDirection, fromPrior?: string | undefined, pthid?: string | undefined); static fromJson(jsonString: JsonString | any): Message; static isBase64Attachment(data: any): data is AttachmentBase64; static isJsonAttachment(data: any): data is AttachmentJsonData; } export declare namespace Message { namespace Attachment { /** * Get the presumed JSON from the attachment * * @param {AttachmentDescriptor} attachment * @returns */ const extractJSON: (attachment: AttachmentDescriptor) => any; } }