UNPKG

@xmtp/content-type-reply

Version:

An XMTP content type to support replying to a message

39 lines (36 loc) 1.16 kB
import { ContentTypeId, ContentCodec, CodecRegistry, EncodedContent } from '@xmtp/content-type-primitives'; declare const ContentTypeReply: ContentTypeId; type Reply = { /** * The message ID for the message that is being replied to */ reference: string; /** * The inbox ID of the user who sent the message that is being replied to * * This only applies to group messages */ referenceInboxId?: string; /** * The content of the reply */ content: unknown; /** * The content type of the reply */ contentType: ContentTypeId; }; type ReplyParameters = { contentType: string; reference: string; referenceInboxId?: string; }; declare class ReplyCodec implements ContentCodec<Reply, ReplyParameters> { get contentType(): ContentTypeId; encode(content: Reply, registry: CodecRegistry): EncodedContent<ReplyParameters>; decode(content: EncodedContent<ReplyParameters>, registry: CodecRegistry): Reply; fallback(content: Reply): string | undefined; shouldPush(): boolean; } export { ContentTypeReply, ReplyCodec }; export type { Reply, ReplyParameters };