UNPKG

imessage-ts

Version:

TypeScript library for interacting with iMessage on macOS - send messages, monitor chats, and automate responses

46 lines 1.5 kB
import { Database } from './database'; import { MessageEntity, MessageQueryOptions, MessageAttachment, AttachmentQueryOptions } from '../types'; /** * Repository for accessing messages from the iMessage database */ export declare class MessageRepository { private database; constructor(database: Database); /** * Helper function to clean up extracted text by removing binary data */ private cleanMessageText; /** * Get messages from a conversation */ getMessages(options: MessageQueryOptions): Promise<MessageEntity[]>; /** * Get a message by ID */ getMessageById(id: string): Promise<MessageEntity | null>; /** * Get the latest messages across all conversations */ getLatestMessages(limit?: number): Promise<MessageEntity[]>; /** * Get messages after a specific date */ getMessagesAfterDate(date: Date): Promise<MessageEntity[]>; /** * Get attachments for a message */ getMessageAttachments(messageId: string): Promise<MessageAttachment[]>; /** * Get attachments across multiple messages */ getAttachments(options: AttachmentQueryOptions): Promise<MessageAttachment[]>; /** * Get the full path to an attachment file */ private getAttachmentPath; /** * Convert a JavaScript Date to Apple's timestamp format (nanoseconds since 2001-01-01) */ private convertDateToAppleTimestamp; } //# sourceMappingURL=message-repository.d.ts.map