import { type SealedAttachmentKey } from "@gryt/crypto"; export type MlsDmContent = { type: "message"; /** Made by the sender, a UUID. Edits and deletes name it. */ id: string; text: string; replyTo?: string; /** Upload id to what `sealAttachment` returned; `openAttachment` takes it as `meta`. */ attachments?: Record; } | { type: "edit"; id: string; text: string; } | { type: "delete"; id: string; } | { type: "reaction"; /** The message reacted to, the way edits and deletes name theirs. */ id: string; /** A Unicode emoji, or a server emoji as `:name:`, the same string `chat:react` carries. */ emoji: string; /** Explicit rather than a toggle, so a repeat or a reorder lands the same on every device. */ action: "add" | "remove"; }; export declare const MLS_DM_CONTENT_VERSION = 1; /** The same bytes the phone writes: `v` first, then the content's fields in this order. */ export declare function encodeMlsDmContent(content: MlsDmContent): Uint8Array; /** Null for anything this version can't read: a newer version, a new type, or junk. */ export declare function decodeMlsDmContent(bytes: Uint8Array): MlsDmContent | null; /** * Like `decodeMlsDmContent`, but tells content from a newer app ("newer", skip it quietly) * apart from junk (null, which is worth counting). A known type with a bad field is junk. */ export declare function readMlsDmContent(bytes: Uint8Array): MlsDmContent | "newer" | null;