/** * ExplodeSettings content type for Convos. * * Matches the iOS ExplodeSettingsCodec: * - Content type: convos.org/explode_settings:1.0 * - Payload: JSON-encoded { expiresAt: ISO8601 string } * - fallback: "Conversation expires at {date}" * - shouldPush: true (so receiving clients can trigger their cleanup flow) * * Sent by the creator immediately before `removeMembers(all others)` + * `leaveGroup()` (per ADR 004 C9 amendment / ADR 011 ยง5). Receiving * clients drop the conversation locally on whichever arrives first: the * ExplodeSettings message or the MLS remove commit. */ import type { ContentTypeId, EncodedContent } from "@xmtp/node-bindings"; import type { ContentCodec } from "@xmtp/content-type-primitives"; import type { DecodedMessage } from "@xmtp/node-sdk"; export declare const ContentTypeExplodeSettings: ContentTypeId; export interface ExplodeSettingsContent { /** ISO 8601 timestamp when the conversation expires. */ expiresAt: string; } export declare class ExplodeSettingsCodec implements ContentCodec { get contentType(): ContentTypeId; encode(content: ExplodeSettingsContent): EncodedContent; decode(content: EncodedContent): ExplodeSettingsContent; fallback(content: ExplodeSettingsContent): string | undefined; shouldPush(_content: ExplodeSettingsContent): boolean; } /** * Encode an ExplodeSettings message directly as EncodedContent. Used by * senders that construct the wire payload without instantiating the codec. */ export declare function encodeExplodeSettings(expiresAt: Date): EncodedContent; export declare function isExplodeSettingsMessage(message: DecodedMessage): boolean; /** * Extract ExplodeSettings content from a DecodedMessage. When the codec is * registered on the client (the default), the SDK has already decoded the * payload and the first branch returns the typed object directly. The * EncodedContent fallback handles callers that hand the helper a raw * `{ content: Uint8Array }` object (test mocks, in-process forwarding, or * any future code path that bypasses the codec registry); without this * branch those callers would silently get `undefined`. * * Note: when an unregistered codec runs through the SDK proper the SDK * sets `content = undefined`, so the early-exit kicks in and the fallback * is unreachable. The fallback is load-bearing only for callers that * supply EncodedContent directly. */ export declare function getExplodeSettingsContent(message: DecodedMessage): ExplodeSettingsContent | undefined;