import Conversation, { GlobalConversation } from "./Conversation"; import { DMFile, DirectMessage } from "../types/GDPRDMs"; /** * Hold all the direct messages contained in a Twitter GDPR archive. */ export declare class DMArchive { protected me_id: string; protected index: { [convId: string]: Conversation; }; protected all_messages: GlobalConversation | undefined; protected sorted_date: Conversation[]; protected sorted_count: Conversation[]; constructor(me_id: string); /** Add a direct message file in current conversation object. */ add(convs: DMFile): void; /** Get a conversation with specific ID. undefined if it does not exists. */ get(id: string): Conversation; /** Test if archive has a conversation with ID {id} */ has(id: string): boolean; /** * Get a message by ID */ single(id: string): import("../types/GDPRDMs").LinkedDirectMessage; /** * Get the conversation related to a direct message. */ conversationOf(direct_message: string | DirectMessage): Conversation | undefined; /** * Get all conversations that have {user_id} in their participants. * * @param user_id Specifing an array of user ids find conversations * where **all** those users are participating. */ with(user_id: string | string[]): Conversation[]; /** * Get a conversation who has all messages in it. * * Please note that this method is not recommanded (and time-consuming at initialization). * Use the real conversations instead. * * Use cases: Search text in all messages, in every conversation / * Show messages in a timeline, without interest of who wrote it */ get dms(): GlobalConversation; /** Group conversations */ get groups(): Conversation[]; /** Direct (two participants) conversations */ get directs(): Conversation[]; /** Array of conversations registered in this archive. */ get all(): Conversation[]; /** Message count. */ get count(): number; /** Conversation count. */ get length(): number; /** All conversations sorted by last message sent date (descending). */ get sorted_by_date(): Conversation[]; /** All conversations sorted by message count (descending). */ get sorted_by_count(): Conversation[]; /** Iterates all over conversations. */ [Symbol.iterator](): Generator; } export default DMArchive;