export type ContactAccess = { authorization: | "not-determined" | "restricted" | "denied" | "authorized" | "limited" | "unavailable"; readable: boolean; issue: string | null; }; export type ContactIdentity = { id: string; name: string }; export type Contact = ContactIdentity & { phoneNumbers: string[]; emailAddresses: string[] }; export type ContactPage = { contacts: Contact[]; hasMore: boolean; ambiguous: boolean; contactLookup: ContactAccess; }; export type Status = { contacts: ContactAccess; platform: "macOS"; osVersion: string; databaseExists: boolean; readable: boolean; extraSoftwareRequired: false; issue?: string; }; export type Conversation = { id: number; guid: string; identifier: string; name: string; service: string; participants: string[]; participantContacts: { handle: string; contacts: ContactIdentity[] }[]; contactName: string | null; }; export type ConversationPage = { contactLookup: ContactAccess; conversations: Conversation[]; hasMore: boolean; nextBeforeChatId: number | null; order: "newest-created-first"; }; export type Message = { id: number; chatId: number; chatGuid: string; chatName: string; service: string; sender: string | null; senderName: string | null; senderContacts: ContactIdentity[]; isFromMe: boolean; createdAt: string | null; text: string; textTruncated: boolean; textSource: "plain" | "attributed" | "unavailable"; attachmentCount: number; searchTextTruncated: boolean; }; export type MessagePage = { contactLookup: ContactAccess; messages: Message[]; scanned: number; unreadableTextRows: number; searchTruncatedRows: number; hasMore: boolean; nextBeforeMessageId: number | null; order: "newest-stored-first"; }; export type SendReceipt = | { status: "recorded"; retrySafe: false; messageId: number; messageGuid: string; chatId: number; service: "iMessage" | "SMS" | "RCS"; remoteDeliveryConfirmed: false; } | { status: "uncertain"; retrySafe: false; issue: string };