import { SmrtObject } from '@happyvertical/smrt-core'; import { MessageOptions, MessageSendResult, SendMessageOptions, SendStatus } from '../types'; export declare class Message extends SmrtObject { tenantId: string | null; accountId: string; personaId: string | null; endpointId: string | null; correlationId: string; threadId: string; subject: string; body: string; fromAddress: string; fromName: string; toAddresses: string; date: Date | null; isRead: boolean; isFlagged: boolean; hasAttachments: boolean; size: number; metadata: string; sendStatus: SendStatus; sentAt: Date | null; sendError: string; retryCount: number; maxRetries: number; scheduledSendAt: Date | null; inReplyToMessageId: string; createdAt: Date; updatedAt: Date; constructor(options?: MessageOptions); private finalizeSendLifecycle; /** * Get to addresses as parsed array */ getToAddresses(): Array<{ address: string; name?: string; }>; /** * Set to addresses from array */ setToAddresses(addresses: Array<{ address: string; name?: string; }>): void; /** * Get metadata as parsed object */ getMetadata(): Record; /** * Set metadata from object */ setMetadata(data: Record): void; /** * Mark message as read */ markRead(): Promise; /** * Mark message as unread */ markUnread(): Promise; /** * Toggle flagged status */ toggleFlagged(): Promise; /** * Check if message is unread */ isUnread(): boolean; /** * Get a short preview of the message body */ getPreview(maxLength?: number): string; /** * Get the account for this message */ getAccount(): Promise; getEndpoint(): Promise; /** * Get messages in the same thread */ getThreadMessages(): Promise; /** * Get attachments for this message */ getAttachments(): Promise; /** * Send this message via its account's sender */ send(options?: SendMessageOptions): Promise; /** * Retry sending a failed message */ retrySend(options?: SendMessageOptions): Promise; /** * Options for a derived draft (reply/forward) built from this message. Carries * the DB connection + tenant context from `this.options`, but strips this * message's own identity fields. When this message was hydrated from the DB, * `this.options` holds the row's `id`/`slug`/`context`/`_skipLoad`; spreading * those into a new draft would make `draft.save()` upsert onto the natural-key * conflict columns (`slug`/`context`/`_meta_type`) and overwrite the ORIGINAL * message instead of inserting a new row. See EmailAccount.childOptions(). */ protected draftOptions(): Record; /** * Create a reply to this message (returns unsaved draft) */ createReply(_options?: { replyAll?: boolean; }): Message; /** * Create a forward of this message (returns unsaved draft) */ createForward(): Message; /** * Build quoted body for reply/forward */ protected buildQuotedBody(): string; } //# sourceMappingURL=Message.d.ts.map